diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-23 04:46:45 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-08-27 12:26:54 -0400 |
commit | 238d781d33dcd7941e7ab799c59156e5f7ebda9d (patch) | |
tree | d9cc8c5b60b2feeee14a6a98d22603e769459c1b /drivers/net/wireless | |
parent | 770e13bdda27065e31b3ab4daa3a04b6429719a1 (diff) |
iwlwifi: add context pointer to station
Sometimes we only pass around station
pointers but need to find the context
they belong to, so store it in there.
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 |
5 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 837406e53b3f..de8db3a3848d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3751,7 +3751,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | |||
3751 | sta_priv->client = true; | 3751 | sta_priv->client = true; |
3752 | 3752 | ||
3753 | ret = iwl_add_station_common(priv, vif_priv->ctx, sta->addr, | 3753 | ret = iwl_add_station_common(priv, vif_priv->ctx, sta->addr, |
3754 | is_ap, &sta->ht_cap, &sta_id); | 3754 | is_ap, sta, &sta_id); |
3755 | if (ret) { | 3755 | if (ret) { |
3756 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", | 3756 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", |
3757 | sta->addr, ret); | 3757 | sta->addr, ret); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 2f9d1daff554..93647688d720 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -502,6 +502,7 @@ struct iwl_station_entry { | |||
502 | }; | 502 | }; |
503 | 503 | ||
504 | struct iwl_station_priv_common { | 504 | struct iwl_station_priv_common { |
505 | struct iwl_rxon_context *ctx; | ||
505 | u8 sta_id; | 506 | u8 sta_id; |
506 | }; | 507 | }; |
507 | 508 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index e6bb81b1514c..c18eb89a9aed 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -172,12 +172,13 @@ int iwl_send_add_sta(struct iwl_priv *priv, | |||
172 | EXPORT_SYMBOL(iwl_send_add_sta); | 172 | EXPORT_SYMBOL(iwl_send_add_sta); |
173 | 173 | ||
174 | static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, | 174 | static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, |
175 | struct ieee80211_sta_ht_cap *sta_ht_inf) | 175 | struct ieee80211_sta *sta) |
176 | { | 176 | { |
177 | struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap; | ||
177 | __le32 sta_flags; | 178 | __le32 sta_flags; |
178 | u8 mimo_ps_mode; | 179 | u8 mimo_ps_mode; |
179 | 180 | ||
180 | if (!sta_ht_inf || !sta_ht_inf->ht_supported) | 181 | if (!sta || !sta_ht_inf->ht_supported) |
181 | goto done; | 182 | goto done; |
182 | 183 | ||
183 | mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2; | 184 | mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2; |
@@ -228,7 +229,7 @@ static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, | |||
228 | */ | 229 | */ |
229 | static u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 230 | static u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
230 | const u8 *addr, bool is_ap, | 231 | const u8 *addr, bool is_ap, |
231 | struct ieee80211_sta_ht_cap *ht_info) | 232 | struct ieee80211_sta *sta) |
232 | { | 233 | { |
233 | struct iwl_station_entry *station; | 234 | struct iwl_station_entry *station; |
234 | int i; | 235 | int i; |
@@ -292,12 +293,19 @@ static u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
292 | station->sta.station_flags = ctx->station_flags; | 293 | station->sta.station_flags = ctx->station_flags; |
293 | station->ctxid = ctx->ctxid; | 294 | station->ctxid = ctx->ctxid; |
294 | 295 | ||
296 | if (sta) { | ||
297 | struct iwl_station_priv_common *sta_priv; | ||
298 | |||
299 | sta_priv = (void *)sta->drv_priv; | ||
300 | sta_priv->ctx = ctx; | ||
301 | } | ||
302 | |||
295 | /* | 303 | /* |
296 | * OK to call unconditionally, since local stations (IBSS BSSID | 304 | * OK to call unconditionally, since local stations (IBSS BSSID |
297 | * STA and broadcast STA) pass in a NULL ht_info, and mac80211 | 305 | * STA and broadcast STA) pass in a NULL sta, and mac80211 |
298 | * doesn't allow HT IBSS. | 306 | * doesn't allow HT IBSS. |
299 | */ | 307 | */ |
300 | iwl_set_ht_add_station(priv, sta_id, ht_info); | 308 | iwl_set_ht_add_station(priv, sta_id, sta); |
301 | 309 | ||
302 | /* 3945 only */ | 310 | /* 3945 only */ |
303 | rate = (priv->band == IEEE80211_BAND_5GHZ) ? | 311 | rate = (priv->band == IEEE80211_BAND_5GHZ) ? |
@@ -316,7 +324,7 @@ static u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
316 | */ | 324 | */ |
317 | int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 325 | int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
318 | const u8 *addr, bool is_ap, | 326 | const u8 *addr, bool is_ap, |
319 | struct ieee80211_sta_ht_cap *ht_info, u8 *sta_id_r) | 327 | struct ieee80211_sta *sta, u8 *sta_id_r) |
320 | { | 328 | { |
321 | unsigned long flags_spin; | 329 | unsigned long flags_spin; |
322 | int ret = 0; | 330 | int ret = 0; |
@@ -325,7 +333,7 @@ int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
325 | 333 | ||
326 | *sta_id_r = 0; | 334 | *sta_id_r = 0; |
327 | spin_lock_irqsave(&priv->sta_lock, flags_spin); | 335 | spin_lock_irqsave(&priv->sta_lock, flags_spin); |
328 | sta_id = iwl_prep_station(priv, ctx, addr, is_ap, ht_info); | 336 | sta_id = iwl_prep_station(priv, ctx, addr, is_ap, sta); |
329 | if (sta_id == IWL_INVALID_STATION) { | 337 | if (sta_id == IWL_INVALID_STATION) { |
330 | IWL_ERR(priv, "Unable to prepare station %pM for addition\n", | 338 | IWL_ERR(priv, "Unable to prepare station %pM for addition\n", |
331 | addr); | 339 | addr); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h index 6ab5587870dc..56bad3f60d81 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/drivers/net/wireless/iwlwifi/iwl-sta.h | |||
@@ -74,7 +74,7 @@ int iwl_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
74 | const u8 *addr, bool init_rs, u8 *sta_id_r); | 74 | const u8 *addr, bool init_rs, u8 *sta_id_r); |
75 | int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 75 | int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
76 | const u8 *addr, bool is_ap, | 76 | const u8 *addr, bool is_ap, |
77 | struct ieee80211_sta_ht_cap *ht_info, u8 *sta_id_r); | 77 | struct ieee80211_sta *sta, u8 *sta_id_r); |
78 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, | 78 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, |
79 | const u8 *addr); | 79 | const u8 *addr); |
80 | int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 80 | int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index be48f7977278..c048c1db42fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3390,7 +3390,7 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw, | |||
3390 | 3390 | ||
3391 | 3391 | ||
3392 | ret = iwl_add_station_common(priv, &priv->contexts[IWL_RXON_CTX_BSS], | 3392 | ret = iwl_add_station_common(priv, &priv->contexts[IWL_RXON_CTX_BSS], |
3393 | sta->addr, is_ap, &sta->ht_cap, &sta_id); | 3393 | sta->addr, is_ap, sta, &sta_id); |
3394 | if (ret) { | 3394 | if (ret) { |
3395 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", | 3395 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", |
3396 | sta->addr, ret); | 3396 | sta->addr, ret); |