struct iwl_error_event_table table;
base = priv->device_pointers.error_event_table;
- if (priv->shrd->ucode_type == IWL_UCODE_INIT) {
+ if (priv->cur_ucode == IWL_UCODE_INIT) {
if (!base)
base = priv->shrd->fw->init_errlog_ptr;
} else {
IWL_ERR(priv,
"Not valid error log pointer 0x%08X for %s uCode\n",
base,
- (priv->shrd->ucode_type == IWL_UCODE_INIT)
+ (priv->cur_ucode == IWL_UCODE_INIT)
? "Init" : "RT");
return;
}
return pos;
base = priv->device_pointers.log_event_table;
- if (priv->shrd->ucode_type == IWL_UCODE_INIT) {
+ if (priv->cur_ucode == IWL_UCODE_INIT) {
if (!base)
base = priv->shrd->fw->init_evtlog_ptr;
} else {
struct iwl_trans *trans = trans(priv);
base = priv->device_pointers.log_event_table;
- if (priv->shrd->ucode_type == IWL_UCODE_INIT) {
+ if (priv->cur_ucode == IWL_UCODE_INIT) {
logsize = priv->shrd->fw->init_evtlog_size;
if (!base)
base = priv->shrd->fw->init_evtlog_ptr;
IWL_ERR(priv,
"Invalid event log pointer 0x%08X for %s uCode\n",
base,
- (priv->shrd->ucode_type == IWL_UCODE_INIT)
+ (priv->cur_ucode == IWL_UCODE_INIT)
? "Init" : "RT");
return -EINVAL;
}
IWL_ERR(priv, "No uCode has been loadded.\n");
return -EINVAL;
}
- img = &priv->fw->img[priv->shrd->ucode_type];
+ img = &priv->fw->img[priv->cur_ucode];
priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len;
}
len = priv->dbgfs_sram_len;
u32 error_event_table;
u32 log_event_table;
} device_pointers;
+
+ /* indicator of loaded ucode image */
+ enum iwl_ucode_type cur_ucode;
}; /*iwl_priv */
extern struct kmem_cache *iwl_tx_cmd_pool;
* @hw_params: see struct iwl_hw_params
* @lock: protect general shared data
* @eeprom: pointer to the eeprom/OTP image
- * @ucode_type: indicator of loaded ucode image
*/
struct iwl_shared {
unsigned long status;
/* eeprom -- this is in the card's little endian byte order */
u8 *eeprom;
- /* ucode related variables */
- enum iwl_ucode_type ucode_type;
-
};
/*Whatever _m is (iwl_trans, iwl_priv, these macros will work */
IWL_ERR(priv, "No uCode has not been loaded\n");
return -EINVAL;
} else {
- img = &priv->fw->img[priv->shrd->ucode_type];
+ img = &priv->fw->img[priv->cur_ucode];
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_TYPE, priv->cur_ucode);
NLA_PUT_U32(skb, IWL_TM_ATTR_FW_INST_SIZE, inst_size);
NLA_PUT_U32(skb, IWL_TM_ATTR_FW_DATA_SIZE, data_size);
status = cfg80211_testmode_reply(skb);
enum iwl_ucode_type old_type;
static const u8 alive_cmd[] = { REPLY_ALIVE };
- old_type = priv->shrd->ucode_type;
- priv->shrd->ucode_type = ucode_type;
+ old_type = priv->cur_ucode;
+ priv->cur_ucode = ucode_type;
fw = iwl_get_ucode_image(priv, ucode_type);
priv->ucode_loaded = false;
ret = iwl_trans_start_fw(trans(priv), fw);
if (ret) {
- priv->shrd->ucode_type = old_type;
+ priv->cur_ucode = old_type;
iwl_remove_notification(&priv->notif_wait, &alive_wait);
return ret;
}
ret = iwl_wait_notification(&priv->notif_wait, &alive_wait,
UCODE_ALIVE_TIMEOUT);
if (ret) {
- priv->shrd->ucode_type = old_type;
+ priv->cur_ucode = old_type;
return ret;
}
if (!alive_data.valid) {
IWL_ERR(priv, "Loaded ucode is not valid!\n");
- priv->shrd->ucode_type = old_type;
+ priv->cur_ucode = old_type;
return -EIO;
}
if (ucode_type != IWL_UCODE_WOWLAN) {
ret = iwl_verify_ucode(priv, ucode_type);
if (ret) {
- priv->shrd->ucode_type = old_type;
+ priv->cur_ucode = old_type;
return ret;
}
if (ret) {
IWL_WARN(priv,
"Could not complete ALIVE transition: %d\n", ret);
- priv->shrd->ucode_type = old_type;
+ priv->cur_ucode = old_type;
return ret;
}