aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-04-29 03:53:29 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-05-10 18:09:02 -0400
commit2c810ccdbac434ae38f4ec5331d3f047dc90f98a (patch)
treee1bd92e76baf88d5ac3f4af37e709f8c746fd623 /drivers/net/wireless/iwlwifi/iwl-agn.c
parenta6a0345c837346d1b74f4907d4747e6c1053a99f (diff)
iwlwifi: rework broadcast station management
Currently, the broadcast station is managed along with the interface type, rather than always being present. That leads to a bug with injection -- it is currently not possible to inject frames when the only virtual interface is a monitor, because in that the required broadcast station is missing. Additionally, allocating and deallocating the broadcast station's LQ all the time is wasteful, and the code to support this is fairly complex. So this changes completely the way we manage the broadcast station. Rather than manage it along with any interface, we now allocate it when we bring the device up, and remove it again when we bring the device down. When we bring the device up, we don't immediately program the broadcast station into it, instead we just mark it active and rely on the next restore cycle to upload it to the device. This works because an unassociated RXON is always required at least once to set up device parameters, which implies a reprogramming of stations into the device. As we now manage all stations properly, there no longer is a need for forcing a clearing of them via iwl_clear_ucode_stations(), which can become a lot simpler. 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-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 85e045baf5ae..0c913ea71f1e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -156,7 +156,7 @@ int iwl_commit_rxon(struct iwl_priv *priv)
156 IWL_ERR(priv, "Error clearing ASSOC_MSK (%d)\n", ret); 156 IWL_ERR(priv, "Error clearing ASSOC_MSK (%d)\n", ret);
157 return ret; 157 return ret;
158 } 158 }
159 iwl_clear_ucode_stations(priv, false); 159 iwl_clear_ucode_stations(priv);
160 iwl_restore_stations(priv); 160 iwl_restore_stations(priv);
161 ret = iwl_restore_default_wep_keys(priv); 161 ret = iwl_restore_default_wep_keys(priv);
162 if (ret) { 162 if (ret) {
@@ -188,7 +188,7 @@ int iwl_commit_rxon(struct iwl_priv *priv)
188 } 188 }
189 IWL_DEBUG_INFO(priv, "Return from !new_assoc RXON.\n"); 189 IWL_DEBUG_INFO(priv, "Return from !new_assoc RXON.\n");
190 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); 190 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
191 iwl_clear_ucode_stations(priv, false); 191 iwl_clear_ucode_stations(priv);
192 iwl_restore_stations(priv); 192 iwl_restore_stations(priv);
193 ret = iwl_restore_default_wep_keys(priv); 193 ret = iwl_restore_default_wep_keys(priv);
194 if (ret) { 194 if (ret) {
@@ -2403,7 +2403,8 @@ static void __iwl_down(struct iwl_priv *priv)
2403 if (!exit_pending) 2403 if (!exit_pending)
2404 set_bit(STATUS_EXIT_PENDING, &priv->status); 2404 set_bit(STATUS_EXIT_PENDING, &priv->status);
2405 2405
2406 iwl_clear_ucode_stations(priv, true); 2406 iwl_clear_ucode_stations(priv);
2407 iwl_dealloc_bcast_station(priv);
2407 2408
2408 /* Unblock any waiting calls */ 2409 /* Unblock any waiting calls */
2409 wake_up_interruptible_all(&priv->wait_command_queue); 2410 wake_up_interruptible_all(&priv->wait_command_queue);
@@ -2550,6 +2551,10 @@ static int __iwl_up(struct iwl_priv *priv)
2550 return -EIO; 2551 return -EIO;
2551 } 2552 }
2552 2553
2554 ret = iwl_alloc_bcast_station(priv, true);
2555 if (ret)
2556 return ret;
2557
2553 iwl_prepare_card_hw(priv); 2558 iwl_prepare_card_hw(priv);
2554 2559
2555 if (!priv->hw_ready) { 2560 if (!priv->hw_ready) {
@@ -3032,7 +3037,6 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
3032 /* restore RXON assoc */ 3037 /* restore RXON assoc */
3033 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; 3038 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
3034 iwlcore_commit_rxon(priv); 3039 iwlcore_commit_rxon(priv);
3035 iwl_add_bcast_station(priv);
3036 } 3040 }
3037 iwl_send_beacon_cmd(priv); 3041 iwl_send_beacon_cmd(priv);
3038 3042