aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-04-30 14:30:45 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-05-10 18:09:05 -0400
commit2a87c26bbe9587baeb9e56d3ce0b4971bd777643 (patch)
tree1c04fc0eebe00cf3ffe6219f3b6d195f3cfae05a /drivers/net/wireless/iwlwifi/iwl-sta.c
parent64ba9a54c60990416c4098c63792c37d8fccb9e1 (diff)
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.c56
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)
1307EXPORT_SYMBOL_GPL(iwl_dealloc_bcast_station); 1307EXPORT_SYMBOL_GPL(iwl_dealloc_bcast_station);
1308 1308
1309/** 1309/**
1310 * iwl_get_sta_id - Find station's index within station table
1311 *
1312 * If new IBSS station, create new entry in station table
1313 */
1314int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
1315{
1316 int sta_id;
1317 __le16 fc = hdr->frame_control;
1318
1319 /* If this frame is broadcast or management, use broadcast station id */
1320 if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1))
1321 return priv->hw_params.bcast_sta_id;
1322
1323 switch (priv->iw_mode) {
1324
1325 /* If we are a client station in a BSS network, use the special
1326 * AP station entry (that's the only station we communicate with) */
1327 case NL80211_IFTYPE_STATION:
1328 /*
1329 * If addition of station not complete yet, which means
1330 * that rate scaling has not been initialized, then return
1331 * the broadcast station.
1332 */
1333 if (!(priv->stations[IWL_AP_ID].used & IWL_STA_UCODE_ACTIVE))
1334 return priv->hw_params.bcast_sta_id;
1335 return IWL_AP_ID;
1336
1337 /* If we are an AP, then find the station, or use BCAST */
1338 case NL80211_IFTYPE_AP:
1339 sta_id = iwl_find_station(priv, hdr->addr1);
1340 if (sta_id != IWL_INVALID_STATION)
1341 return sta_id;
1342 return priv->hw_params.bcast_sta_id;
1343
1344 /* If this frame is going out to an IBSS network, find the station,
1345 * or create a new station table entry */
1346 case NL80211_IFTYPE_ADHOC:
1347 sta_id = iwl_find_station(priv, hdr->addr1);
1348 if (sta_id != IWL_INVALID_STATION)
1349 return sta_id;
1350
1351 IWL_DEBUG_DROP(priv, "Station %pM not in station map. "
1352 "Defaulting to broadcast...\n",
1353 hdr->addr1);
1354 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
1355 return priv->hw_params.bcast_sta_id;
1356
1357 default:
1358 IWL_WARN(priv, "Unknown mode of operation: %d\n",
1359 priv->iw_mode);
1360 return priv->hw_params.bcast_sta_id;
1361 }
1362}
1363EXPORT_SYMBOL(iwl_get_sta_id);
1364
1365/**
1366 * iwl_sta_tx_modify_enable_tid - Enable Tx for this TID in station table 1310 * iwl_sta_tx_modify_enable_tid - Enable Tx for this TID in station table
1367 */ 1311 */
1368void iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid) 1312void iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid)