aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-08-26 02:10:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-29 15:25:31 -0400
commit6ac2f839b0b21225a65f41802c5f0df5eff4f16c (patch)
treef95f8dd069df32435d08f7f85b37583c4acb01af /drivers/net
parent10b15e6f67ba4d9abb8788100a5267341cc98b7b (diff)
iwlagn: priv->mutex moves to iwl_shared
Since it is used by all the layers, it needs to move to iwl_shared. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tt.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ucode.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c98
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sv-open.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-rx-pcie.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c2
16 files changed, 124 insertions, 122 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 7ace5078cc99..a604baa1383e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -778,7 +778,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
778 u8 scan_tx_antennas = hw_params(priv).valid_tx_ant; 778 u8 scan_tx_antennas = hw_params(priv).valid_tx_ant;
779 int ret; 779 int ret;
780 780
781 lockdep_assert_held(&priv->mutex); 781 lockdep_assert_held(&priv->shrd->mutex);
782 782
783 if (vif) 783 if (vif)
784 ctx = iwl_rxon_ctx_from_vif(vif); 784 ctx = iwl_rxon_ctx_from_vif(vif);
@@ -1165,7 +1165,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
1165 1165
1166void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control) 1166void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
1167{ 1167{
1168 mutex_lock(&priv->mutex); 1168 mutex_lock(&priv->shrd->mutex);
1169 ieee80211_stop_queues(priv->hw); 1169 ieee80211_stop_queues(priv->hw);
1170 if (iwlagn_txfifo_flush(priv, IWL_DROP_ALL)) { 1170 if (iwlagn_txfifo_flush(priv, IWL_DROP_ALL)) {
1171 IWL_ERR(priv, "flush request fail\n"); 1171 IWL_ERR(priv, "flush request fail\n");
@@ -1175,7 +1175,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
1175 iwlagn_wait_tx_queue_empty(priv); 1175 iwlagn_wait_tx_queue_empty(priv);
1176done: 1176done:
1177 ieee80211_wake_queues(priv->hw); 1177 ieee80211_wake_queues(priv->hw);
1178 mutex_unlock(&priv->mutex); 1178 mutex_unlock(&priv->shrd->mutex);
1179} 1179}
1180 1180
1181/* 1181/*
@@ -1372,7 +1372,7 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena)
1372 struct iwl_rxon_context *ctx, *found_ctx = NULL; 1372 struct iwl_rxon_context *ctx, *found_ctx = NULL;
1373 bool found_ap = false; 1373 bool found_ap = false;
1374 1374
1375 lockdep_assert_held(&priv->mutex); 1375 lockdep_assert_held(&priv->shrd->mutex);
1376 1376
1377 /* Check whether AP or GO mode is active. */ 1377 /* Check whether AP or GO mode is active. */
1378 if (rssi_ena) { 1378 if (rssi_ena) {
@@ -1485,7 +1485,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)
1485 break; 1485 break;
1486 } 1486 }
1487 1487
1488 mutex_lock(&priv->mutex); 1488 mutex_lock(&priv->shrd->mutex);
1489 1489
1490 /* 1490 /*
1491 * We can not send command to firmware while scanning. When the scan 1491 * We can not send command to firmware while scanning. When the scan
@@ -1513,7 +1513,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)
1513 */ 1513 */
1514 iwlagn_bt_coex_rssi_monitor(priv); 1514 iwlagn_bt_coex_rssi_monitor(priv);
1515out: 1515out:
1516 mutex_unlock(&priv->mutex); 1516 mutex_unlock(&priv->shrd->mutex);
1517} 1517}
1518 1518
1519/* 1519/*
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index fadfc38b87bf..f0292fe9b4e6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -132,7 +132,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv,
132static int iwlagn_update_beacon(struct iwl_priv *priv, 132static int iwlagn_update_beacon(struct iwl_priv *priv,
133 struct ieee80211_vif *vif) 133 struct ieee80211_vif *vif)
134{ 134{
135 lockdep_assert_held(&priv->mutex); 135 lockdep_assert_held(&priv->shrd->mutex);
136 136
137 dev_kfree_skb(priv->beacon_skb); 137 dev_kfree_skb(priv->beacon_skb);
138 priv->beacon_skb = ieee80211_beacon_get(priv->hw, vif); 138 priv->beacon_skb = ieee80211_beacon_get(priv->hw, vif);
@@ -316,7 +316,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)
316 316
317 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2); 317 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
318 318
319 lockdep_assert_held(&priv->mutex); 319 lockdep_assert_held(&priv->shrd->mutex);
320 320
321 ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS]; 321 ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS];
322 ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN]; 322 ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN];
@@ -421,7 +421,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
421 bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK); 421 bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
422 int ret; 422 int ret;
423 423
424 lockdep_assert_held(&priv->mutex); 424 lockdep_assert_held(&priv->shrd->mutex);
425 425
426 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) 426 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
427 return -EINVAL; 427 return -EINVAL;
@@ -537,7 +537,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
537 537
538 IWL_DEBUG_MAC80211(priv, "changed %#x", changed); 538 IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
539 539
540 mutex_lock(&priv->mutex); 540 mutex_lock(&priv->shrd->mutex);
541 541
542 if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) { 542 if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) {
543 IWL_DEBUG_MAC80211(priv, "leave - scanning\n"); 543 IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
@@ -652,7 +652,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
652 iwlagn_commit_rxon(priv, ctx); 652 iwlagn_commit_rxon(priv, ctx);
653 } 653 }
654 out: 654 out:
655 mutex_unlock(&priv->mutex); 655 mutex_unlock(&priv->shrd->mutex);
656 return ret; 656 return ret;
657} 657}
658 658
@@ -667,7 +667,7 @@ static void iwlagn_check_needed_chains(struct iwl_priv *priv,
667 struct ieee80211_sta_ht_cap *ht_cap; 667 struct ieee80211_sta_ht_cap *ht_cap;
668 bool need_multiple; 668 bool need_multiple;
669 669
670 lockdep_assert_held(&priv->mutex); 670 lockdep_assert_held(&priv->shrd->mutex);
671 671
672 switch (vif->type) { 672 switch (vif->type) {
673 case NL80211_IFTYPE_STATION: 673 case NL80211_IFTYPE_STATION:
@@ -792,17 +792,17 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
792 int ret; 792 int ret;
793 bool force = false; 793 bool force = false;
794 794
795 mutex_lock(&priv->mutex); 795 mutex_lock(&priv->shrd->mutex);
796 796
797 if (unlikely(!iwl_is_ready(priv))) { 797 if (unlikely(!iwl_is_ready(priv))) {
798 IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); 798 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
799 mutex_unlock(&priv->mutex); 799 mutex_unlock(&priv->shrd->mutex);
800 return; 800 return;
801 } 801 }
802 802
803 if (unlikely(!ctx->vif)) { 803 if (unlikely(!ctx->vif)) {
804 IWL_DEBUG_MAC80211(priv, "leave - vif is NULL\n"); 804 IWL_DEBUG_MAC80211(priv, "leave - vif is NULL\n");
805 mutex_unlock(&priv->mutex); 805 mutex_unlock(&priv->shrd->mutex);
806 return; 806 return;
807 } 807 }
808 808
@@ -913,7 +913,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
913 IWL_ERR(priv, "Error sending IBSS beacon\n"); 913 IWL_ERR(priv, "Error sending IBSS beacon\n");
914 } 914 }
915 915
916 mutex_unlock(&priv->mutex); 916 mutex_unlock(&priv->shrd->mutex);
917} 917}
918 918
919void iwlagn_post_scan(struct iwl_priv *priv) 919void iwlagn_post_scan(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index f894bfb43da4..c99e6cce0733 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -49,7 +49,7 @@ iwl_sta_alloc_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, u8 sta_id)
49 return NULL; 49 return NULL;
50 } 50 }
51 51
52 lockdep_assert_held(&priv->mutex); 52 lockdep_assert_held(&priv->shrd->mutex);
53 53
54 /* Set up the rate scaling to start at selected rate, fall back 54 /* Set up the rate scaling to start at selected rate, fall back
55 * all the way down to 1M in IEEE order, and then spin on 1M */ 55 * all the way down to 1M in IEEE order, and then spin on 1M */
@@ -197,7 +197,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv,
197int iwl_restore_default_wep_keys(struct iwl_priv *priv, 197int iwl_restore_default_wep_keys(struct iwl_priv *priv,
198 struct iwl_rxon_context *ctx) 198 struct iwl_rxon_context *ctx)
199{ 199{
200 lockdep_assert_held(&priv->mutex); 200 lockdep_assert_held(&priv->shrd->mutex);
201 201
202 return iwl_send_static_wepkey_cmd(priv, ctx, false); 202 return iwl_send_static_wepkey_cmd(priv, ctx, false);
203} 203}
@@ -208,7 +208,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
208{ 208{
209 int ret; 209 int ret;
210 210
211 lockdep_assert_held(&priv->mutex); 211 lockdep_assert_held(&priv->shrd->mutex);
212 212
213 IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", 213 IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n",
214 keyconf->keyidx); 214 keyconf->keyidx);
@@ -232,7 +232,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
232{ 232{
233 int ret; 233 int ret;
234 234
235 lockdep_assert_held(&priv->mutex); 235 lockdep_assert_held(&priv->shrd->mutex);
236 236
237 if (keyconf->keylen != WEP_KEY_LEN_128 && 237 if (keyconf->keylen != WEP_KEY_LEN_128 &&
238 keyconf->keylen != WEP_KEY_LEN_64) { 238 keyconf->keylen != WEP_KEY_LEN_64) {
@@ -397,7 +397,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
397 if (sta_id == IWL_INVALID_STATION) 397 if (sta_id == IWL_INVALID_STATION)
398 return 0; 398 return 0;
399 399
400 lockdep_assert_held(&priv->mutex); 400 lockdep_assert_held(&priv->shrd->mutex);
401 401
402 ctx->key_mapping_keys--; 402 ctx->key_mapping_keys--;
403 403
@@ -430,7 +430,7 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,
430 if (sta_id == IWL_INVALID_STATION) 430 if (sta_id == IWL_INVALID_STATION)
431 return -EINVAL; 431 return -EINVAL;
432 432
433 lockdep_assert_held(&priv->mutex); 433 lockdep_assert_held(&priv->shrd->mutex);
434 434
435 keyconf->hw_key_idx = iwl_get_free_ucode_key_offset(priv); 435 keyconf->hw_key_idx = iwl_get_free_ucode_key_offset(priv);
436 if (keyconf->hw_key_idx == WEP_INVALID_OFFSET) 436 if (keyconf->hw_key_idx == WEP_INVALID_OFFSET)
@@ -572,7 +572,7 @@ int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid)
572 unsigned long flags; 572 unsigned long flags;
573 struct iwl_addsta_cmd sta_cmd; 573 struct iwl_addsta_cmd sta_cmd;
574 574
575 lockdep_assert_held(&priv->mutex); 575 lockdep_assert_held(&priv->shrd->mutex);
576 576
577 /* Remove "disable" flag, to enable Tx for this TID */ 577 /* Remove "disable" flag, to enable Tx for this TID */
578 spin_lock_irqsave(&priv->sta_lock, flags); 578 spin_lock_irqsave(&priv->sta_lock, flags);
@@ -592,7 +592,7 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
592 int sta_id; 592 int sta_id;
593 struct iwl_addsta_cmd sta_cmd; 593 struct iwl_addsta_cmd sta_cmd;
594 594
595 lockdep_assert_held(&priv->mutex); 595 lockdep_assert_held(&priv->shrd->mutex);
596 596
597 sta_id = iwl_sta_id(sta); 597 sta_id = iwl_sta_id(sta);
598 if (sta_id == IWL_INVALID_STATION) 598 if (sta_id == IWL_INVALID_STATION)
@@ -617,7 +617,7 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
617 int sta_id; 617 int sta_id;
618 struct iwl_addsta_cmd sta_cmd; 618 struct iwl_addsta_cmd sta_cmd;
619 619
620 lockdep_assert_held(&priv->mutex); 620 lockdep_assert_held(&priv->shrd->mutex);
621 621
622 sta_id = iwl_sta_id(sta); 622 sta_id = iwl_sta_id(sta);
623 if (sta_id == IWL_INVALID_STATION) { 623 if (sta_id == IWL_INVALID_STATION) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
index 44fff5bf9dcd..03d8389d8ef8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
@@ -313,7 +313,7 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
313 tt->tt_power_mode = IWL_POWER_INDEX_5; 313 tt->tt_power_mode = IWL_POWER_INDEX_5;
314 break; 314 break;
315 } 315 }
316 mutex_lock(&priv->mutex); 316 mutex_lock(&priv->shrd->mutex);
317 if (old_state == IWL_TI_CT_KILL) 317 if (old_state == IWL_TI_CT_KILL)
318 clear_bit(STATUS_CT_KILL, &priv->shrd->status); 318 clear_bit(STATUS_CT_KILL, &priv->shrd->status);
319 if (tt->state != IWL_TI_CT_KILL && 319 if (tt->state != IWL_TI_CT_KILL &&
@@ -344,7 +344,7 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
344 IWL_DEBUG_TEMP(priv, "Power Index change to %u\n", 344 IWL_DEBUG_TEMP(priv, "Power Index change to %u\n",
345 tt->tt_power_mode); 345 tt->tt_power_mode);
346 } 346 }
347 mutex_unlock(&priv->mutex); 347 mutex_unlock(&priv->shrd->mutex);
348 } 348 }
349} 349}
350 350
@@ -454,7 +454,7 @@ static void iwl_advance_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
454 * in case get disabled before */ 454 * in case get disabled before */
455 iwl_set_rxon_ht(priv, &priv->current_ht_config); 455 iwl_set_rxon_ht(priv, &priv->current_ht_config);
456 } 456 }
457 mutex_lock(&priv->mutex); 457 mutex_lock(&priv->shrd->mutex);
458 if (old_state == IWL_TI_CT_KILL) 458 if (old_state == IWL_TI_CT_KILL)
459 clear_bit(STATUS_CT_KILL, &priv->shrd->status); 459 clear_bit(STATUS_CT_KILL, &priv->shrd->status);
460 if (tt->state != IWL_TI_CT_KILL && 460 if (tt->state != IWL_TI_CT_KILL &&
@@ -489,7 +489,7 @@ static void iwl_advance_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
489 iwl_perform_ct_kill_task(priv, false); 489 iwl_perform_ct_kill_task(priv, false);
490 } 490 }
491 } 491 }
492 mutex_unlock(&priv->mutex); 492 mutex_unlock(&priv->shrd->mutex);
493 } 493 }
494} 494}
495 495
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index 0fc123799d4e..3717a88cf45e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -545,7 +545,7 @@ int iwlagn_run_init_ucode(struct iwl_priv *priv)
545 struct iwl_notification_wait calib_wait; 545 struct iwl_notification_wait calib_wait;
546 int ret; 546 int ret;
547 547
548 lockdep_assert_held(&priv->mutex); 548 lockdep_assert_held(&priv->shrd->mutex);
549 549
550 /* No init ucode required? Curious, but maybe ok */ 550 /* No init ucode required? Curious, but maybe ok */
551 if (!priv->ucode_init.code.len) 551 if (!priv->ucode_init.code.len)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6d2c13e7f51b..ef60120d9bb9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -135,7 +135,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
135 * beacon contents. 135 * beacon contents.
136 */ 136 */
137 137
138 lockdep_assert_held(&priv->mutex); 138 lockdep_assert_held(&priv->shrd->mutex);
139 139
140 if (!priv->beacon_ctx) { 140 if (!priv->beacon_ctx) {
141 IWL_ERR(priv, "trying to build beacon w/o beacon context!\n"); 141 IWL_ERR(priv, "trying to build beacon w/o beacon context!\n");
@@ -209,7 +209,7 @@ static void iwl_bg_beacon_update(struct work_struct *work)
209 container_of(work, struct iwl_priv, beacon_update); 209 container_of(work, struct iwl_priv, beacon_update);
210 struct sk_buff *beacon; 210 struct sk_buff *beacon;
211 211
212 mutex_lock(&priv->mutex); 212 mutex_lock(&priv->shrd->mutex);
213 if (!priv->beacon_ctx) { 213 if (!priv->beacon_ctx) {
214 IWL_ERR(priv, "updating beacon w/o beacon context!\n"); 214 IWL_ERR(priv, "updating beacon w/o beacon context!\n");
215 goto out; 215 goto out;
@@ -239,7 +239,7 @@ static void iwl_bg_beacon_update(struct work_struct *work)
239 239
240 iwlagn_send_beacon_cmd(priv); 240 iwlagn_send_beacon_cmd(priv);
241 out: 241 out:
242 mutex_unlock(&priv->mutex); 242 mutex_unlock(&priv->shrd->mutex);
243} 243}
244 244
245static void iwl_bg_bt_runtime_config(struct work_struct *work) 245static void iwl_bg_bt_runtime_config(struct work_struct *work)
@@ -262,7 +262,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)
262 container_of(work, struct iwl_priv, bt_full_concurrency); 262 container_of(work, struct iwl_priv, bt_full_concurrency);
263 struct iwl_rxon_context *ctx; 263 struct iwl_rxon_context *ctx;
264 264
265 mutex_lock(&priv->mutex); 265 mutex_lock(&priv->shrd->mutex);
266 266
267 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) 267 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
268 goto out; 268 goto out;
@@ -286,7 +286,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)
286 286
287 iwlagn_send_advance_bt_config(priv); 287 iwlagn_send_advance_bt_config(priv);
288out: 288out:
289 mutex_unlock(&priv->mutex); 289 mutex_unlock(&priv->shrd->mutex);
290} 290}
291 291
292/** 292/**
@@ -1920,9 +1920,9 @@ static void __iwl_down(struct iwl_priv *priv)
1920 1920
1921static void iwl_down(struct iwl_priv *priv) 1921static void iwl_down(struct iwl_priv *priv)
1922{ 1922{
1923 mutex_lock(&priv->mutex); 1923 mutex_lock(&priv->shrd->mutex);
1924 __iwl_down(priv); 1924 __iwl_down(priv);
1925 mutex_unlock(&priv->mutex); 1925 mutex_unlock(&priv->shrd->mutex);
1926 1926
1927 iwl_cancel_deferred_work(priv); 1927 iwl_cancel_deferred_work(priv);
1928} 1928}
@@ -1934,7 +1934,7 @@ static int __iwl_up(struct iwl_priv *priv)
1934 struct iwl_rxon_context *ctx; 1934 struct iwl_rxon_context *ctx;
1935 int ret; 1935 int ret;
1936 1936
1937 lockdep_assert_held(&priv->mutex); 1937 lockdep_assert_held(&priv->shrd->mutex);
1938 1938
1939 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) { 1939 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) {
1940 IWL_WARN(priv, "Exit pending; will not bring the NIC up\n"); 1940 IWL_WARN(priv, "Exit pending; will not bring the NIC up\n");
@@ -1989,11 +1989,11 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
1989 struct iwl_priv *priv = container_of(work, struct iwl_priv, 1989 struct iwl_priv *priv = container_of(work, struct iwl_priv,
1990 run_time_calib_work); 1990 run_time_calib_work);
1991 1991
1992 mutex_lock(&priv->mutex); 1992 mutex_lock(&priv->shrd->mutex);
1993 1993
1994 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) || 1994 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) ||
1995 test_bit(STATUS_SCANNING, &priv->shrd->status)) { 1995 test_bit(STATUS_SCANNING, &priv->shrd->status)) {
1996 mutex_unlock(&priv->mutex); 1996 mutex_unlock(&priv->shrd->mutex);
1997 return; 1997 return;
1998 } 1998 }
1999 1999
@@ -2002,7 +2002,7 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
2002 iwl_sensitivity_calibration(priv); 2002 iwl_sensitivity_calibration(priv);
2003 } 2003 }
2004 2004
2005 mutex_unlock(&priv->mutex); 2005 mutex_unlock(&priv->shrd->mutex);
2006} 2006}
2007 2007
2008static void iwlagn_prepare_restart(struct iwl_priv *priv) 2008static void iwlagn_prepare_restart(struct iwl_priv *priv)
@@ -2014,7 +2014,7 @@ static void iwlagn_prepare_restart(struct iwl_priv *priv)
2014 u8 bt_status; 2014 u8 bt_status;
2015 bool bt_is_sco; 2015 bool bt_is_sco;
2016 2016
2017 lockdep_assert_held(&priv->mutex); 2017 lockdep_assert_held(&priv->shrd->mutex);
2018 2018
2019 for_each_context(priv, ctx) 2019 for_each_context(priv, ctx)
2020 ctx->vif = NULL; 2020 ctx->vif = NULL;
@@ -2052,9 +2052,9 @@ static void iwl_bg_restart(struct work_struct *data)
2052 return; 2052 return;
2053 2053
2054 if (test_and_clear_bit(STATUS_FW_ERROR, &priv->shrd->status)) { 2054 if (test_and_clear_bit(STATUS_FW_ERROR, &priv->shrd->status)) {
2055 mutex_lock(&priv->mutex); 2055 mutex_lock(&priv->shrd->mutex);
2056 iwlagn_prepare_restart(priv); 2056 iwlagn_prepare_restart(priv);
2057 mutex_unlock(&priv->mutex); 2057 mutex_unlock(&priv->shrd->mutex);
2058 iwl_cancel_deferred_work(priv); 2058 iwl_cancel_deferred_work(priv);
2059 ieee80211_restart_hw(priv->hw); 2059 ieee80211_restart_hw(priv->hw);
2060 } else { 2060 } else {
@@ -2256,9 +2256,9 @@ static int iwlagn_mac_start(struct ieee80211_hw *hw)
2256 IWL_DEBUG_MAC80211(priv, "enter\n"); 2256 IWL_DEBUG_MAC80211(priv, "enter\n");
2257 2257
2258 /* we should be verifying the device is ready to be opened */ 2258 /* we should be verifying the device is ready to be opened */
2259 mutex_lock(&priv->mutex); 2259 mutex_lock(&priv->shrd->mutex);
2260 ret = __iwl_up(priv); 2260 ret = __iwl_up(priv);
2261 mutex_unlock(&priv->mutex); 2261 mutex_unlock(&priv->shrd->mutex);
2262 if (ret) 2262 if (ret)
2263 return ret; 2263 return ret;
2264 2264
@@ -2351,7 +2351,7 @@ static void iwlagn_mac_set_rekey_data(struct ieee80211_hw *hw,
2351 if (iwlagn_mod_params.sw_crypto) 2351 if (iwlagn_mod_params.sw_crypto)
2352 return; 2352 return;
2353 2353
2354 mutex_lock(&priv->mutex); 2354 mutex_lock(&priv->shrd->mutex);
2355 2355
2356 if (priv->contexts[IWL_RXON_CTX_BSS].vif != vif) 2356 if (priv->contexts[IWL_RXON_CTX_BSS].vif != vif)
2357 goto out; 2357 goto out;
@@ -2362,7 +2362,7 @@ static void iwlagn_mac_set_rekey_data(struct ieee80211_hw *hw,
2362 priv->have_rekey_data = true; 2362 priv->have_rekey_data = true;
2363 2363
2364 out: 2364 out:
2365 mutex_unlock(&priv->mutex); 2365 mutex_unlock(&priv->shrd->mutex);
2366} 2366}
2367 2367
2368struct wowlan_key_data { 2368struct wowlan_key_data {
@@ -2400,7 +2400,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,
2400 u16 p1k[IWLAGN_P1K_SIZE]; 2400 u16 p1k[IWLAGN_P1K_SIZE];
2401 int ret, i; 2401 int ret, i;
2402 2402
2403 mutex_lock(&priv->mutex); 2403 mutex_lock(&priv->shrd->mutex);
2404 2404
2405 if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 || 2405 if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
2406 key->cipher == WLAN_CIPHER_SUITE_WEP104) && 2406 key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
@@ -2505,7 +2505,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,
2505 break; 2505 break;
2506 } 2506 }
2507 2507
2508 mutex_unlock(&priv->mutex); 2508 mutex_unlock(&priv->shrd->mutex);
2509} 2509}
2510 2510
2511static int iwlagn_mac_suspend(struct ieee80211_hw *hw, 2511static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
@@ -2530,7 +2530,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2530 if (WARN_ON(!wowlan)) 2530 if (WARN_ON(!wowlan))
2531 return -EINVAL; 2531 return -EINVAL;
2532 2532
2533 mutex_lock(&priv->mutex); 2533 mutex_lock(&priv->shrd->mutex);
2534 2534
2535 /* Don't attempt WoWLAN when not associated, tear down instead. */ 2535 /* Don't attempt WoWLAN when not associated, tear down instead. */
2536 if (!ctx->vif || ctx->vif->type != NL80211_IFTYPE_STATION || 2536 if (!ctx->vif || ctx->vif->type != NL80211_IFTYPE_STATION ||
@@ -2624,11 +2624,11 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2624 * constraints. Since we're in the suspend path 2624 * constraints. Since we're in the suspend path
2625 * that isn't really a problem though. 2625 * that isn't really a problem though.
2626 */ 2626 */
2627 mutex_unlock(&priv->mutex); 2627 mutex_unlock(&priv->shrd->mutex);
2628 ieee80211_iter_keys(priv->hw, ctx->vif, 2628 ieee80211_iter_keys(priv->hw, ctx->vif,
2629 iwlagn_wowlan_program_keys, 2629 iwlagn_wowlan_program_keys,
2630 &key_data); 2630 &key_data);
2631 mutex_lock(&priv->mutex); 2631 mutex_lock(&priv->shrd->mutex);
2632 if (key_data.error) { 2632 if (key_data.error) {
2633 ret = -EIO; 2633 ret = -EIO;
2634 goto error; 2634 goto error;
@@ -2697,7 +2697,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2697 iwlagn_prepare_restart(priv); 2697 iwlagn_prepare_restart(priv);
2698 ieee80211_restart_hw(priv->hw); 2698 ieee80211_restart_hw(priv->hw);
2699 out: 2699 out:
2700 mutex_unlock(&priv->mutex); 2700 mutex_unlock(&priv->shrd->mutex);
2701 kfree(key_data.rsc_tsc); 2701 kfree(key_data.rsc_tsc);
2702 return ret; 2702 return ret;
2703} 2703}
@@ -2711,7 +2711,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
2711 u32 base, status = 0xffffffff; 2711 u32 base, status = 0xffffffff;
2712 int ret = -EIO; 2712 int ret = -EIO;
2713 2713
2714 mutex_lock(&priv->mutex); 2714 mutex_lock(&priv->shrd->mutex);
2715 2715
2716 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, 2716 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
2717 CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE); 2717 CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE);
@@ -2755,7 +2755,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
2755 iwl_connection_init_rx_config(priv, ctx); 2755 iwl_connection_init_rx_config(priv, ctx);
2756 iwlagn_set_rxon_chain(priv, ctx); 2756 iwlagn_set_rxon_chain(priv, ctx);
2757 2757
2758 mutex_unlock(&priv->mutex); 2758 mutex_unlock(&priv->shrd->mutex);
2759 2759
2760 ieee80211_resume_disconnect(vif); 2760 ieee80211_resume_disconnect(vif);
2761 2761
@@ -2824,7 +2824,7 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2824 if (cmd == DISABLE_KEY && key->hw_key_idx == WEP_INVALID_OFFSET) 2824 if (cmd == DISABLE_KEY && key->hw_key_idx == WEP_INVALID_OFFSET)
2825 return 0; 2825 return 0;
2826 2826
2827 mutex_lock(&priv->mutex); 2827 mutex_lock(&priv->shrd->mutex);
2828 iwl_scan_cancel_timeout(priv, 100); 2828 iwl_scan_cancel_timeout(priv, 100);
2829 2829
2830 BUILD_BUG_ON(WEP_INVALID_OFFSET == IWLAGN_HW_KEY_DEFAULT); 2830 BUILD_BUG_ON(WEP_INVALID_OFFSET == IWLAGN_HW_KEY_DEFAULT);
@@ -2875,7 +2875,7 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2875 ret = -EINVAL; 2875 ret = -EINVAL;
2876 } 2876 }
2877 2877
2878 mutex_unlock(&priv->mutex); 2878 mutex_unlock(&priv->shrd->mutex);
2879 IWL_DEBUG_MAC80211(priv, "leave\n"); 2879 IWL_DEBUG_MAC80211(priv, "leave\n");
2880 2880
2881 return ret; 2881 return ret;
@@ -2897,7 +2897,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
2897 if (!(priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE)) 2897 if (!(priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE))
2898 return -EACCES; 2898 return -EACCES;
2899 2899
2900 mutex_lock(&priv->mutex); 2900 mutex_lock(&priv->shrd->mutex);
2901 2901
2902 switch (action) { 2902 switch (action) {
2903 case IEEE80211_AMPDU_RX_START: 2903 case IEEE80211_AMPDU_RX_START:
@@ -2988,7 +2988,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
2988 ret = 0; 2988 ret = 0;
2989 break; 2989 break;
2990 } 2990 }
2991 mutex_unlock(&priv->mutex); 2991 mutex_unlock(&priv->shrd->mutex);
2992 2992
2993 return ret; 2993 return ret;
2994} 2994}
@@ -3006,7 +3006,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3006 3006
3007 IWL_DEBUG_INFO(priv, "received request to add station %pM\n", 3007 IWL_DEBUG_INFO(priv, "received request to add station %pM\n",
3008 sta->addr); 3008 sta->addr);
3009 mutex_lock(&priv->mutex); 3009 mutex_lock(&priv->shrd->mutex);
3010 IWL_DEBUG_INFO(priv, "proceeding to add station %pM\n", 3010 IWL_DEBUG_INFO(priv, "proceeding to add station %pM\n",
3011 sta->addr); 3011 sta->addr);
3012 sta_priv->common.sta_id = IWL_INVALID_STATION; 3012 sta_priv->common.sta_id = IWL_INVALID_STATION;
@@ -3021,7 +3021,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3021 IWL_ERR(priv, "Unable to add station %pM (%d)\n", 3021 IWL_ERR(priv, "Unable to add station %pM (%d)\n",
3022 sta->addr, ret); 3022 sta->addr, ret);
3023 /* Should we return success if return code is EEXIST ? */ 3023 /* Should we return success if return code is EEXIST ? */
3024 mutex_unlock(&priv->mutex); 3024 mutex_unlock(&priv->shrd->mutex);
3025 return ret; 3025 return ret;
3026 } 3026 }
3027 3027
@@ -3031,7 +3031,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3031 IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", 3031 IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n",
3032 sta->addr); 3032 sta->addr);
3033 iwl_rs_rate_init(priv, sta, sta_id); 3033 iwl_rs_rate_init(priv, sta, sta_id);
3034 mutex_unlock(&priv->mutex); 3034 mutex_unlock(&priv->shrd->mutex);
3035 3035
3036 return 0; 3036 return 0;
3037} 3037}
@@ -3057,7 +3057,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
3057 3057
3058 IWL_DEBUG_MAC80211(priv, "enter\n"); 3058 IWL_DEBUG_MAC80211(priv, "enter\n");
3059 3059
3060 mutex_lock(&priv->mutex); 3060 mutex_lock(&priv->shrd->mutex);
3061 3061
3062 if (iwl_is_rfkill(priv)) 3062 if (iwl_is_rfkill(priv))
3063 goto out; 3063 goto out;
@@ -3129,7 +3129,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
3129 } 3129 }
3130 3130
3131out: 3131out:
3132 mutex_unlock(&priv->mutex); 3132 mutex_unlock(&priv->shrd->mutex);
3133 IWL_DEBUG_MAC80211(priv, "leave\n"); 3133 IWL_DEBUG_MAC80211(priv, "leave\n");
3134} 3134}
3135 3135
@@ -3159,7 +3159,7 @@ static void iwlagn_configure_filter(struct ieee80211_hw *hw,
3159 3159
3160#undef CHK 3160#undef CHK
3161 3161
3162 mutex_lock(&priv->mutex); 3162 mutex_lock(&priv->shrd->mutex);
3163 3163
3164 for_each_context(priv, ctx) { 3164 for_each_context(priv, ctx) {
3165 ctx->staging.filter_flags &= ~filter_nand; 3165 ctx->staging.filter_flags &= ~filter_nand;
@@ -3171,7 +3171,7 @@ static void iwlagn_configure_filter(struct ieee80211_hw *hw,
3171 */ 3171 */
3172 } 3172 }
3173 3173
3174 mutex_unlock(&priv->mutex); 3174 mutex_unlock(&priv->shrd->mutex);
3175 3175
3176 /* 3176 /*
3177 * Receiving all multicast frames is always enabled by the 3177 * Receiving all multicast frames is always enabled by the
@@ -3187,7 +3187,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
3187{ 3187{
3188 struct iwl_priv *priv = hw->priv; 3188 struct iwl_priv *priv = hw->priv;
3189 3189
3190 mutex_lock(&priv->mutex); 3190 mutex_lock(&priv->shrd->mutex);
3191 IWL_DEBUG_MAC80211(priv, "enter\n"); 3191 IWL_DEBUG_MAC80211(priv, "enter\n");
3192 3192
3193 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) { 3193 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) {
@@ -3213,7 +3213,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
3213 IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n"); 3213 IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n");
3214 iwlagn_wait_tx_queue_empty(priv); 3214 iwlagn_wait_tx_queue_empty(priv);
3215done: 3215done:
3216 mutex_unlock(&priv->mutex); 3216 mutex_unlock(&priv->shrd->mutex);
3217 IWL_DEBUG_MAC80211(priv, "leave\n"); 3217 IWL_DEBUG_MAC80211(priv, "leave\n");
3218} 3218}
3219 3219
@@ -3221,7 +3221,7 @@ void iwlagn_disable_roc(struct iwl_priv *priv)
3221{ 3221{
3222 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_PAN]; 3222 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_PAN];
3223 3223
3224 lockdep_assert_held(&priv->mutex); 3224 lockdep_assert_held(&priv->shrd->mutex);
3225 3225
3226 if (!priv->hw_roc_setup) 3226 if (!priv->hw_roc_setup)
3227 return; 3227 return;
@@ -3244,9 +3244,9 @@ static void iwlagn_disable_roc_work(struct work_struct *work)
3244 struct iwl_priv *priv = container_of(work, struct iwl_priv, 3244 struct iwl_priv *priv = container_of(work, struct iwl_priv,
3245 hw_roc_disable_work.work); 3245 hw_roc_disable_work.work);
3246 3246
3247 mutex_lock(&priv->mutex); 3247 mutex_lock(&priv->shrd->mutex);
3248 iwlagn_disable_roc(priv); 3248 iwlagn_disable_roc(priv);
3249 mutex_unlock(&priv->mutex); 3249 mutex_unlock(&priv->shrd->mutex);
3250} 3250}
3251 3251
3252static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw, 3252static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw,
@@ -3264,7 +3264,7 @@ static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw,
3264 if (!(ctx->interface_modes & BIT(NL80211_IFTYPE_P2P_CLIENT))) 3264 if (!(ctx->interface_modes & BIT(NL80211_IFTYPE_P2P_CLIENT)))
3265 return -EOPNOTSUPP; 3265 return -EOPNOTSUPP;
3266 3266
3267 mutex_lock(&priv->mutex); 3267 mutex_lock(&priv->shrd->mutex);
3268 3268
3269 /* 3269 /*
3270 * TODO: Remove this hack! Firmware needs to be updated 3270 * TODO: Remove this hack! Firmware needs to be updated
@@ -3314,7 +3314,7 @@ static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw,
3314 iwlagn_disable_roc(priv); 3314 iwlagn_disable_roc(priv);
3315 3315
3316 out: 3316 out:
3317 mutex_unlock(&priv->mutex); 3317 mutex_unlock(&priv->shrd->mutex);
3318 3318
3319 return err; 3319 return err;
3320} 3320}
@@ -3326,10 +3326,10 @@ static int iwl_mac_cancel_remain_on_channel(struct ieee80211_hw *hw)
3326 if (!(priv->valid_contexts & BIT(IWL_RXON_CTX_PAN))) 3326 if (!(priv->valid_contexts & BIT(IWL_RXON_CTX_PAN)))
3327 return -EOPNOTSUPP; 3327 return -EOPNOTSUPP;
3328 3328
3329 mutex_lock(&priv->mutex); 3329 mutex_lock(&priv->shrd->mutex);
3330 iwl_scan_cancel_timeout(priv, priv->hw_roc_duration); 3330 iwl_scan_cancel_timeout(priv, priv->hw_roc_duration);
3331 iwlagn_disable_roc(priv); 3331 iwlagn_disable_roc(priv);
3332 mutex_unlock(&priv->mutex); 3332 mutex_unlock(&priv->shrd->mutex);
3333 3333
3334 return 0; 3334 return 0;
3335} 3335}
@@ -3419,7 +3419,7 @@ static int iwl_init_drv(struct iwl_priv *priv)
3419 spin_lock_init(&priv->sta_lock); 3419 spin_lock_init(&priv->sta_lock);
3420 spin_lock_init(&priv->hcmd_lock); 3420 spin_lock_init(&priv->hcmd_lock);
3421 3421
3422 mutex_init(&priv->mutex); 3422 mutex_init(&priv->shrd->mutex);
3423 3423
3424 priv->ieee_channels = NULL; 3424 priv->ieee_channels = NULL;
3425 priv->ieee_rates = NULL; 3425 priv->ieee_rates = NULL;
@@ -3492,7 +3492,7 @@ static void iwl_mac_rssi_callback(struct ieee80211_hw *hw,
3492{ 3492{
3493 struct iwl_priv *priv = hw->priv; 3493 struct iwl_priv *priv = hw->priv;
3494 3494
3495 mutex_lock(&priv->mutex); 3495 mutex_lock(&priv->shrd->mutex);
3496 3496
3497 if (priv->cfg->bt_params && 3497 if (priv->cfg->bt_params &&
3498 priv->cfg->bt_params->advanced_bt_coexist) { 3498 priv->cfg->bt_params->advanced_bt_coexist) {
@@ -3507,7 +3507,7 @@ static void iwl_mac_rssi_callback(struct ieee80211_hw *hw,
3507 "ignoring RSSI callback\n"); 3507 "ignoring RSSI callback\n");
3508 } 3508 }
3509 3509
3510 mutex_unlock(&priv->mutex); 3510 mutex_unlock(&priv->shrd->mutex);
3511} 3511}
3512 3512
3513struct ieee80211_ops iwlagn_hw_ops = { 3513struct ieee80211_ops iwlagn_hw_ops = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 40ad889264a9..bf173b6cd30b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -325,7 +325,7 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
325 325
326 conf = ieee80211_get_hw_conf(priv->hw); 326 conf = ieee80211_get_hw_conf(priv->hw);
327 327
328 lockdep_assert_held(&priv->mutex); 328 lockdep_assert_held(&priv->shrd->mutex);
329 329
330 memset(&ctx->timing, 0, sizeof(struct iwl_rxon_time_cmd)); 330 memset(&ctx->timing, 0, sizeof(struct iwl_rxon_time_cmd));
331 331
@@ -1069,7 +1069,7 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1069 bool defer; 1069 bool defer;
1070 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 1070 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
1071 1071
1072 lockdep_assert_held(&priv->mutex); 1072 lockdep_assert_held(&priv->shrd->mutex);
1073 1073
1074 if (priv->tx_power_user_lmt == tx_power && !force) 1074 if (priv->tx_power_user_lmt == tx_power && !force)
1075 return 0; 1075 return 0;
@@ -1232,7 +1232,7 @@ static int iwl_setup_interface(struct iwl_priv *priv,
1232 struct ieee80211_vif *vif = ctx->vif; 1232 struct ieee80211_vif *vif = ctx->vif;
1233 int err; 1233 int err;
1234 1234
1235 lockdep_assert_held(&priv->mutex); 1235 lockdep_assert_held(&priv->shrd->mutex);
1236 1236
1237 /* 1237 /*
1238 * This variable will be correct only when there's just 1238 * This variable will be correct only when there's just
@@ -1276,7 +1276,7 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
1276 1276
1277 cancel_delayed_work_sync(&priv->hw_roc_disable_work); 1277 cancel_delayed_work_sync(&priv->hw_roc_disable_work);
1278 1278
1279 mutex_lock(&priv->mutex); 1279 mutex_lock(&priv->shrd->mutex);
1280 1280
1281 iwlagn_disable_roc(priv); 1281 iwlagn_disable_roc(priv);
1282 1282
@@ -1323,7 +1323,7 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
1323 ctx->vif = NULL; 1323 ctx->vif = NULL;
1324 priv->iw_mode = NL80211_IFTYPE_STATION; 1324 priv->iw_mode = NL80211_IFTYPE_STATION;
1325 out: 1325 out:
1326 mutex_unlock(&priv->mutex); 1326 mutex_unlock(&priv->shrd->mutex);
1327 1327
1328 IWL_DEBUG_MAC80211(priv, "leave\n"); 1328 IWL_DEBUG_MAC80211(priv, "leave\n");
1329 return err; 1329 return err;
@@ -1335,7 +1335,7 @@ static void iwl_teardown_interface(struct iwl_priv *priv,
1335{ 1335{
1336 struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); 1336 struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
1337 1337
1338 lockdep_assert_held(&priv->mutex); 1338 lockdep_assert_held(&priv->shrd->mutex);
1339 1339
1340 if (priv->scan_vif == vif) { 1340 if (priv->scan_vif == vif) {
1341 iwl_scan_cancel_timeout(priv, 200); 1341 iwl_scan_cancel_timeout(priv, 200);
@@ -1367,14 +1367,14 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
1367 1367
1368 IWL_DEBUG_MAC80211(priv, "enter\n"); 1368 IWL_DEBUG_MAC80211(priv, "enter\n");
1369 1369
1370 mutex_lock(&priv->mutex); 1370 mutex_lock(&priv->shrd->mutex);
1371 1371
1372 WARN_ON(ctx->vif != vif); 1372 WARN_ON(ctx->vif != vif);
1373 ctx->vif = NULL; 1373 ctx->vif = NULL;
1374 1374
1375 iwl_teardown_interface(priv, vif, false); 1375 iwl_teardown_interface(priv, vif, false);
1376 1376
1377 mutex_unlock(&priv->mutex); 1377 mutex_unlock(&priv->shrd->mutex);
1378 1378
1379 IWL_DEBUG_MAC80211(priv, "leave\n"); 1379 IWL_DEBUG_MAC80211(priv, "leave\n");
1380 1380
@@ -1698,7 +1698,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1698 1698
1699 newtype = ieee80211_iftype_p2p(newtype, newp2p); 1699 newtype = ieee80211_iftype_p2p(newtype, newp2p);
1700 1700
1701 mutex_lock(&priv->mutex); 1701 mutex_lock(&priv->shrd->mutex);
1702 1702
1703 if (!ctx->vif || !iwl_is_ready_rf(priv)) { 1703 if (!ctx->vif || !iwl_is_ready_rf(priv)) {
1704 /* 1704 /*
@@ -1762,7 +1762,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1762 err = 0; 1762 err = 0;
1763 1763
1764 out: 1764 out:
1765 mutex_unlock(&priv->mutex); 1765 mutex_unlock(&priv->shrd->mutex);
1766 return err; 1766 return err;
1767} 1767}
1768 1768
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 8bd817759264..0aa84560dc2d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -819,9 +819,9 @@ static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file,
819 819
820 priv->power_data.debug_sleep_level_override = value; 820 priv->power_data.debug_sleep_level_override = value;
821 821
822 mutex_lock(&priv->mutex); 822 mutex_lock(&priv->shrd->mutex);
823 iwl_power_update_mode(priv, true); 823 iwl_power_update_mode(priv, true);
824 mutex_unlock(&priv->mutex); 824 mutex_unlock(&priv->shrd->mutex);
825 825
826 return count; 826 return count;
827} 827}
@@ -1838,9 +1838,9 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
1838 return -EINVAL; 1838 return -EINVAL;
1839 1839
1840 /* make request to uCode to retrieve statistics information */ 1840 /* make request to uCode to retrieve statistics information */
1841 mutex_lock(&priv->mutex); 1841 mutex_lock(&priv->shrd->mutex);
1842 ret = iwl_send_statistics_request(priv, CMD_SYNC, false); 1842 ret = iwl_send_statistics_request(priv, CMD_SYNC, false);
1843 mutex_unlock(&priv->mutex); 1843 mutex_unlock(&priv->shrd->mutex);
1844 1844
1845 if (ret) { 1845 if (ret) {
1846 IWL_ERR(priv, 1846 IWL_ERR(priv,
@@ -2231,9 +2231,9 @@ static ssize_t iwl_dbgfs_clear_ucode_statistics_write(struct file *file,
2231 return -EFAULT; 2231 return -EFAULT;
2232 2232
2233 /* make request to uCode to retrieve statistics information */ 2233 /* make request to uCode to retrieve statistics information */
2234 mutex_lock(&priv->mutex); 2234 mutex_lock(&priv->shrd->mutex);
2235 iwl_send_statistics_request(priv, CMD_SYNC, true); 2235 iwl_send_statistics_request(priv, CMD_SYNC, true);
2236 mutex_unlock(&priv->mutex); 2236 mutex_unlock(&priv->shrd->mutex);
2237 2237
2238 return count; 2238 return count;
2239} 2239}
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index c60a24232d6b..8ba2d94419e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1228,8 +1228,8 @@ struct iwl_priv {
1228 /* spinlock */ 1228 /* spinlock */
1229 spinlock_t hcmd_lock; /* protect hcmd */ 1229 spinlock_t hcmd_lock; /* protect hcmd */
1230 spinlock_t reg_lock; /* protect hw register access */ 1230 spinlock_t reg_lock; /* protect hw register access */
1231 struct mutex mutex;
1232 1231
1232 /*TODO: remove these pointers - use bus(priv) instead */
1233 struct iwl_bus *bus; /* bus specific data */ 1233 struct iwl_bus *bus; /* bus specific data */
1234 struct iwl_trans trans; 1234 struct iwl_trans trans;
1235 1235
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 52a6f8aa5276..343317f6ce01 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -383,7 +383,7 @@ int iwl_power_set_mode(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd,
383 int ret; 383 int ret;
384 bool update_chains; 384 bool update_chains;
385 385
386 lockdep_assert_held(&priv->mutex); 386 lockdep_assert_held(&priv->shrd->mutex);
387 387
388 /* Don't update the RX chain when chain noise calibration is running */ 388 /* Don't update the RX chain when chain noise calibration is running */
389 update_chains = priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE || 389 update_chains = priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index bc8cb1d3b555..fa100c5cefa3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -116,7 +116,7 @@ static void iwl_complete_scan(struct iwl_priv *priv, bool aborted)
116 116
117void iwl_force_scan_end(struct iwl_priv *priv) 117void iwl_force_scan_end(struct iwl_priv *priv)
118{ 118{
119 lockdep_assert_held(&priv->mutex); 119 lockdep_assert_held(&priv->shrd->mutex);
120 120
121 if (!test_bit(STATUS_SCANNING, &priv->shrd->status)) { 121 if (!test_bit(STATUS_SCANNING, &priv->shrd->status)) {
122 IWL_DEBUG_SCAN(priv, "Forcing scan end while not scanning\n"); 122 IWL_DEBUG_SCAN(priv, "Forcing scan end while not scanning\n");
@@ -134,7 +134,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv)
134{ 134{
135 int ret; 135 int ret;
136 136
137 lockdep_assert_held(&priv->mutex); 137 lockdep_assert_held(&priv->shrd->mutex);
138 138
139 if (!test_bit(STATUS_SCANNING, &priv->shrd->status)) { 139 if (!test_bit(STATUS_SCANNING, &priv->shrd->status)) {
140 IWL_DEBUG_SCAN(priv, "Not performing scan to abort\n"); 140 IWL_DEBUG_SCAN(priv, "Not performing scan to abort\n");
@@ -173,7 +173,7 @@ int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
173{ 173{
174 unsigned long timeout = jiffies + msecs_to_jiffies(ms); 174 unsigned long timeout = jiffies + msecs_to_jiffies(ms);
175 175
176 lockdep_assert_held(&priv->mutex); 176 lockdep_assert_held(&priv->shrd->mutex);
177 177
178 IWL_DEBUG_SCAN(priv, "Scan cancel timeout\n"); 178 IWL_DEBUG_SCAN(priv, "Scan cancel timeout\n");
179 179
@@ -358,7 +358,7 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv,
358{ 358{
359 int ret; 359 int ret;
360 360
361 lockdep_assert_held(&priv->mutex); 361 lockdep_assert_held(&priv->shrd->mutex);
362 362
363 cancel_delayed_work(&priv->scan_check); 363 cancel_delayed_work(&priv->scan_check);
364 364
@@ -413,7 +413,7 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw,
413 if (req->n_channels == 0) 413 if (req->n_channels == 0)
414 return -EINVAL; 414 return -EINVAL;
415 415
416 mutex_lock(&priv->mutex); 416 mutex_lock(&priv->shrd->mutex);
417 417
418 if (test_bit(STATUS_SCANNING, &priv->shrd->status) && 418 if (test_bit(STATUS_SCANNING, &priv->shrd->status) &&
419 priv->scan_type != IWL_SCAN_NORMAL) { 419 priv->scan_type != IWL_SCAN_NORMAL) {
@@ -440,7 +440,7 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw,
440 IWL_DEBUG_MAC80211(priv, "leave\n"); 440 IWL_DEBUG_MAC80211(priv, "leave\n");
441 441
442out_unlock: 442out_unlock:
443 mutex_unlock(&priv->mutex); 443 mutex_unlock(&priv->shrd->mutex);
444 444
445 return ret; 445 return ret;
446} 446}
@@ -461,7 +461,7 @@ static void iwl_bg_start_internal_scan(struct work_struct *work)
461 461
462 IWL_DEBUG_SCAN(priv, "Start internal scan\n"); 462 IWL_DEBUG_SCAN(priv, "Start internal scan\n");
463 463
464 mutex_lock(&priv->mutex); 464 mutex_lock(&priv->shrd->mutex);
465 465
466 if (priv->scan_type == IWL_SCAN_RADIO_RESET) { 466 if (priv->scan_type == IWL_SCAN_RADIO_RESET) {
467 IWL_DEBUG_SCAN(priv, "Internal scan already in progress\n"); 467 IWL_DEBUG_SCAN(priv, "Internal scan already in progress\n");
@@ -476,7 +476,7 @@ static void iwl_bg_start_internal_scan(struct work_struct *work)
476 if (iwl_scan_initiate(priv, NULL, IWL_SCAN_RADIO_RESET, priv->band)) 476 if (iwl_scan_initiate(priv, NULL, IWL_SCAN_RADIO_RESET, priv->band))
477 IWL_DEBUG_SCAN(priv, "failed to start internal short scan\n"); 477 IWL_DEBUG_SCAN(priv, "failed to start internal short scan\n");
478 unlock: 478 unlock:
479 mutex_unlock(&priv->mutex); 479 mutex_unlock(&priv->shrd->mutex);
480} 480}
481 481
482static void iwl_bg_scan_check(struct work_struct *data) 482static void iwl_bg_scan_check(struct work_struct *data)
@@ -489,9 +489,9 @@ static void iwl_bg_scan_check(struct work_struct *data)
489 /* Since we are here firmware does not finish scan and 489 /* Since we are here firmware does not finish scan and
490 * most likely is in bad shape, so we don't bother to 490 * most likely is in bad shape, so we don't bother to
491 * send abort command, just force scan complete to mac80211 */ 491 * send abort command, just force scan complete to mac80211 */
492 mutex_lock(&priv->mutex); 492 mutex_lock(&priv->shrd->mutex);
493 iwl_force_scan_end(priv); 493 iwl_force_scan_end(priv);
494 mutex_unlock(&priv->mutex); 494 mutex_unlock(&priv->shrd->mutex);
495} 495}
496 496
497/** 497/**
@@ -549,9 +549,9 @@ static void iwl_bg_abort_scan(struct work_struct *work)
549 549
550 /* We keep scan_check work queued in case when firmware will not 550 /* We keep scan_check work queued in case when firmware will not
551 * report back scan completed notification */ 551 * report back scan completed notification */
552 mutex_lock(&priv->mutex); 552 mutex_lock(&priv->shrd->mutex);
553 iwl_scan_cancel_timeout(priv, 200); 553 iwl_scan_cancel_timeout(priv, 200);
554 mutex_unlock(&priv->mutex); 554 mutex_unlock(&priv->shrd->mutex);
555} 555}
556 556
557static void iwl_bg_scan_completed(struct work_struct *work) 557static void iwl_bg_scan_completed(struct work_struct *work)
@@ -564,7 +564,7 @@ static void iwl_bg_scan_completed(struct work_struct *work)
564 564
565 cancel_delayed_work(&priv->scan_check); 565 cancel_delayed_work(&priv->scan_check);
566 566
567 mutex_lock(&priv->mutex); 567 mutex_lock(&priv->shrd->mutex);
568 568
569 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->shrd->status); 569 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->shrd->status);
570 if (aborted) 570 if (aborted)
@@ -612,7 +612,7 @@ out_settings:
612 iwlagn_post_scan(priv); 612 iwlagn_post_scan(priv);
613 613
614out: 614out:
615 mutex_unlock(&priv->mutex); 615 mutex_unlock(&priv->shrd->mutex);
616} 616}
617 617
618void iwl_setup_scan_deferred_work(struct iwl_priv *priv) 618void iwl_setup_scan_deferred_work(struct iwl_priv *priv)
@@ -630,8 +630,8 @@ void iwl_cancel_scan_deferred_work(struct iwl_priv *priv)
630 cancel_work_sync(&priv->scan_completed); 630 cancel_work_sync(&priv->scan_completed);
631 631
632 if (cancel_delayed_work_sync(&priv->scan_check)) { 632 if (cancel_delayed_work_sync(&priv->scan_check)) {
633 mutex_lock(&priv->mutex); 633 mutex_lock(&priv->shrd->mutex);
634 iwl_force_scan_end(priv); 634 iwl_force_scan_end(priv);
635 mutex_unlock(&priv->mutex); 635 mutex_unlock(&priv->shrd->mutex);
636 } 636 }
637} 637}
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 1c2c31c15f60..33953199ffc6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -150,6 +150,7 @@ struct iwl_hw_params {
150 * @hw_params: see struct iwl_hw_params 150 * @hw_params: see struct iwl_hw_params
151 * @workqueue: the workqueue used by all the layers of the driver 151 * @workqueue: the workqueue used by all the layers of the driver
152 * @lock: protect general shared data 152 * @lock: protect general shared data
153 * @mutex:
153 */ 154 */
154struct iwl_shared { 155struct iwl_shared {
155#ifdef CONFIG_IWLWIFI_DEBUG 156#ifdef CONFIG_IWLWIFI_DEBUG
@@ -165,6 +166,7 @@ struct iwl_shared {
165 166
166 struct workqueue_struct *workqueue; 167 struct workqueue_struct *workqueue;
167 spinlock_t lock; 168 spinlock_t lock;
169 struct mutex mutex;
168}; 170};
169 171
170/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */ 172/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index b5b0ff3d8890..63b434b0948b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -821,13 +821,13 @@ int iwl_mac_sta_remove(struct ieee80211_hw *hw,
821 821
822 IWL_DEBUG_INFO(priv, "received request to remove station %pM\n", 822 IWL_DEBUG_INFO(priv, "received request to remove station %pM\n",
823 sta->addr); 823 sta->addr);
824 mutex_lock(&priv->mutex); 824 mutex_lock(&priv->shrd->mutex);
825 IWL_DEBUG_INFO(priv, "proceeding to remove station %pM\n", 825 IWL_DEBUG_INFO(priv, "proceeding to remove station %pM\n",
826 sta->addr); 826 sta->addr);
827 ret = iwl_remove_station(priv, sta_common->sta_id, sta->addr); 827 ret = iwl_remove_station(priv, sta_common->sta_id, sta->addr);
828 if (ret) 828 if (ret)
829 IWL_ERR(priv, "Error removing station %pM\n", 829 IWL_ERR(priv, "Error removing station %pM\n",
830 sta->addr); 830 sta->addr);
831 mutex_unlock(&priv->mutex); 831 mutex_unlock(&priv->shrd->mutex);
832 return ret; 832 return ret;
833} 833}
diff --git a/drivers/net/wireless/iwlwifi/iwl-sv-open.c b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
index b11f60de4f1e..ac751fa8b304 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sv-open.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
@@ -661,7 +661,7 @@ int iwl_testmode_cmd(struct ieee80211_hw *hw, void *data, int len)
661 return -ENOMSG; 661 return -ENOMSG;
662 } 662 }
663 /* in case multiple accesses to the device happens */ 663 /* in case multiple accesses to the device happens */
664 mutex_lock(&priv->mutex); 664 mutex_lock(&priv->shrd->mutex);
665 665
666 switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { 666 switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
667 case IWL_TM_CMD_APP2DEV_UCODE: 667 case IWL_TM_CMD_APP2DEV_UCODE:
@@ -702,7 +702,7 @@ int iwl_testmode_cmd(struct ieee80211_hw *hw, void *data, int len)
702 break; 702 break;
703 } 703 }
704 704
705 mutex_unlock(&priv->mutex); 705 mutex_unlock(&priv->shrd->mutex);
706 return result; 706 return result;
707} 707}
708 708
@@ -738,7 +738,7 @@ int iwl_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
738 } 738 }
739 739
740 /* in case multiple accesses to the device happens */ 740 /* in case multiple accesses to the device happens */
741 mutex_lock(&priv->mutex); 741 mutex_lock(&priv->shrd->mutex);
742 switch (cmd) { 742 switch (cmd) {
743 case IWL_TM_CMD_APP2DEV_READ_TRACE: 743 case IWL_TM_CMD_APP2DEV_READ_TRACE:
744 IWL_DEBUG_INFO(priv, "uCode trace cmd to driver\n"); 744 IWL_DEBUG_INFO(priv, "uCode trace cmd to driver\n");
@@ -749,6 +749,6 @@ int iwl_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
749 break; 749 break;
750 } 750 }
751 751
752 mutex_unlock(&priv->mutex); 752 mutex_unlock(&priv->shrd->mutex);
753 return result; 753 return result;
754} 754}
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-rx-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-rx-pcie.c
index 26497dd454a6..9c4bf8cd8771 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-rx-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-rx-pcie.c
@@ -349,9 +349,9 @@ void iwl_bg_rx_replenish(struct work_struct *data)
349 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) 349 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
350 return; 350 return;
351 351
352 mutex_lock(&priv->mutex); 352 mutex_lock(&priv->shrd->mutex);
353 iwlagn_rx_replenish(priv); 353 iwlagn_rx_replenish(priv);
354 mutex_unlock(&priv->mutex); 354 mutex_unlock(&priv->shrd->mutex);
355} 355}
356 356
357/** 357/**
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
index 61e17dd4f389..e1130a745ab6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
@@ -934,7 +934,7 @@ static int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
934 int cmd_idx; 934 int cmd_idx;
935 int ret; 935 int ret;
936 936
937 lockdep_assert_held(&priv->mutex); 937 lockdep_assert_held(&priv->shrd->mutex);
938 938
939 /* A synchronous command can not have a callback set. */ 939 /* A synchronous command can not have a callback set. */
940 if (WARN_ON(cmd->callback)) 940 if (WARN_ON(cmd->callback))