diff options
author | Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> | 2012-03-15 16:26:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-09 16:37:31 -0400 |
commit | a42506eb27aa4b8cbe3253b4d436c2f0a57e56e8 (patch) | |
tree | 9aa380359e20b4704bedf1266ac9aeb7ec217abe | |
parent | 2fdfc476cf3bcf561448e290e00094de4ef4af5d (diff) |
iwlwifi: move ucode_type from shared to op_mode
This variable holds the ucode currently
running on the device; which is determined by
op_mode, so move this parameter there.
Also, the name of the variable is a bit
misleading, so rename it to cur_ucode.
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-testmode.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-ucode.c | 14 |
6 files changed, 18 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index ce41437f0ce0..347613049141 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1632,7 +1632,7 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1632 | struct iwl_error_event_table table; | 1632 | struct iwl_error_event_table table; |
1633 | 1633 | ||
1634 | base = priv->device_pointers.error_event_table; | 1634 | base = priv->device_pointers.error_event_table; |
1635 | if (priv->shrd->ucode_type == IWL_UCODE_INIT) { | 1635 | if (priv->cur_ucode == IWL_UCODE_INIT) { |
1636 | if (!base) | 1636 | if (!base) |
1637 | base = priv->shrd->fw->init_errlog_ptr; | 1637 | base = priv->shrd->fw->init_errlog_ptr; |
1638 | } else { | 1638 | } else { |
@@ -1644,7 +1644,7 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1644 | IWL_ERR(priv, | 1644 | IWL_ERR(priv, |
1645 | "Not valid error log pointer 0x%08X for %s uCode\n", | 1645 | "Not valid error log pointer 0x%08X for %s uCode\n", |
1646 | base, | 1646 | base, |
1647 | (priv->shrd->ucode_type == IWL_UCODE_INIT) | 1647 | (priv->cur_ucode == IWL_UCODE_INIT) |
1648 | ? "Init" : "RT"); | 1648 | ? "Init" : "RT"); |
1649 | return; | 1649 | return; |
1650 | } | 1650 | } |
@@ -1723,7 +1723,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, | |||
1723 | return pos; | 1723 | return pos; |
1724 | 1724 | ||
1725 | base = priv->device_pointers.log_event_table; | 1725 | base = priv->device_pointers.log_event_table; |
1726 | if (priv->shrd->ucode_type == IWL_UCODE_INIT) { | 1726 | if (priv->cur_ucode == IWL_UCODE_INIT) { |
1727 | if (!base) | 1727 | if (!base) |
1728 | base = priv->shrd->fw->init_evtlog_ptr; | 1728 | base = priv->shrd->fw->init_evtlog_ptr; |
1729 | } else { | 1729 | } else { |
@@ -1838,7 +1838,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1838 | struct iwl_trans *trans = trans(priv); | 1838 | struct iwl_trans *trans = trans(priv); |
1839 | 1839 | ||
1840 | base = priv->device_pointers.log_event_table; | 1840 | base = priv->device_pointers.log_event_table; |
1841 | if (priv->shrd->ucode_type == IWL_UCODE_INIT) { | 1841 | if (priv->cur_ucode == IWL_UCODE_INIT) { |
1842 | logsize = priv->shrd->fw->init_evtlog_size; | 1842 | logsize = priv->shrd->fw->init_evtlog_size; |
1843 | if (!base) | 1843 | if (!base) |
1844 | base = priv->shrd->fw->init_evtlog_ptr; | 1844 | base = priv->shrd->fw->init_evtlog_ptr; |
@@ -1852,7 +1852,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1852 | IWL_ERR(priv, | 1852 | IWL_ERR(priv, |
1853 | "Invalid event log pointer 0x%08X for %s uCode\n", | 1853 | "Invalid event log pointer 0x%08X for %s uCode\n", |
1854 | base, | 1854 | base, |
1855 | (priv->shrd->ucode_type == IWL_UCODE_INIT) | 1855 | (priv->cur_ucode == IWL_UCODE_INIT) |
1856 | ? "Init" : "RT"); | 1856 | ? "Init" : "RT"); |
1857 | return -EINVAL; | 1857 | return -EINVAL; |
1858 | } | 1858 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index d4b51a5855a1..a2baf1756520 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -240,7 +240,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, | |||
240 | IWL_ERR(priv, "No uCode has been loadded.\n"); | 240 | IWL_ERR(priv, "No uCode has been loadded.\n"); |
241 | return -EINVAL; | 241 | return -EINVAL; |
242 | } | 242 | } |
243 | img = &priv->fw->img[priv->shrd->ucode_type]; | 243 | img = &priv->fw->img[priv->cur_ucode]; |
244 | priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; | 244 | priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; |
245 | } | 245 | } |
246 | len = priv->dbgfs_sram_len; | 246 | len = priv->dbgfs_sram_len; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 2f54c9baa3df..99be58940e27 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -997,6 +997,9 @@ struct iwl_priv { | |||
997 | u32 error_event_table; | 997 | u32 error_event_table; |
998 | u32 log_event_table; | 998 | u32 log_event_table; |
999 | } device_pointers; | 999 | } device_pointers; |
1000 | |||
1001 | /* indicator of loaded ucode image */ | ||
1002 | enum iwl_ucode_type cur_ucode; | ||
1000 | }; /*iwl_priv */ | 1003 | }; /*iwl_priv */ |
1001 | 1004 | ||
1002 | extern struct kmem_cache *iwl_tx_cmd_pool; | 1005 | extern struct kmem_cache *iwl_tx_cmd_pool; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index ef3f0b9064a8..90f464e4e88d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h | |||
@@ -346,7 +346,6 @@ struct iwl_cfg { | |||
346 | * @hw_params: see struct iwl_hw_params | 346 | * @hw_params: see struct iwl_hw_params |
347 | * @lock: protect general shared data | 347 | * @lock: protect general shared data |
348 | * @eeprom: pointer to the eeprom/OTP image | 348 | * @eeprom: pointer to the eeprom/OTP image |
349 | * @ucode_type: indicator of loaded ucode image | ||
350 | */ | 349 | */ |
351 | struct iwl_shared { | 350 | struct iwl_shared { |
352 | unsigned long status; | 351 | unsigned long status; |
@@ -360,9 +359,6 @@ struct iwl_shared { | |||
360 | /* eeprom -- this is in the card's little endian byte order */ | 359 | /* eeprom -- this is in the card's little endian byte order */ |
361 | u8 *eeprom; | 360 | u8 *eeprom; |
362 | 361 | ||
363 | /* ucode related variables */ | ||
364 | enum iwl_ucode_type ucode_type; | ||
365 | |||
366 | }; | 362 | }; |
367 | 363 | ||
368 | /*Whatever _m is (iwl_trans, iwl_priv, these macros will work */ | 364 | /*Whatever _m is (iwl_trans, iwl_priv, these macros will work */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c index 645b8500d02f..d65dac88e190 100644 --- a/drivers/net/wireless/iwlwifi/iwl-testmode.c +++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c | |||
@@ -601,11 +601,11 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
601 | IWL_ERR(priv, "No uCode has not been loaded\n"); | 601 | IWL_ERR(priv, "No uCode has not been loaded\n"); |
602 | return -EINVAL; | 602 | return -EINVAL; |
603 | } else { | 603 | } else { |
604 | img = &priv->fw->img[priv->shrd->ucode_type]; | 604 | img = &priv->fw->img[priv->cur_ucode]; |
605 | inst_size = img->sec[IWL_UCODE_SECTION_INST].len; | 605 | inst_size = img->sec[IWL_UCODE_SECTION_INST].len; |
606 | data_size = img->sec[IWL_UCODE_SECTION_DATA].len; | 606 | data_size = img->sec[IWL_UCODE_SECTION_DATA].len; |
607 | } | 607 | } |
608 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_TYPE, priv->shrd->ucode_type); | 608 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_TYPE, priv->cur_ucode); |
609 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_INST_SIZE, inst_size); | 609 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_INST_SIZE, inst_size); |
610 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_DATA_SIZE, data_size); | 610 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_DATA_SIZE, data_size); |
611 | status = cfg80211_testmode_reply(skb); | 611 | status = cfg80211_testmode_reply(skb); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index 993f1a3a0078..ba7c9f883cb6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c | |||
@@ -391,8 +391,8 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | |||
391 | enum iwl_ucode_type old_type; | 391 | enum iwl_ucode_type old_type; |
392 | static const u8 alive_cmd[] = { REPLY_ALIVE }; | 392 | static const u8 alive_cmd[] = { REPLY_ALIVE }; |
393 | 393 | ||
394 | old_type = priv->shrd->ucode_type; | 394 | old_type = priv->cur_ucode; |
395 | priv->shrd->ucode_type = ucode_type; | 395 | priv->cur_ucode = ucode_type; |
396 | fw = iwl_get_ucode_image(priv, ucode_type); | 396 | fw = iwl_get_ucode_image(priv, ucode_type); |
397 | 397 | ||
398 | priv->ucode_loaded = false; | 398 | priv->ucode_loaded = false; |
@@ -406,7 +406,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | |||
406 | 406 | ||
407 | ret = iwl_trans_start_fw(trans(priv), fw); | 407 | ret = iwl_trans_start_fw(trans(priv), fw); |
408 | if (ret) { | 408 | if (ret) { |
409 | priv->shrd->ucode_type = old_type; | 409 | priv->cur_ucode = old_type; |
410 | iwl_remove_notification(&priv->notif_wait, &alive_wait); | 410 | iwl_remove_notification(&priv->notif_wait, &alive_wait); |
411 | return ret; | 411 | return ret; |
412 | } | 412 | } |
@@ -418,13 +418,13 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | |||
418 | ret = iwl_wait_notification(&priv->notif_wait, &alive_wait, | 418 | ret = iwl_wait_notification(&priv->notif_wait, &alive_wait, |
419 | UCODE_ALIVE_TIMEOUT); | 419 | UCODE_ALIVE_TIMEOUT); |
420 | if (ret) { | 420 | if (ret) { |
421 | priv->shrd->ucode_type = old_type; | 421 | priv->cur_ucode = old_type; |
422 | return ret; | 422 | return ret; |
423 | } | 423 | } |
424 | 424 | ||
425 | if (!alive_data.valid) { | 425 | if (!alive_data.valid) { |
426 | IWL_ERR(priv, "Loaded ucode is not valid!\n"); | 426 | IWL_ERR(priv, "Loaded ucode is not valid!\n"); |
427 | priv->shrd->ucode_type = old_type; | 427 | priv->cur_ucode = old_type; |
428 | return -EIO; | 428 | return -EIO; |
429 | } | 429 | } |
430 | 430 | ||
@@ -436,7 +436,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | |||
436 | if (ucode_type != IWL_UCODE_WOWLAN) { | 436 | if (ucode_type != IWL_UCODE_WOWLAN) { |
437 | ret = iwl_verify_ucode(priv, ucode_type); | 437 | ret = iwl_verify_ucode(priv, ucode_type); |
438 | if (ret) { | 438 | if (ret) { |
439 | priv->shrd->ucode_type = old_type; | 439 | priv->cur_ucode = old_type; |
440 | return ret; | 440 | return ret; |
441 | } | 441 | } |
442 | 442 | ||
@@ -448,7 +448,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | |||
448 | if (ret) { | 448 | if (ret) { |
449 | IWL_WARN(priv, | 449 | IWL_WARN(priv, |
450 | "Could not complete ALIVE transition: %d\n", ret); | 450 | "Could not complete ALIVE transition: %d\n", ret); |
451 | priv->shrd->ucode_type = old_type; | 451 | priv->cur_ucode = old_type; |
452 | return ret; | 452 | return ret; |
453 | } | 453 | } |
454 | 454 | ||