diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-04-30 20:30:45 +0200 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-11 00:09:05 +0200 |
commit | 2a87c26bbe9587baeb9e56d3ce0b4971bd777643 (patch) | |
tree | 1c04fc0eebe00cf3ffe6219f3b6d195f3cfae05a /drivers/net/wireless/iwlwifi/iwl-sta.c | |
parent | iwlwifi: add iwl_sta_id() (diff) | |
download | linux-2a87c26bbe9587baeb9e56d3ce0b4971bd777643.tar.xz linux-2a87c26bbe9587baeb9e56d3ce0b4971bd777643.zip |
iwlwifi: use iwl_find_station less
Since we now store the station ID in each station
struct, many places need not look at the station
table any more since they can just pull the station
ID out of the struct. Remove iwl_get_sta_id() and
use iwl_sta_id() instead as appropriate.
This reduces the amount of code needed to find the
right station significantly, and works since
mac80211 passes the station only after it has been
fully initialised, ie. even if TX races with
station addition it will only be passed to TX once
the addition is complete.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index d1986dedc863..4be7940ad566 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -1307,62 +1307,6 @@ void iwl_dealloc_bcast_station(struct iwl_priv *priv) EXPORT_SYMBOL_GPL(iwl_dealloc_bcast_station); /** - * iwl_get_sta_id - Find station's index within station table - * - * If new IBSS station, create new entry in station table - */ -int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr) -{ - int sta_id; - __le16 fc = hdr->frame_control; - - /* If this frame is broadcast or management, use broadcast station id */ - if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) - return priv->hw_params.bcast_sta_id; - - switch (priv->iw_mode) { - - /* If we are a client station in a BSS network, use the special - * AP station entry (that's the only station we communicate with) */ - case NL80211_IFTYPE_STATION: - /* - * If addition of station not complete yet, which means - * that rate scaling has not been initialized, then return - * the broadcast station. - */ - if (!(priv->stations[IWL_AP_ID].used & IWL_STA_UCODE_ACTIVE)) - return priv->hw_params.bcast_sta_id; - return IWL_AP_ID; - - /* If we are an AP, then find the station, or use BCAST */ - case NL80211_IFTYPE_AP: - sta_id = iwl_find_station(priv, hdr->addr1); - if (sta_id != IWL_INVALID_STATION) - return sta_id; - return priv->hw_params.bcast_sta_id; - - /* If this frame is going out to an IBSS network, find the station, - * or create a new station table entry */ - case NL80211_IFTYPE_ADHOC: - sta_id = iwl_find_station(priv, hdr->addr1); - if (sta_id != IWL_INVALID_STATION) - return sta_id; - - IWL_DEBUG_DROP(priv, "Station %pM not in station map. " - "Defaulting to broadcast...\n", - hdr->addr1); - iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); - return priv->hw_params.bcast_sta_id; - - default: - IWL_WARN(priv, "Unknown mode of operation: %d\n", - priv->iw_mode); - return priv->hw_params.bcast_sta_id; - } -} -EXPORT_SYMBOL(iwl_get_sta_id); - -/** * iwl_sta_tx_modify_enable_tid - Enable Tx for this TID in station table */ void iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid) |