summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-ucode.c
diff options
context:
space:
mode:
authorDon Fry <donald.h.fry@intel.com>2012-02-08 00:00:12 +0100
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-17 19:28:20 +0100
commit6516174d1a42c1b1b2861360bf44fe9992fb0f7e (patch)
treeb6ae78dc87f2526e24408819d42e3fe412d68df8 /drivers/net/wireless/iwlwifi/iwl-ucode.c
parentiwlwifi: move firmware_loading_complete to iwl_nic (diff)
downloadlinux-6516174d1a42c1b1b2861360bf44fe9992fb0f7e.tar.xz
linux-6516174d1a42c1b1b2861360bf44fe9992fb0f7e.zip
iwlwifi: Move ucode pointers to iwl_fw
The ucode image is a ucode related thing not a transport one. Move them. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-ucode.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-ucode.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 51a8fb353a6e..36039eb54dd4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -99,9 +99,10 @@ static void iwl_free_fw_img(struct iwl_trans *trans, struct fw_img *img)
void iwl_dealloc_ucode(struct iwl_trans *trans)
{
- iwl_free_fw_img(trans, &trans->ucode_rt);
- iwl_free_fw_img(trans, &trans->ucode_init);
- iwl_free_fw_img(trans, &trans->ucode_wowlan);
+ struct iwl_nic *nic = nic(trans);
+ iwl_free_fw_img(trans, &nic->fw.ucode_rt);
+ iwl_free_fw_img(trans, &nic->fw.ucode_init);
+ iwl_free_fw_img(trans, &nic->fw.ucode_wowlan);
}
static int iwl_alloc_fw_desc(struct iwl_trans *trans, struct fw_desc *desc,
@@ -122,16 +123,16 @@ static int iwl_alloc_fw_desc(struct iwl_trans *trans, struct fw_desc *desc,
return 0;
}
-static inline struct fw_img *iwl_get_ucode_image(struct iwl_trans *trans,
+static inline struct fw_img *iwl_get_ucode_image(struct iwl_nic *nic,
enum iwl_ucode_type ucode_type)
{
switch (ucode_type) {
case IWL_UCODE_INIT:
- return &trans->ucode_init;
+ return &nic->fw.ucode_init;
case IWL_UCODE_WOWLAN:
- return &trans->ucode_wowlan;
+ return &nic->fw.ucode_wowlan;
case IWL_UCODE_REGULAR:
- return &trans->ucode_rt;
+ return &nic->fw.ucode_rt;
case IWL_UCODE_NONE:
break;
}
@@ -456,7 +457,7 @@ static void iwl_print_mismatch_inst(struct iwl_trans *trans,
static int iwl_verify_ucode(struct iwl_trans *trans,
enum iwl_ucode_type ucode_type)
{
- struct fw_img *img = iwl_get_ucode_image(trans, ucode_type);
+ struct fw_img *img = iwl_get_ucode_image(nic(trans), ucode_type);
if (!img) {
IWL_ERR(trans, "Invalid ucode requested (%d)\n", ucode_type);
@@ -583,7 +584,7 @@ int iwl_load_ucode_wait_alive(struct iwl_trans *trans,
old_type = trans->shrd->ucode_type;
trans->shrd->ucode_type = ucode_type;
- fw = iwl_get_ucode_image(trans, ucode_type);
+ fw = iwl_get_ucode_image(nic(trans), ucode_type);
if (!fw)
return -EINVAL;
@@ -647,7 +648,7 @@ int iwl_run_init_ucode(struct iwl_trans *trans)
lockdep_assert_held(&trans->shrd->mutex);
/* No init ucode required? Curious, but maybe ok */
- if (!trans->ucode_init.code.len)
+ if (!nic(trans)->fw.ucode_init.code.len)
return 0;
if (trans->shrd->ucode_type != IWL_UCODE_NONE)
@@ -1163,21 +1164,21 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
/* Runtime instructions and 2 copies of data:
* 1) unmodified from disk
* 2) backup cache for save/restore during power-downs */
- if (iwl_alloc_fw_desc(trans(priv), &trans(priv)->ucode_rt.code,
+ if (iwl_alloc_fw_desc(trans(priv), &nic(priv)->fw.ucode_rt.code,
pieces.inst, pieces.inst_size))
goto err_pci_alloc;
- if (iwl_alloc_fw_desc(trans(priv), &trans(priv)->ucode_rt.data,
+ if (iwl_alloc_fw_desc(trans(priv), &nic(priv)->fw.ucode_rt.data,
pieces.data, pieces.data_size))
goto err_pci_alloc;
/* Initialization instructions and data */
if (pieces.init_size && pieces.init_data_size) {
if (iwl_alloc_fw_desc(trans(priv),
- &trans(priv)->ucode_init.code,
+ &nic(priv)->fw.ucode_init.code,
pieces.init, pieces.init_size))
goto err_pci_alloc;
if (iwl_alloc_fw_desc(trans(priv),
- &trans(priv)->ucode_init.data,
+ &nic(priv)->fw.ucode_init.data,
pieces.init_data, pieces.init_data_size))
goto err_pci_alloc;
}
@@ -1185,12 +1186,12 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
/* WoWLAN instructions and data */
if (pieces.wowlan_inst_size && pieces.wowlan_data_size) {
if (iwl_alloc_fw_desc(trans(priv),
- &trans(priv)->ucode_wowlan.code,
+ &nic(priv)->fw.ucode_wowlan.code,
pieces.wowlan_inst,
pieces.wowlan_inst_size))
goto err_pci_alloc;
if (iwl_alloc_fw_desc(trans(priv),
- &trans(priv)->ucode_wowlan.data,
+ &nic(priv)->fw.ucode_wowlan.data,
pieces.wowlan_data,
pieces.wowlan_data_size))
goto err_pci_alloc;