diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-04-16 19:34:48 -0400 |
---|---|---|
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) |
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 @@ | |||
28 | *****************************************************************************/ | 28 | *****************************************************************************/ |
29 | 29 | ||
30 | #include <net/mac80211.h> | 30 | #include <net/mac80211.h> |
31 | #include <linux/etherdevice.h> | ||
31 | 32 | ||
32 | #include "iwl-eeprom.h" | 33 | #include "iwl-eeprom.h" |
33 | #include "iwl-4965.h" | 34 | #include "iwl-4965.h" |
@@ -38,6 +39,40 @@ | |||
38 | #include "iwl-4965.h" | 39 | #include "iwl-4965.h" |
39 | #include "iwl-sta.h" | 40 | #include "iwl-sta.h" |
40 | 41 | ||
42 | u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr) | ||
43 | { | ||
44 | int i; | ||
45 | int start = 0; | ||
46 | int ret = IWL_INVALID_STATION; | ||
47 | unsigned long flags; | ||
48 | DECLARE_MAC_BUF(mac); | ||
49 | |||
50 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) || | ||
51 | (priv->iw_mode == IEEE80211_IF_TYPE_AP)) | ||
52 | start = IWL_STA_ID; | ||
53 | |||
54 | if (is_broadcast_ether_addr(addr)) | ||
55 | return priv->hw_params.bcast_sta_id; | ||
56 | |||
57 | spin_lock_irqsave(&priv->sta_lock, flags); | ||
58 | for (i = start; i < priv->hw_params.max_stations; i++) | ||
59 | if (priv->stations[i].used && | ||
60 | (!compare_ether_addr(priv->stations[i].sta.sta.addr, | ||
61 | addr))) { | ||
62 | ret = i; | ||
63 | goto out; | ||
64 | } | ||
65 | |||
66 | IWL_DEBUG_ASSOC_LIMIT("can not find STA %s total %d\n", | ||
67 | print_mac(mac, addr), priv->num_stations); | ||
68 | |||
69 | out: | ||
70 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
71 | return ret; | ||
72 | } | ||
73 | EXPORT_SYMBOL(iwl_find_station); | ||
74 | |||
75 | |||
41 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv) | 76 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv) |
42 | { | 77 | { |
43 | int i; | 78 | int i; |