Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278621
b: refs/heads/master
c: a96b724
h: refs/heads/master
i:
  278619: 9fa83c5
v: v3
  • Loading branch information
Don Fry authored and John W. Linville committed Dec 6, 2011
1 parent 84baa60 commit 228feec
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b96b09db60f8e0d9c6bc3ea00447953c16d8b2fc
refs/heads/master: a96b724d5ad7d44184d6a871bc1d35b005f2d53e
7 changes: 4 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,12 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,

/* default is to dump the entire data segment */
if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
struct iwl_trans *trans = trans(priv);
priv->dbgfs_sram_offset = 0x800000;
if (priv->ucode_type == IWL_UCODE_INIT)
priv->dbgfs_sram_len = trans(priv)->ucode_init.data.len;
if (trans->shrd->ucode_type == IWL_UCODE_INIT)
priv->dbgfs_sram_len = trans->ucode_init.data.len;
else
priv->dbgfs_sram_len = trans(priv)->ucode_rt.data.len;
priv->dbgfs_sram_len = trans->ucode_rt.data.len;
}
len = priv->dbgfs_sram_len;

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,6 @@ struct iwl_priv {
u32 ucode_ver; /* version of ucode, copy of
iwl_ucode.ver */

enum iwl_ucode_type ucode_type;
char firmware_name[25];

struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
Expand Down
20 changes: 20 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,23 @@ struct iwl_tid_data {
struct iwl_ht_agg agg;
};

/**
* enum iwl_ucode_type
*
* The type of ucode currently loaded on the hardware.
*
* @IWL_UCODE_NONE: No ucode loaded
* @IWL_UCODE_REGULAR: Normal runtime ucode
* @IWL_UCODE_INIT: Initial ucode
* @IWL_UCODE_WOWLAN: Wake on Wireless enabled ucode
*/
enum iwl_ucode_type {
IWL_UCODE_NONE,
IWL_UCODE_REGULAR,
IWL_UCODE_INIT,
IWL_UCODE_WOWLAN,
};

/**
* struct iwl_shared - shared fields for all the layers of the driver
*
Expand Down Expand Up @@ -300,6 +317,9 @@ struct iwl_shared {
struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT];

wait_queue_head_t wait_command_queue;

/* ucode related variables */
enum iwl_ucode_type ucode_type;
};

/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
return -ENOMSG;
}
size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]);
switch (priv->ucode_type) {
switch (priv->shrd->ucode_type) {
case IWL_UCODE_REGULAR:
maxsize = trans(priv)->ucode_rt.data.len;
break;
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
IWL_TRANS_GET_PCIE_TRANS(trans);

base = priv->device_pointers.error_event_table;
if (priv->ucode_type == IWL_UCODE_INIT) {
if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
if (!base)
base = priv->init_errlog_ptr;
} else {
Expand All @@ -607,7 +607,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
IWL_ERR(trans,
"Not valid error log pointer 0x%08X for %s uCode\n",
base,
(priv->ucode_type == IWL_UCODE_INIT)
(trans->shrd->ucode_type == IWL_UCODE_INIT)
? "Init" : "RT");
return;
}
Expand Down Expand Up @@ -710,7 +710,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
return pos;

base = priv->device_pointers.log_event_table;
if (priv->ucode_type == IWL_UCODE_INIT) {
if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
if (!base)
base = priv->init_evtlog_ptr;
} else {
Expand Down Expand Up @@ -824,7 +824,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
struct iwl_priv *priv = priv(trans);

base = priv->device_pointers.log_event_table;
if (priv->ucode_type == IWL_UCODE_INIT) {
if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
logsize = priv->init_evtlog_size;
if (!base)
base = priv->init_evtlog_ptr;
Expand All @@ -838,7 +838,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
IWL_ERR(trans,
"Invalid event log pointer 0x%08X for %s uCode\n",
base,
(priv->ucode_type == IWL_UCODE_INIT)
(trans->shrd->ucode_type == IWL_UCODE_INIT)
? "Init" : "RT");
return -EINVAL;
}
Expand Down
7 changes: 0 additions & 7 deletions trunk/drivers/net/wireless/iwlwifi/iwl-trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,6 @@ struct fw_img {
struct fw_desc data; /* firmware data image */
};

enum iwl_ucode_type {
IWL_UCODE_NONE,
IWL_UCODE_REGULAR,
IWL_UCODE_INIT,
IWL_UCODE_WOWLAN,
};

/**
* struct iwl_trans - transport common data
* @ops - pointer to iwl_trans_ops
Expand Down
25 changes: 13 additions & 12 deletions trunk/drivers/net/wireless/iwlwifi/iwl-ucode.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,41 +579,42 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
{
struct iwl_notification_wait alive_wait;
struct iwlagn_alive_data alive_data;
struct iwl_trans *trans = trans(priv);
int ret;
enum iwl_ucode_type old_type;

ret = iwl_trans_start_device(trans(priv));
ret = iwl_trans_start_device(trans);
if (ret)
return ret;

iwlagn_init_notification_wait(priv, &alive_wait, REPLY_ALIVE,
iwl_alive_fn, &alive_data);

old_type = priv->ucode_type;
priv->ucode_type = ucode_type;
old_type = trans->shrd->ucode_type;
trans->shrd->ucode_type = ucode_type;

ret = iwl_load_given_ucode(trans(priv), ucode_type);
ret = iwl_load_given_ucode(trans, ucode_type);
if (ret) {
priv->ucode_type = old_type;
trans->shrd->ucode_type = old_type;
iwlagn_remove_notification(priv, &alive_wait);
return ret;
}

iwl_trans_kick_nic(trans(priv));
iwl_trans_kick_nic(trans);

/*
* Some things may run in the background now, but we
* just wait for the ALIVE notification here.
*/
ret = iwlagn_wait_notification(priv, &alive_wait, UCODE_ALIVE_TIMEOUT);
if (ret) {
priv->ucode_type = old_type;
trans->shrd->ucode_type = old_type;
return ret;
}

if (!alive_data.valid) {
IWL_ERR(priv, "Loaded ucode is not valid!\n");
priv->ucode_type = old_type;
trans->shrd->ucode_type = old_type;
return -EIO;
}

Expand All @@ -623,9 +624,9 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
* skip it for WoWLAN.
*/
if (ucode_type != IWL_UCODE_WOWLAN) {
ret = iwl_verify_ucode(trans(priv), ucode_type);
ret = iwl_verify_ucode(trans, ucode_type);
if (ret) {
priv->ucode_type = old_type;
trans->shrd->ucode_type = old_type;
return ret;
}

Expand All @@ -637,7 +638,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
if (ret) {
IWL_WARN(priv,
"Could not complete ALIVE transition: %d\n", ret);
priv->ucode_type = old_type;
trans->shrd->ucode_type = old_type;
return ret;
}

Expand All @@ -655,7 +656,7 @@ int iwlagn_run_init_ucode(struct iwl_priv *priv)
if (!trans(priv)->ucode_init.code.len)
return 0;

if (priv->ucode_type != IWL_UCODE_NONE)
if (priv->shrd->ucode_type != IWL_UCODE_NONE)
return 0;

iwlagn_init_notification_wait(priv, &calib_wait,
Expand Down

0 comments on commit 228feec

Please sign in to comment.