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>
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 51a8fb3..36039eb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -99,9 +99,10 @@
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 @@
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 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 @@
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 @@
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 @@
/* 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 @@
/* 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;