iwlwifi: tlv: add support for IWL_UCODE_TLV_SDIO_ADMA_ADDR TLV
authorLiad Kaufman <liad.kaufman@intel.com>
Sun, 19 Oct 2014 14:58:15 +0000 (16:58 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 28 Dec 2014 18:05:09 +0000 (20:05 +0200)
A new TLV supplies the ADMA address for SDIO mode, allowing
the driver to configure the default base address to be this
(as given in the FW), rather than hardcoding the values to
use until the FW sends the ALIVE message.

Use the value given by the FW in the IWL_UCODE_TLV_SDIO_ADMA_ADDR
TLV for setting the default SDTM base address until the FW sends
the ALIVE message. If it isn't given in the FW - use the current
hardcoded values.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-drv.c
drivers/net/wireless/iwlwifi/iwl-fw-file.h
drivers/net/wireless/iwlwifi/iwl-fw.h
drivers/net/wireless/iwlwifi/iwl-trans.h
drivers/net/wireless/iwlwifi/mvm/ops.c

index 0381dc495b1c0f84b9e7cff94c52338fb7c8af94..0d3472679e4d46d6c0853d9bc6c676ae3fe3be27 100644 (file)
@@ -903,6 +903,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
                                            IWL_UCODE_REGULAR_USNIFFER,
                                            tlv_len);
                        break;
+               case IWL_UCODE_TLV_SDIO_ADMA_ADDR:
+                       if (tlv_len != sizeof(u32))
+                               goto invalid_tlv_len;
+                       drv->fw.sdio_adma_addr =
+                               le32_to_cpup((__le32 *)tlv_data);
+                       break;
                default:
                        IWL_DEBUG_INFO(drv, "unknown TLV: %d\n", tlv_type);
                        break;
index f2a047f6bb3e519a6ab3ce3032be18aac3aa9aa9..752c72b77fba29b9d5b3b2e20d718f36cabf3951 100644 (file)
@@ -132,6 +132,7 @@ enum iwl_ucode_tlv_type {
        IWL_UCODE_TLV_ENABLED_CAPABILITIES      = 30,
        IWL_UCODE_TLV_N_SCAN_CHANNELS           = 31,
        IWL_UCODE_TLV_SEC_RT_USNIFFER   = 34,
+       IWL_UCODE_TLV_SDIO_ADMA_ADDR    = 35,
        IWL_UCODE_TLV_FW_DBG_DEST       = 38,
        IWL_UCODE_TLV_FW_DBG_CONF       = 39,
 };
index e6dc3b8709492f06d7833ce74f5b87f886c8805f..ffd785cc67d6703a395b1809322de6a9f83f5f3d 100644 (file)
@@ -152,6 +152,8 @@ struct iwl_fw_cscheme_list {
  * @mvm_fw: indicates this is MVM firmware
  * @cipher_scheme: optional external cipher scheme.
  * @human_readable: human readable version
+ * @sdio_adma_addr: the default address to set for the ADMA in SDIO mode until
+ *     we get the ALIVE from the uCode
  * @dbg_dest_tlv: points to the destination TLV for debug
  * @dbg_conf_tlv: array of pointers to configuration TLVs for debug
  * @dbg_conf_tlv_len: lengths of the @dbg_conf_tlv entries
@@ -181,6 +183,8 @@ struct iwl_fw {
        struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS];
        u8 human_readable[FW_VER_HUMAN_READABLE_SZ];
 
+       u32 sdio_adma_addr;
+
        struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv;
        struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_MAX];
        size_t dbg_conf_tlv_len[FW_DBG_MAX];
index 10ae9d7da0afa886a861a33f01ca5e139c23253f..84d8477432a20420e796f0dbc3954f6d69e96655 100644 (file)
@@ -382,6 +382,8 @@ enum iwl_trans_status {
  *     are considered stuck and will trigger device restart
  * @command_names: array of command names, must be 256 entries
  *     (one for each command); for debugging only
+ * @sdio_adma_addr: the default address to set for the ADMA in SDIO mode until
+ *     we get the ALIVE from the uCode
  */
 struct iwl_trans_config {
        struct iwl_op_mode *op_mode;
@@ -396,6 +398,8 @@ struct iwl_trans_config {
        bool scd_set_active;
        unsigned int queue_watchdog_timeout;
        const char *const *command_names;
+
+       u32 sdio_adma_addr;
 };
 
 struct iwl_trans_dump_data {
index 6bb6546a734ba67c942378fd12bd0b23ad0ff67b..490696791cfd3e6f935157cf286872b3929707c9 100644 (file)
@@ -481,6 +481,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        trans_cfg.cmd_fifo = IWL_MVM_TX_FIFO_CMD;
        trans_cfg.scd_set_active = true;
 
+       trans_cfg.sdio_adma_addr = fw->sdio_adma_addr;
+
        snprintf(mvm->hw->wiphy->fw_version,
                 sizeof(mvm->hw->wiphy->fw_version),
                 "%s", fw->fw_version);