aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-08-26 02:10:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-29 15:25:32 -0400
commitf39c95e8d7a152b409977687a999356f0e54bde6 (patch)
treec4863cd9a6449d7e61034ebf12b8417d40011fc4 /drivers/net/wireless/iwlwifi/iwl-agn-sta.c
parent9ca06f0a3fbf57c672c7f2cdfc85747a0bbfaf28 (diff)
iwlagn: priv->sta_lock 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/wireless/iwlwifi/iwl-agn-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index c99e6cce0733..4b13bb9df999 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -116,9 +116,9 @@ int iwlagn_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx
116 if (sta_id_r) 116 if (sta_id_r)
117 *sta_id_r = sta_id; 117 *sta_id_r = sta_id;
118 118
119 spin_lock_irqsave(&priv->sta_lock, flags); 119 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
120 priv->stations[sta_id].used |= IWL_STA_LOCAL; 120 priv->stations[sta_id].used |= IWL_STA_LOCAL;
121 spin_unlock_irqrestore(&priv->sta_lock, flags); 121 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
122 122
123 /* Set up default rate scaling table in device's station table */ 123 /* Set up default rate scaling table in device's station table */
124 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id); 124 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id);
@@ -132,9 +132,9 @@ int iwlagn_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx
132 if (ret) 132 if (ret)
133 IWL_ERR(priv, "Link quality command failed (%d)\n", ret); 133 IWL_ERR(priv, "Link quality command failed (%d)\n", ret);
134 134
135 spin_lock_irqsave(&priv->sta_lock, flags); 135 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
136 priv->stations[sta_id].lq = link_cmd; 136 priv->stations[sta_id].lq = link_cmd;
137 spin_unlock_irqrestore(&priv->sta_lock, flags); 137 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
138 138
139 return 0; 139 return 0;
140} 140}
@@ -311,9 +311,9 @@ static int iwlagn_send_sta_key(struct iwl_priv *priv,
311 struct iwl_addsta_cmd sta_cmd; 311 struct iwl_addsta_cmd sta_cmd;
312 int i; 312 int i;
313 313
314 spin_lock_irqsave(&priv->sta_lock, flags); 314 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
315 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd)); 315 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd));
316 spin_unlock_irqrestore(&priv->sta_lock, flags); 316 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
317 317
318 key_flags = cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); 318 key_flags = cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
319 key_flags |= STA_KEY_FLG_MAP_KEY_MSK; 319 key_flags |= STA_KEY_FLG_MAP_KEY_MSK;
@@ -388,11 +388,11 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
388 if (sta_id == IWL_INVALID_STATION) 388 if (sta_id == IWL_INVALID_STATION)
389 return -ENOENT; 389 return -ENOENT;
390 390
391 spin_lock_irqsave(&priv->sta_lock, flags); 391 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
392 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd)); 392 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd));
393 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) 393 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE))
394 sta_id = IWL_INVALID_STATION; 394 sta_id = IWL_INVALID_STATION;
395 spin_unlock_irqrestore(&priv->sta_lock, flags); 395 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
396 396
397 if (sta_id == IWL_INVALID_STATION) 397 if (sta_id == IWL_INVALID_STATION)
398 return 0; 398 return 0;
@@ -493,18 +493,18 @@ int iwlagn_alloc_bcast_station(struct iwl_priv *priv,
493 unsigned long flags; 493 unsigned long flags;
494 u8 sta_id; 494 u8 sta_id;
495 495
496 spin_lock_irqsave(&priv->sta_lock, flags); 496 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
497 sta_id = iwl_prep_station(priv, ctx, iwl_bcast_addr, false, NULL); 497 sta_id = iwl_prep_station(priv, ctx, iwl_bcast_addr, false, NULL);
498 if (sta_id == IWL_INVALID_STATION) { 498 if (sta_id == IWL_INVALID_STATION) {
499 IWL_ERR(priv, "Unable to prepare broadcast station\n"); 499 IWL_ERR(priv, "Unable to prepare broadcast station\n");
500 spin_unlock_irqrestore(&priv->sta_lock, flags); 500 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
501 501
502 return -EINVAL; 502 return -EINVAL;
503 } 503 }
504 504
505 priv->stations[sta_id].used |= IWL_STA_DRIVER_ACTIVE; 505 priv->stations[sta_id].used |= IWL_STA_DRIVER_ACTIVE;
506 priv->stations[sta_id].used |= IWL_STA_BCAST; 506 priv->stations[sta_id].used |= IWL_STA_BCAST;
507 spin_unlock_irqrestore(&priv->sta_lock, flags); 507 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
508 508
509 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id); 509 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id);
510 if (!link_cmd) { 510 if (!link_cmd) {
@@ -513,9 +513,9 @@ int iwlagn_alloc_bcast_station(struct iwl_priv *priv,
513 return -ENOMEM; 513 return -ENOMEM;
514 } 514 }
515 515
516 spin_lock_irqsave(&priv->sta_lock, flags); 516 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
517 priv->stations[sta_id].lq = link_cmd; 517 priv->stations[sta_id].lq = link_cmd;
518 spin_unlock_irqrestore(&priv->sta_lock, flags); 518 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
519 519
520 return 0; 520 return 0;
521} 521}
@@ -539,13 +539,13 @@ int iwl_update_bcast_station(struct iwl_priv *priv,
539 return -ENOMEM; 539 return -ENOMEM;
540 } 540 }
541 541
542 spin_lock_irqsave(&priv->sta_lock, flags); 542 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
543 if (priv->stations[sta_id].lq) 543 if (priv->stations[sta_id].lq)
544 kfree(priv->stations[sta_id].lq); 544 kfree(priv->stations[sta_id].lq);
545 else 545 else
546 IWL_DEBUG_INFO(priv, "Bcast station rate scaling has not been initialized yet.\n"); 546 IWL_DEBUG_INFO(priv, "Bcast station rate scaling has not been initialized yet.\n");
547 priv->stations[sta_id].lq = link_cmd; 547 priv->stations[sta_id].lq = link_cmd;
548 spin_unlock_irqrestore(&priv->sta_lock, flags); 548 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
549 549
550 return 0; 550 return 0;
551} 551}
@@ -575,12 +575,12 @@ int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid)
575 lockdep_assert_held(&priv->shrd->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->shrd->sta_lock, flags);
579 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_TID_DISABLE_TX; 579 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_TID_DISABLE_TX;
580 priv->stations[sta_id].sta.tid_disable_tx &= cpu_to_le16(~(1 << tid)); 580 priv->stations[sta_id].sta.tid_disable_tx &= cpu_to_le16(~(1 << tid));
581 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 581 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
582 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd)); 582 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd));
583 spin_unlock_irqrestore(&priv->sta_lock, flags); 583 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
584 584
585 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC); 585 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
586} 586}
@@ -598,14 +598,14 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
598 if (sta_id == IWL_INVALID_STATION) 598 if (sta_id == IWL_INVALID_STATION)
599 return -ENXIO; 599 return -ENXIO;
600 600
601 spin_lock_irqsave(&priv->sta_lock, flags); 601 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
602 priv->stations[sta_id].sta.station_flags_msk = 0; 602 priv->stations[sta_id].sta.station_flags_msk = 0;
603 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_ADDBA_TID_MSK; 603 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_ADDBA_TID_MSK;
604 priv->stations[sta_id].sta.add_immediate_ba_tid = (u8)tid; 604 priv->stations[sta_id].sta.add_immediate_ba_tid = (u8)tid;
605 priv->stations[sta_id].sta.add_immediate_ba_ssn = cpu_to_le16(ssn); 605 priv->stations[sta_id].sta.add_immediate_ba_ssn = cpu_to_le16(ssn);
606 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 606 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
607 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd)); 607 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd));
608 spin_unlock_irqrestore(&priv->sta_lock, flags); 608 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
609 609
610 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC); 610 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
611} 611}
@@ -625,13 +625,13 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
625 return -ENXIO; 625 return -ENXIO;
626 } 626 }
627 627
628 spin_lock_irqsave(&priv->sta_lock, flags); 628 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
629 priv->stations[sta_id].sta.station_flags_msk = 0; 629 priv->stations[sta_id].sta.station_flags_msk = 0;
630 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_DELBA_TID_MSK; 630 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_DELBA_TID_MSK;
631 priv->stations[sta_id].sta.remove_immediate_ba_tid = (u8)tid; 631 priv->stations[sta_id].sta.remove_immediate_ba_tid = (u8)tid;
632 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 632 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
633 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd)); 633 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd));
634 spin_unlock_irqrestore(&priv->sta_lock, flags); 634 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
635 635
636 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC); 636 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
637} 637}
@@ -640,14 +640,14 @@ static void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id)
640{ 640{
641 unsigned long flags; 641 unsigned long flags;
642 642
643 spin_lock_irqsave(&priv->sta_lock, flags); 643 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
644 priv->stations[sta_id].sta.station_flags &= ~STA_FLG_PWR_SAVE_MSK; 644 priv->stations[sta_id].sta.station_flags &= ~STA_FLG_PWR_SAVE_MSK;
645 priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK; 645 priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK;
646 priv->stations[sta_id].sta.sta.modify_mask = 0; 646 priv->stations[sta_id].sta.sta.modify_mask = 0;
647 priv->stations[sta_id].sta.sleep_tx_count = 0; 647 priv->stations[sta_id].sta.sleep_tx_count = 0;
648 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 648 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
649 iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); 649 iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
650 spin_unlock_irqrestore(&priv->sta_lock, flags); 650 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
651 651
652} 652}
653 653
@@ -655,7 +655,7 @@ void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt)
655{ 655{
656 unsigned long flags; 656 unsigned long flags;
657 657
658 spin_lock_irqsave(&priv->sta_lock, flags); 658 spin_lock_irqsave(&priv->shrd->sta_lock, flags);
659 priv->stations[sta_id].sta.station_flags |= STA_FLG_PWR_SAVE_MSK; 659 priv->stations[sta_id].sta.station_flags |= STA_FLG_PWR_SAVE_MSK;
660 priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK; 660 priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK;
661 priv->stations[sta_id].sta.sta.modify_mask = 661 priv->stations[sta_id].sta.sta.modify_mask =
@@ -663,7 +663,7 @@ void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt)
663 priv->stations[sta_id].sta.sleep_tx_count = cpu_to_le16(cnt); 663 priv->stations[sta_id].sta.sleep_tx_count = cpu_to_le16(cnt);
664 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 664 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
665 iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); 665 iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
666 spin_unlock_irqrestore(&priv->sta_lock, flags); 666 spin_unlock_irqrestore(&priv->shrd->sta_lock, flags);
667 667
668} 668}
669 669