]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
iwlwifi: move find station to iwl-sta.c
authorTomas Winkler <tomas.winkler@intel.com>
Wed, 16 Apr 2008 23:34:48 +0000 (16:34 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 May 2008 19:02:10 +0000 (15:02 -0400)
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>
drivers/net/wireless/iwlwifi/iwl-4965-rs.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-4965.h
drivers/net/wireless/iwlwifi/iwl-sta.c
drivers/net/wireless/iwlwifi/iwl4965-base.c

index b608e1ca8b4062fdd101a7c56d2868bcce7cd9a6..557912af1ff6d285cf21b0bceff80f50d64b7f7c 100644 (file)
@@ -2190,7 +2190,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
 
        if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
            !lq_sta->ibss_sta_added) {
-               u8 sta_id = iwl4965_hw_find_station(priv, hdr->addr1);
+               u8 sta_id = iwl_find_station(priv, hdr->addr1);
                DECLARE_MAC_BUF(mac);
 
                if (sta_id == IWL_INVALID_STATION) {
@@ -2268,7 +2268,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 
        lq_sta->ibss_sta_added = 0;
        if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
-               u8 sta_id = iwl4965_hw_find_station(priv, sta->addr);
+               u8 sta_id = iwl_find_station(priv, sta->addr);
                DECLARE_MAC_BUF(mac);
 
                /* for IBSS the call are from tasklet */
index be4cc5ffa742dc4f66c582fc62a7452e2fe1a623..f318c50a1a8f16e80705f583ac7413d406c7b34e 100644 (file)
@@ -492,38 +492,6 @@ int iwl4965_hw_rxq_stop(struct iwl_priv *priv)
        return 0;
 }
 
-u8 iwl4965_hw_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;
-}
-
 static int iwl4965_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
 {
        int ret;
@@ -3125,7 +3093,7 @@ static void iwl4965_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id)
 static void iwl4965_update_ps_mode(struct iwl_priv *priv, u16 ps_bit, u8 *addr)
 {
        /* FIXME: need locking over ps_status ??? */
-       u8 sta_id = iwl4965_hw_find_station(priv, addr);
+       u8 sta_id = iwl_find_station(priv, addr);
 
        if (sta_id != IWL_INVALID_STATION) {
                u8 sta_awake = priv->stations[sta_id].
@@ -4112,7 +4080,7 @@ static int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, const u8 *da,
        IWL_WARNING("%s on da = %s tid = %d\n",
                        __func__, print_mac(mac, da), tid);
 
-       sta_id = iwl4965_hw_find_station(priv, da);
+       sta_id = iwl_find_station(priv, da);
        if (sta_id == IWL_INVALID_STATION)
                return -ENXIO;
 
@@ -4171,7 +4139,7 @@ static int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, const u8 *da,
        else
                return -EINVAL;
 
-       sta_id = iwl4965_hw_find_station(priv, da);
+       sta_id = iwl_find_station(priv, da);
 
        if (sta_id == IWL_INVALID_STATION)
                return -ENXIO;
@@ -4221,7 +4189,7 @@ int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
 
        IWL_DEBUG_HT("A-MPDU action on da=%s tid=%d ",
                        print_mac(mac, addr), tid);
-       sta_id = iwl4965_hw_find_station(priv, addr);
+       sta_id = iwl_find_station(priv, addr);
        switch (action) {
        case IEEE80211_AMPDU_RX_START:
                IWL_DEBUG_HT("start Rx\n");
index d728dd837e979b7e43e1faf0fc4737f238d1c79e..b51243f46938c15fd08fc1851005e88ffcbb9b60 100644 (file)
@@ -733,14 +733,14 @@ extern void iwl4965_disable_events(struct iwl_priv *priv);
 extern int iwl4965_get_temperature(const struct iwl_priv *priv);
 
 /**
- * iwl4965_hw_find_station - Find station id for a given BSSID
+ * iwl_find_station - Find station id for a given BSSID
  * @bssid: MAC address of station ID to find
  *
  * NOTE:  This should not be hardware specific but the code has
  * not yet been merged into a single common layer for managing the
  * station tables.
  */
-extern u8 iwl4965_hw_find_station(struct iwl_priv *priv, const u8 *bssid);
+extern u8 iwl_find_station(struct iwl_priv *priv, const u8 *bssid);
 
 extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel);
 extern int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index);
index e4fdfaa2b9b2e89275a7b9adbf1ff6aa9af55a6d..fa463ce6399bd059e0a78820e49aebf11b513966 100644 (file)
@@ -28,6 +28,7 @@
  *****************************************************************************/
 
 #include <net/mac80211.h>
+#include <linux/etherdevice.h>
 
 #include "iwl-eeprom.h"
 #include "iwl-4965.h"
 #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;
index 8a68ff4323dee7afa578c2a1e9d0d12f2f96a959..c8cbf70600da0db0f10cda38d165d5cf7a5f50b8 100644 (file)
@@ -2076,7 +2076,7 @@ static int iwl4965_get_sta_id(struct iwl_priv *priv,
 
        /* If we are an AP, then find the station, or use BCAST */
        case IEEE80211_IF_TYPE_AP:
-               sta_id = iwl4965_hw_find_station(priv, hdr->addr1);
+               sta_id = iwl_find_station(priv, hdr->addr1);
                if (sta_id != IWL_INVALID_STATION)
                        return sta_id;
                return priv->hw_params.bcast_sta_id;
@@ -2084,7 +2084,7 @@ static int iwl4965_get_sta_id(struct iwl_priv *priv,
        /* If this frame is going out to an IBSS network, find the station,
         * or create a new station table entry */
        case IEEE80211_IF_TYPE_IBSS:
-               sta_id = iwl4965_hw_find_station(priv, hdr->addr1);
+               sta_id = iwl_find_station(priv, hdr->addr1);
                if (sta_id != IWL_INVALID_STATION)
                        return sta_id;
 
@@ -2778,7 +2778,7 @@ static inline int iwl4965_get_ra_sta_id(struct iwl_priv *priv,
                return IWL_AP_ID;
        else {
                u8 *da = ieee80211_get_DA(hdr);
-               return iwl4965_hw_find_station(priv, da);
+               return iwl_find_station(priv, da);
        }
 }
 
@@ -6768,7 +6768,7 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
 
        IWL_DEBUG_MAC80211("enter\n");
 
-       sta_id = iwl4965_hw_find_station(priv, addr);
+       sta_id = iwl_find_station(priv, addr);
        if (sta_id == IWL_INVALID_STATION) {
                IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
                                   print_mac(mac, addr));
@@ -6824,7 +6824,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                /* only support pairwise keys */
                return -EOPNOTSUPP;
 
-       sta_id = iwl4965_hw_find_station(priv, addr);
+       sta_id = iwl_find_station(priv, addr);
        if (sta_id == IWL_INVALID_STATION) {
                IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
                                   print_mac(mac, addr));