diff options
author | David Spinadel <david.spinadel@intel.com> | 2012-03-10 22:00:14 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-12 19:22:09 +0100 |
commit | 6dfa8d019cd21d08634ceb65a3fb90d0648bd93b (patch) | |
tree | 04cb6b0be027598b782d8c91ab5ae681d3304d83 /drivers/net/wireless/iwlwifi/iwl-testmode.c | |
parent | iwlwifi: Add TLVs and fields for 16.0 uCode (diff) | |
download | linux-6dfa8d019cd21d08634ceb65a3fb90d0648bd93b.tar.xz linux-6dfa8d019cd21d08634ceb65a3fb90d0648bd93b.zip |
iwlwifi: change struct iwl_fw
Change iwl_fw struct to hold an array of fw_img instead of
three separated instances.
Change fw_img to hold an array of fw_desc instead of two
separate descriptors for instructions and data.
Change load_given_ucode, load_section, verification functions
etc. to support this structure.
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-testmode.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-testmode.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c index c6c084f45b72..76f7f9251436 100644 --- a/drivers/net/wireless/iwlwifi/iwl-testmode.c +++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c @@ -466,6 +466,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) unsigned char *rsp_data_ptr = NULL; int status = 0, rsp_data_len = 0; u32 devid, inst_size = 0, data_size = 0; + const struct fw_img *img; switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { case IWL_TM_CMD_APP2DEV_GET_DEVICENAME: @@ -597,23 +598,9 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) IWL_ERR(priv, "No uCode has not been loaded\n"); return -EINVAL; } else { - switch (priv->shrd->ucode_type) { - case IWL_UCODE_REGULAR: - inst_size = priv->fw->ucode_rt.code.len; - data_size = priv->fw->ucode_rt.data.len; - break; - case IWL_UCODE_INIT: - inst_size = priv->fw->ucode_init.code.len; - data_size = priv->fw->ucode_init.data.len; - break; - case IWL_UCODE_WOWLAN: - inst_size = priv->fw->ucode_wowlan.code.len; - data_size = priv->fw->ucode_wowlan.data.len; - break; - default: - IWL_ERR(priv, "Unsupported uCode type\n"); - break; - } + img = &priv->fw->img[priv->shrd->ucode_type]; + inst_size = img->sec[IWL_UCODE_SECTION_INST].len; + data_size = img->sec[IWL_UCODE_SECTION_DATA].len; } NLA_PUT_U32(skb, IWL_TM_ATTR_FW_TYPE, priv->shrd->ucode_type); NLA_PUT_U32(skb, IWL_TM_ATTR_FW_INST_SIZE, inst_size); |