aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-06-22 09:34:09 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-06-24 14:54:51 -0400
commitf775aa06d2de583bd291d4bf5814784c9ff7b9cc (patch)
tree4a2ed6875f13f63885cc298949558596ebaa11f1 /drivers/net/wireless/iwlwifi
parent0b5b3ff15b301338ccec77ebc051308ac614d05d (diff)
iwlagn: don't use CCK rates for P2P interfaces
P2P interfaces must not use CCK rates, only OFDM rates are allowed. To set this up, we need to set up the broadcast station to start with 6M instead of starting with 1M. Since the interface type can change, also reset the broadcast station when RXON changes. This will affect beacons as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h2
3 files changed, 15 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index a7c66c4e5f2a..8fa43d427811 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -210,6 +210,8 @@ static int iwlagn_rxon_disconn(struct iwl_priv *priv,
210 * keys, so we have to restore those afterwards. 210 * keys, so we have to restore those afterwards.
211 */ 211 */
212 iwl_clear_ucode_stations(priv, ctx); 212 iwl_clear_ucode_stations(priv, ctx);
213 /* update -- might need P2P now */
214 iwl_update_bcast_station(priv, ctx);
213 iwl_restore_stations(priv, ctx); 215 iwl_restore_stations(priv, ctx);
214 ret = iwl_restore_default_wep_keys(priv, ctx); 216 ret = iwl_restore_default_wep_keys(priv, ctx);
215 if (ret) { 217 if (ret) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index 0bd722cee5ae..9b32f83f0b7f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -35,7 +35,7 @@
35#include "iwl-agn.h" 35#include "iwl-agn.h"
36 36
37static struct iwl_link_quality_cmd * 37static struct iwl_link_quality_cmd *
38iwl_sta_alloc_lq(struct iwl_priv *priv, u8 sta_id) 38iwl_sta_alloc_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, u8 sta_id)
39{ 39{
40 int i, r; 40 int i, r;
41 struct iwl_link_quality_cmd *link_cmd; 41 struct iwl_link_quality_cmd *link_cmd;
@@ -47,10 +47,15 @@ iwl_sta_alloc_lq(struct iwl_priv *priv, u8 sta_id)
47 IWL_ERR(priv, "Unable to allocate memory for LQ cmd.\n"); 47 IWL_ERR(priv, "Unable to allocate memory for LQ cmd.\n");
48 return NULL; 48 return NULL;
49 } 49 }
50
51 lockdep_assert_held(&priv->mutex);
52
50 /* Set up the rate scaling to start at selected rate, fall back 53 /* Set up the rate scaling to start at selected rate, fall back
51 * all the way down to 1M in IEEE order, and then spin on 1M */ 54 * all the way down to 1M in IEEE order, and then spin on 1M */
52 if (priv->band == IEEE80211_BAND_5GHZ) 55 if (priv->band == IEEE80211_BAND_5GHZ)
53 r = IWL_RATE_6M_INDEX; 56 r = IWL_RATE_6M_INDEX;
57 else if (ctx && ctx->vif && ctx->vif->p2p)
58 r = IWL_RATE_6M_INDEX;
54 else 59 else
55 r = IWL_RATE_1M_INDEX; 60 r = IWL_RATE_1M_INDEX;
56 61
@@ -115,7 +120,7 @@ int iwlagn_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx
115 spin_unlock_irqrestore(&priv->sta_lock, flags); 120 spin_unlock_irqrestore(&priv->sta_lock, flags);
116 121
117 /* Set up default rate scaling table in device's station table */ 122 /* Set up default rate scaling table in device's station table */
118 link_cmd = iwl_sta_alloc_lq(priv, sta_id); 123 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id);
119 if (!link_cmd) { 124 if (!link_cmd) {
120 IWL_ERR(priv, "Unable to initialize rate scaling for station %pM.\n", 125 IWL_ERR(priv, "Unable to initialize rate scaling for station %pM.\n",
121 addr); 126 addr);
@@ -554,7 +559,7 @@ int iwlagn_alloc_bcast_station(struct iwl_priv *priv,
554 priv->stations[sta_id].used |= IWL_STA_BCAST; 559 priv->stations[sta_id].used |= IWL_STA_BCAST;
555 spin_unlock_irqrestore(&priv->sta_lock, flags); 560 spin_unlock_irqrestore(&priv->sta_lock, flags);
556 561
557 link_cmd = iwl_sta_alloc_lq(priv, sta_id); 562 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id);
558 if (!link_cmd) { 563 if (!link_cmd) {
559 IWL_ERR(priv, 564 IWL_ERR(priv,
560 "Unable to initialize rate scaling for bcast station.\n"); 565 "Unable to initialize rate scaling for bcast station.\n");
@@ -574,14 +579,14 @@ int iwlagn_alloc_bcast_station(struct iwl_priv *priv,
574 * Only used by iwlagn. Placed here to have all bcast station management 579 * Only used by iwlagn. Placed here to have all bcast station management
575 * code together. 580 * code together.
576 */ 581 */
577static int iwl_update_bcast_station(struct iwl_priv *priv, 582int iwl_update_bcast_station(struct iwl_priv *priv,
578 struct iwl_rxon_context *ctx) 583 struct iwl_rxon_context *ctx)
579{ 584{
580 unsigned long flags; 585 unsigned long flags;
581 struct iwl_link_quality_cmd *link_cmd; 586 struct iwl_link_quality_cmd *link_cmd;
582 u8 sta_id = ctx->bcast_sta_id; 587 u8 sta_id = ctx->bcast_sta_id;
583 588
584 link_cmd = iwl_sta_alloc_lq(priv, sta_id); 589 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id);
585 if (!link_cmd) { 590 if (!link_cmd) {
586 IWL_ERR(priv, "Unable to initialize rate scaling for bcast station.\n"); 591 IWL_ERR(priv, "Unable to initialize rate scaling for bcast station.\n");
587 return -ENOMEM; 592 return -ENOMEM;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 6d5584ae5ebf..dcdf2259520f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -304,6 +304,8 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
304int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta, 304int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
305 int tid); 305 int tid);
306void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); 306void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt);
307int iwl_update_bcast_station(struct iwl_priv *priv,
308 struct iwl_rxon_context *ctx);
307int iwl_update_bcast_stations(struct iwl_priv *priv); 309int iwl_update_bcast_stations(struct iwl_priv *priv);
308void iwlagn_mac_sta_notify(struct ieee80211_hw *hw, 310void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
309 struct ieee80211_vif *vif, 311 struct ieee80211_vif *vif,