aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-ucode.c25
7 files changed, 43 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 68b04f5b10ce..ccbcab40e78f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -234,11 +234,12 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
234 234
235 /* default is to dump the entire data segment */ 235 /* default is to dump the entire data segment */
236 if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { 236 if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
237 struct iwl_trans *trans = trans(priv);
237 priv->dbgfs_sram_offset = 0x800000; 238 priv->dbgfs_sram_offset = 0x800000;
238 if (priv->ucode_type == IWL_UCODE_INIT) 239 if (trans->shrd->ucode_type == IWL_UCODE_INIT)
239 priv->dbgfs_sram_len = trans(priv)->ucode_init.data.len; 240 priv->dbgfs_sram_len = trans->ucode_init.data.len;
240 else 241 else
241 priv->dbgfs_sram_len = trans(priv)->ucode_rt.data.len; 242 priv->dbgfs_sram_len = trans->ucode_rt.data.len;
242 } 243 }
243 len = priv->dbgfs_sram_len; 244 len = priv->dbgfs_sram_len;
244 245
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index cb24adbae082..0019a23d6d49 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -889,7 +889,6 @@ struct iwl_priv {
889 u32 ucode_ver; /* version of ucode, copy of 889 u32 ucode_ver; /* version of ucode, copy of
890 iwl_ucode.ver */ 890 iwl_ucode.ver */
891 891
892 enum iwl_ucode_type ucode_type;
893 char firmware_name[25]; 892 char firmware_name[25];
894 893
895 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; 894 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 47be77a8a0a7..70bb9b83c6a1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -257,6 +257,23 @@ struct iwl_tid_data {
257}; 257};
258 258
259/** 259/**
260 * enum iwl_ucode_type
261 *
262 * The type of ucode currently loaded on the hardware.
263 *
264 * @IWL_UCODE_NONE: No ucode loaded
265 * @IWL_UCODE_REGULAR: Normal runtime ucode
266 * @IWL_UCODE_INIT: Initial ucode
267 * @IWL_UCODE_WOWLAN: Wake on Wireless enabled ucode
268 */
269enum iwl_ucode_type {
270 IWL_UCODE_NONE,
271 IWL_UCODE_REGULAR,
272 IWL_UCODE_INIT,
273 IWL_UCODE_WOWLAN,
274};
275
276/**
260 * struct iwl_shared - shared fields for all the layers of the driver 277 * struct iwl_shared - shared fields for all the layers of the driver
261 * 278 *
262 * @dbg_level_dev: dbg level set per device. Prevails on 279 * @dbg_level_dev: dbg level set per device. Prevails on
@@ -300,6 +317,9 @@ struct iwl_shared {
300 struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT]; 317 struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT];
301 318
302 wait_queue_head_t wait_command_queue; 319 wait_queue_head_t wait_command_queue;
320
321 /* ucode related variables */
322 enum iwl_ucode_type ucode_type;
303}; 323};
304 324
305/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */ 325/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c
index 3c9762628760..ed2a3d749b1b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c
@@ -710,7 +710,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
710 return -ENOMSG; 710 return -ENOMSG;
711 } 711 }
712 size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]); 712 size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]);
713 switch (priv->ucode_type) { 713 switch (priv->shrd->ucode_type) {
714 case IWL_UCODE_REGULAR: 714 case IWL_UCODE_REGULAR:
715 maxsize = trans(priv)->ucode_rt.data.len; 715 maxsize = trans(priv)->ucode_rt.data.len;
716 break; 716 break;
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index ee126f844a5c..becd92173ddd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -595,7 +595,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
595 IWL_TRANS_GET_PCIE_TRANS(trans); 595 IWL_TRANS_GET_PCIE_TRANS(trans);
596 596
597 base = priv->device_pointers.error_event_table; 597 base = priv->device_pointers.error_event_table;
598 if (priv->ucode_type == IWL_UCODE_INIT) { 598 if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
599 if (!base) 599 if (!base)
600 base = priv->init_errlog_ptr; 600 base = priv->init_errlog_ptr;
601 } else { 601 } else {
@@ -607,7 +607,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
607 IWL_ERR(trans, 607 IWL_ERR(trans,
608 "Not valid error log pointer 0x%08X for %s uCode\n", 608 "Not valid error log pointer 0x%08X for %s uCode\n",
609 base, 609 base,
610 (priv->ucode_type == IWL_UCODE_INIT) 610 (trans->shrd->ucode_type == IWL_UCODE_INIT)
611 ? "Init" : "RT"); 611 ? "Init" : "RT");
612 return; 612 return;
613 } 613 }
@@ -710,7 +710,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
710 return pos; 710 return pos;
711 711
712 base = priv->device_pointers.log_event_table; 712 base = priv->device_pointers.log_event_table;
713 if (priv->ucode_type == IWL_UCODE_INIT) { 713 if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
714 if (!base) 714 if (!base)
715 base = priv->init_evtlog_ptr; 715 base = priv->init_evtlog_ptr;
716 } else { 716 } else {
@@ -824,7 +824,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
824 struct iwl_priv *priv = priv(trans); 824 struct iwl_priv *priv = priv(trans);
825 825
826 base = priv->device_pointers.log_event_table; 826 base = priv->device_pointers.log_event_table;
827 if (priv->ucode_type == IWL_UCODE_INIT) { 827 if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
828 logsize = priv->init_evtlog_size; 828 logsize = priv->init_evtlog_size;
829 if (!base) 829 if (!base)
830 base = priv->init_evtlog_ptr; 830 base = priv->init_evtlog_ptr;
@@ -838,7 +838,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
838 IWL_ERR(trans, 838 IWL_ERR(trans,
839 "Invalid event log pointer 0x%08X for %s uCode\n", 839 "Invalid event log pointer 0x%08X for %s uCode\n",
840 base, 840 base,
841 (priv->ucode_type == IWL_UCODE_INIT) 841 (trans->shrd->ucode_type == IWL_UCODE_INIT)
842 ? "Init" : "RT"); 842 ? "Init" : "RT");
843 return -EINVAL; 843 return -EINVAL;
844 } 844 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 50227ebc0ee2..4a29b8ab998e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -220,13 +220,6 @@ struct fw_img {
220 struct fw_desc data; /* firmware data image */ 220 struct fw_desc data; /* firmware data image */
221}; 221};
222 222
223enum iwl_ucode_type {
224 IWL_UCODE_NONE,
225 IWL_UCODE_REGULAR,
226 IWL_UCODE_INIT,
227 IWL_UCODE_WOWLAN,
228};
229
230/** 223/**
231 * struct iwl_trans - transport common data 224 * struct iwl_trans - transport common data
232 * @ops - pointer to iwl_trans_ops 225 * @ops - pointer to iwl_trans_ops
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 0da4b8ece11c..1b23b99c474c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -579,27 +579,28 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
579{ 579{
580 struct iwl_notification_wait alive_wait; 580 struct iwl_notification_wait alive_wait;
581 struct iwlagn_alive_data alive_data; 581 struct iwlagn_alive_data alive_data;
582 struct iwl_trans *trans = trans(priv);
582 int ret; 583 int ret;
583 enum iwl_ucode_type old_type; 584 enum iwl_ucode_type old_type;
584 585
585 ret = iwl_trans_start_device(trans(priv)); 586 ret = iwl_trans_start_device(trans);
586 if (ret) 587 if (ret)
587 return ret; 588 return ret;
588 589
589 iwlagn_init_notification_wait(priv, &alive_wait, REPLY_ALIVE, 590 iwlagn_init_notification_wait(priv, &alive_wait, REPLY_ALIVE,
590 iwl_alive_fn, &alive_data); 591 iwl_alive_fn, &alive_data);
591 592
592 old_type = priv->ucode_type; 593 old_type = trans->shrd->ucode_type;
593 priv->ucode_type = ucode_type; 594 trans->shrd->ucode_type = ucode_type;
594 595
595 ret = iwl_load_given_ucode(trans(priv), ucode_type); 596 ret = iwl_load_given_ucode(trans, ucode_type);
596 if (ret) { 597 if (ret) {
597 priv->ucode_type = old_type; 598 trans->shrd->ucode_type = old_type;
598 iwlagn_remove_notification(priv, &alive_wait); 599 iwlagn_remove_notification(priv, &alive_wait);
599 return ret; 600 return ret;
600 } 601 }
601 602
602 iwl_trans_kick_nic(trans(priv)); 603 iwl_trans_kick_nic(trans);
603 604
604 /* 605 /*
605 * Some things may run in the background now, but we 606 * Some things may run in the background now, but we
@@ -607,13 +608,13 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
607 */ 608 */
608 ret = iwlagn_wait_notification(priv, &alive_wait, UCODE_ALIVE_TIMEOUT); 609 ret = iwlagn_wait_notification(priv, &alive_wait, UCODE_ALIVE_TIMEOUT);
609 if (ret) { 610 if (ret) {
610 priv->ucode_type = old_type; 611 trans->shrd->ucode_type = old_type;
611 return ret; 612 return ret;
612 } 613 }
613 614
614 if (!alive_data.valid) { 615 if (!alive_data.valid) {
615 IWL_ERR(priv, "Loaded ucode is not valid!\n"); 616 IWL_ERR(priv, "Loaded ucode is not valid!\n");
616 priv->ucode_type = old_type; 617 trans->shrd->ucode_type = old_type;
617 return -EIO; 618 return -EIO;
618 } 619 }
619 620
@@ -623,9 +624,9 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
623 * skip it for WoWLAN. 624 * skip it for WoWLAN.
624 */ 625 */
625 if (ucode_type != IWL_UCODE_WOWLAN) { 626 if (ucode_type != IWL_UCODE_WOWLAN) {
626 ret = iwl_verify_ucode(trans(priv), ucode_type); 627 ret = iwl_verify_ucode(trans, ucode_type);
627 if (ret) { 628 if (ret) {
628 priv->ucode_type = old_type; 629 trans->shrd->ucode_type = old_type;
629 return ret; 630 return ret;
630 } 631 }
631 632
@@ -637,7 +638,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
637 if (ret) { 638 if (ret) {
638 IWL_WARN(priv, 639 IWL_WARN(priv,
639 "Could not complete ALIVE transition: %d\n", ret); 640 "Could not complete ALIVE transition: %d\n", ret);
640 priv->ucode_type = old_type; 641 trans->shrd->ucode_type = old_type;
641 return ret; 642 return ret;
642 } 643 }
643 644
@@ -655,7 +656,7 @@ int iwlagn_run_init_ucode(struct iwl_priv *priv)
655 if (!trans(priv)->ucode_init.code.len) 656 if (!trans(priv)->ucode_init.code.len)
656 return 0; 657 return 0;
657 658
658 if (priv->ucode_type != IWL_UCODE_NONE) 659 if (priv->shrd->ucode_type != IWL_UCODE_NONE)
659 return 0; 660 return 0;
660 661
661 iwlagn_init_notification_wait(priv, &calib_wait, 662 iwlagn_init_notification_wait(priv, &calib_wait,