diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-04-28 11:44:52 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-10 18:08:53 -0400 |
commit | 1fa61b2e793dad51271c7ce39377daade51261d7 (patch) | |
tree | 1165dc3d721f1db83a459687b70bb3b4fdfafec9 /drivers/net/wireless/iwlwifi/iwl-3945.c | |
parent | c0222df86e55576ef879795b5a158c46e6653f07 (diff) |
iwlwifi: manage IBSS station properly
Currently iwlwifi will eventually exhaust the station
table when adding the BSSID station for IBSS mode,
unless the interface is set down.
The new mac80211 ibss joined/left notification allows
us to fix that easily by moving the code to add the
IBSS station to the notification, and also adding
code to remove it again when we leave the IBSS.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 360781326cb7..1e9593968c36 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -884,7 +884,8 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, | |||
884 | tx_cmd->supp_rates[1], tx_cmd->supp_rates[0]); | 884 | tx_cmd->supp_rates[1], tx_cmd->supp_rates[0]); |
885 | } | 885 | } |
886 | 886 | ||
887 | u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags) | 887 | static u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, |
888 | u16 tx_rate, u8 flags) | ||
888 | { | 889 | { |
889 | unsigned long flags_spin; | 890 | unsigned long flags_spin; |
890 | struct iwl_station_entry *station; | 891 | struct iwl_station_entry *station; |
@@ -2395,6 +2396,32 @@ static u16 iwl3945_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data) | |||
2395 | return (u16)sizeof(struct iwl3945_addsta_cmd); | 2396 | return (u16)sizeof(struct iwl3945_addsta_cmd); |
2396 | } | 2397 | } |
2397 | 2398 | ||
2399 | static int iwl3945_manage_ibss_station(struct iwl_priv *priv, | ||
2400 | struct ieee80211_vif *vif, bool add) | ||
2401 | { | ||
2402 | int ret; | ||
2403 | |||
2404 | /* | ||
2405 | * NB: this assumes that the station it gets will be | ||
2406 | * IWL_STA_ID, which will happen but isn't obvious. | ||
2407 | */ | ||
2408 | |||
2409 | if (add) { | ||
2410 | ret = iwl_add_local_station(priv, vif->bss_conf.bssid, false); | ||
2411 | if (ret) | ||
2412 | return ret; | ||
2413 | |||
2414 | iwl3945_sync_sta(priv, IWL_STA_ID, | ||
2415 | (priv->band == IEEE80211_BAND_5GHZ) ? | ||
2416 | IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP, | ||
2417 | CMD_ASYNC); | ||
2418 | iwl3945_rate_scale_init(priv->hw, IWL_STA_ID); | ||
2419 | |||
2420 | return 0; | ||
2421 | } | ||
2422 | |||
2423 | return iwl_remove_station(priv, vif->bss_conf.bssid); | ||
2424 | } | ||
2398 | 2425 | ||
2399 | /** | 2426 | /** |
2400 | * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table | 2427 | * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table |
@@ -2802,6 +2829,7 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
2802 | .post_associate = iwl3945_post_associate, | 2829 | .post_associate = iwl3945_post_associate, |
2803 | .isr = iwl_isr_legacy, | 2830 | .isr = iwl_isr_legacy, |
2804 | .config_ap = iwl3945_config_ap, | 2831 | .config_ap = iwl3945_config_ap, |
2832 | .manage_ibss_station = iwl3945_manage_ibss_station, | ||
2805 | .add_bcast_station = iwl3945_add_bcast_station, | 2833 | .add_bcast_station = iwl3945_add_bcast_station, |
2806 | 2834 | ||
2807 | .debugfs_ops = { | 2835 | .debugfs_ops = { |