diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-05 14:24:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-06 15:16:07 -0500 |
commit | d316383dfdb51d46fb9681a68b395a5735f3f4b3 (patch) | |
tree | cd95ef1090f07739e137f86aed0a5a9597a23735 /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | e9a8e8ec1e487536568adc4b3efa8f56e4391a7b (diff) |
iwlwifi: move iwl_clear_driver_stations to user
There's only one place using this function, so
move it where it's needed.
Signed-off-by: Johannes Berg <johannes.berg@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.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index e0fef9f257c2..a7f3a7023d88 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -738,6 +738,41 @@ int iwl_alive_start(struct iwl_priv *priv) | |||
738 | return iwl_power_update_mode(priv, true); | 738 | return iwl_power_update_mode(priv, true); |
739 | } | 739 | } |
740 | 740 | ||
741 | /** | ||
742 | * iwl_clear_driver_stations - clear knowledge of all stations from driver | ||
743 | * @priv: iwl priv struct | ||
744 | * | ||
745 | * This is called during iwl_down() to make sure that in the case | ||
746 | * we're coming there from a hardware restart mac80211 will be | ||
747 | * able to reconfigure stations -- if we're getting there in the | ||
748 | * normal down flow then the stations will already be cleared. | ||
749 | */ | ||
750 | static void iwl_clear_driver_stations(struct iwl_priv *priv) | ||
751 | { | ||
752 | unsigned long flags; | ||
753 | struct iwl_rxon_context *ctx; | ||
754 | |||
755 | spin_lock_irqsave(&priv->shrd->sta_lock, flags); | ||
756 | memset(priv->stations, 0, sizeof(priv->stations)); | ||
757 | priv->num_stations = 0; | ||
758 | |||
759 | priv->ucode_key_table = 0; | ||
760 | |||
761 | for_each_context(priv, ctx) { | ||
762 | /* | ||
763 | * Remove all key information that is not stored as part | ||
764 | * of station information since mac80211 may not have had | ||
765 | * a chance to remove all the keys. When device is | ||
766 | * reconfigured by mac80211 after an error all keys will | ||
767 | * be reconfigured. | ||
768 | */ | ||
769 | memset(ctx->wep_keys, 0, sizeof(ctx->wep_keys)); | ||
770 | ctx->key_mapping_keys = 0; | ||
771 | } | ||
772 | |||
773 | spin_unlock_irqrestore(&priv->shrd->sta_lock, flags); | ||
774 | } | ||
775 | |||
741 | void iwl_down(struct iwl_priv *priv) | 776 | void iwl_down(struct iwl_priv *priv) |
742 | { | 777 | { |
743 | int exit_pending; | 778 | int exit_pending; |