diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-04-16 16:34:48 -0700 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:10 -0400 |
commit | 947b13a7ccd31d8adbf41f466d6a1c770461596a (patch) | |
tree | 1cbb139f37aefdf6d1120ff2a15b1c657c918dfc /drivers/net/wireless/iwlwifi/iwl-sta.c | |
parent | f0832f137c21d130998a0f97f97ac01a2d97210b (diff) | |
download | lwn-947b13a7ccd31d8adbf41f466d6a1c770461596a.tar.gz lwn-947b13a7ccd31d8adbf41f466d6a1c770461596a.zip |
iwlwifi: move find station to iwl-sta.c
This patch move iwl_find_station into iwl-sta.c file
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index e4fdfaa2b9b2..fa463ce6399b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -28,6 +28,7 @@ *****************************************************************************/ #include <net/mac80211.h> +#include <linux/etherdevice.h> #include "iwl-eeprom.h" #include "iwl-4965.h" @@ -38,6 +39,40 @@ #include "iwl-4965.h" #include "iwl-sta.h" +u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr) +{ + int i; + int start = 0; + int ret = IWL_INVALID_STATION; + unsigned long flags; + DECLARE_MAC_BUF(mac); + + if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) || + (priv->iw_mode == IEEE80211_IF_TYPE_AP)) + start = IWL_STA_ID; + + if (is_broadcast_ether_addr(addr)) + return priv->hw_params.bcast_sta_id; + + spin_lock_irqsave(&priv->sta_lock, flags); + for (i = start; i < priv->hw_params.max_stations; i++) + if (priv->stations[i].used && + (!compare_ether_addr(priv->stations[i].sta.sta.addr, + addr))) { + ret = i; + goto out; + } + + IWL_DEBUG_ASSOC_LIMIT("can not find STA %s total %d\n", + print_mac(mac, addr), priv->num_stations); + + out: + spin_unlock_irqrestore(&priv->sta_lock, flags); + return ret; +} +EXPORT_SYMBOL(iwl_find_station); + + int iwl_get_free_ucode_key_index(struct iwl_priv *priv) { int i; |