aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinkler, Tomas <tomas.winkler@intel.com>2008-11-19 18:32:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-26 09:47:37 -0500
commit83dde8c90522b89366e241bdbd69113f7094c249 (patch)
tree6449703fa237de777c540021342ede3c742a4a6c
parentce546fd2eacdbd8dc15f3d2ffd9a95661d082919 (diff)
iwlwifi: move iwl_clear_stations_table to iwl-sta.c
This patch moves iwl_clear_stations_table into iwl-sta.c Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.h1
4 files changed, 25 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index fccd150ae5ca..6aa332bebc5f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -37,6 +37,7 @@
37#include "iwl-io.h" 37#include "iwl-io.h"
38#include "iwl-rfkill.h" 38#include "iwl-rfkill.h"
39#include "iwl-power.h" 39#include "iwl-power.h"
40#include "iwl-sta.h"
40 41
41 42
42MODULE_DESCRIPTION("iwl core"); 43MODULE_DESCRIPTION("iwl core");
@@ -237,28 +238,6 @@ int iwl_hw_nic_init(struct iwl_priv *priv)
237} 238}
238EXPORT_SYMBOL(iwl_hw_nic_init); 239EXPORT_SYMBOL(iwl_hw_nic_init);
239 240
240/**
241 * iwl_clear_stations_table - Clear the driver's station table
242 *
243 * NOTE: This does not clear or otherwise alter the device's station table.
244 */
245void iwl_clear_stations_table(struct iwl_priv *priv)
246{
247 unsigned long flags;
248
249 spin_lock_irqsave(&priv->sta_lock, flags);
250
251 if (iwl_is_alive(priv) &&
252 !test_bit(STATUS_EXIT_PENDING, &priv->status) &&
253 iwl_send_cmd_pdu_async(priv, REPLY_REMOVE_ALL_STA, 0, NULL, NULL))
254 IWL_ERROR("Couldn't clear the station table\n");
255
256 priv->num_stations = 0;
257 memset(priv->stations, 0, sizeof(priv->stations));
258
259 spin_unlock_irqrestore(&priv->sta_lock, flags);
260}
261EXPORT_SYMBOL(iwl_clear_stations_table);
262 241
263void iwl_reset_qos(struct iwl_priv *priv) 242void iwl_reset_qos(struct iwl_priv *priv)
264{ 243{
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 5d4e2e28bdbe..82bf263b6f5a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -182,7 +182,6 @@ struct iwl_cfg {
182struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg, 182struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg,
183 struct ieee80211_ops *hw_ops); 183 struct ieee80211_ops *hw_ops);
184void iwl_hw_detect(struct iwl_priv *priv); 184void iwl_hw_detect(struct iwl_priv *priv);
185void iwl_clear_stations_table(struct iwl_priv *priv);
186void iwl_reset_qos(struct iwl_priv *priv); 185void iwl_reset_qos(struct iwl_priv *priv);
187void iwl_set_rxon_chain(struct iwl_priv *priv); 186void iwl_set_rxon_chain(struct iwl_priv *priv);
188int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch); 187int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch);
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 109136a09c54..f86a8ca2aa3b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -463,6 +463,29 @@ out:
463} 463}
464EXPORT_SYMBOL(iwl_remove_station); 464EXPORT_SYMBOL(iwl_remove_station);
465 465
466/**
467 * iwl_clear_stations_table - Clear the driver's station table
468 *
469 * NOTE: This does not clear or otherwise alter the device's station table.
470 */
471void iwl_clear_stations_table(struct iwl_priv *priv)
472{
473 unsigned long flags;
474
475 spin_lock_irqsave(&priv->sta_lock, flags);
476
477 if (iwl_is_alive(priv) &&
478 !test_bit(STATUS_EXIT_PENDING, &priv->status) &&
479 iwl_send_cmd_pdu_async(priv, REPLY_REMOVE_ALL_STA, 0, NULL, NULL))
480 IWL_ERROR("Couldn't clear the station table\n");
481
482 priv->num_stations = 0;
483 memset(priv->stations, 0, sizeof(priv->stations));
484
485 spin_unlock_irqrestore(&priv->sta_lock, flags);
486}
487EXPORT_SYMBOL(iwl_clear_stations_table);
488
466static int iwl_get_free_ucode_key_index(struct iwl_priv *priv) 489static int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
467{ 490{
468 int i; 491 int i;
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index 61eede5b30cb..7b98ea4dfbc0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -53,6 +53,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
53 53
54int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap); 54int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap);
55int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap); 55int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap);
56void iwl_clear_stations_table(struct iwl_priv *priv);
56int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr); 57int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr);
57int iwl_get_ra_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr); 58int iwl_get_ra_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr);
58u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, 59u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr,