aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-04-30 14:30:46 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-05-10 18:09:06 -0400
commit619753ff57a2e15b58546b856536928d1a3daef9 (patch)
tree74a1b5ecc40adc80e8620da8e040c6733da812fa /drivers
parent2a87c26bbe9587baeb9e56d3ce0b4971bd777643 (diff)
iwlagn: use iwl_sta_id() for aggregation
With the station ID being stored in the station struct, which mac80211 gives us for aggregation callbacks, we can also remove the use of iwl_find_station() in those code paths. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.h7
5 files changed, 25 insertions, 28 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 89c85d1043ba..c402bfc83f36 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -962,7 +962,7 @@ static int iwlagn_txq_ctx_activate_free(struct iwl_priv *priv)
962} 962}
963 963
964int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, 964int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
965 const u8 *ra, u16 tid, u16 *ssn) 965 struct ieee80211_sta *sta, u16 tid, u16 *ssn)
966{ 966{
967 int sta_id; 967 int sta_id;
968 int tx_fifo; 968 int tx_fifo;
@@ -976,9 +976,9 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
976 return tx_fifo; 976 return tx_fifo;
977 977
978 IWL_WARN(priv, "%s on ra = %pM tid = %d\n", 978 IWL_WARN(priv, "%s on ra = %pM tid = %d\n",
979 __func__, ra, tid); 979 __func__, sta->addr, tid);
980 980
981 sta_id = iwl_find_station(priv, ra); 981 sta_id = iwl_sta_id(sta);
982 if (sta_id == IWL_INVALID_STATION) { 982 if (sta_id == IWL_INVALID_STATION) {
983 IWL_ERR(priv, "Start AGG on invalid station\n"); 983 IWL_ERR(priv, "Start AGG on invalid station\n");
984 return -ENXIO; 984 return -ENXIO;
@@ -1012,7 +1012,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
1012 if (tid_data->tfds_in_queue == 0) { 1012 if (tid_data->tfds_in_queue == 0) {
1013 IWL_DEBUG_HT(priv, "HW queue is empty\n"); 1013 IWL_DEBUG_HT(priv, "HW queue is empty\n");
1014 tid_data->agg.state = IWL_AGG_ON; 1014 tid_data->agg.state = IWL_AGG_ON;
1015 ieee80211_start_tx_ba_cb_irqsafe(vif, ra, tid); 1015 ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
1016 } else { 1016 } else {
1017 IWL_DEBUG_HT(priv, "HW queue is NOT empty: %d packets in HW queue\n", 1017 IWL_DEBUG_HT(priv, "HW queue is NOT empty: %d packets in HW queue\n",
1018 tid_data->tfds_in_queue); 1018 tid_data->tfds_in_queue);
@@ -1022,23 +1022,18 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
1022} 1022}
1023 1023
1024int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, 1024int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
1025 const u8 *ra, u16 tid) 1025 struct ieee80211_sta *sta, u16 tid)
1026{ 1026{
1027 int tx_fifo_id, txq_id, sta_id, ssn = -1; 1027 int tx_fifo_id, txq_id, sta_id, ssn = -1;
1028 struct iwl_tid_data *tid_data; 1028 struct iwl_tid_data *tid_data;
1029 int write_ptr, read_ptr; 1029 int write_ptr, read_ptr;
1030 unsigned long flags; 1030 unsigned long flags;
1031 1031
1032 if (!ra) {
1033 IWL_ERR(priv, "ra = NULL\n");
1034 return -EINVAL;
1035 }
1036
1037 tx_fifo_id = get_fifo_from_tid(tid); 1032 tx_fifo_id = get_fifo_from_tid(tid);
1038 if (unlikely(tx_fifo_id < 0)) 1033 if (unlikely(tx_fifo_id < 0))
1039 return tx_fifo_id; 1034 return tx_fifo_id;
1040 1035
1041 sta_id = iwl_find_station(priv, ra); 1036 sta_id = iwl_sta_id(sta);
1042 1037
1043 if (sta_id == IWL_INVALID_STATION) { 1038 if (sta_id == IWL_INVALID_STATION) {
1044 IWL_ERR(priv, "Invalid station for AGG tid %d\n", tid); 1039 IWL_ERR(priv, "Invalid station for AGG tid %d\n", tid);
@@ -1048,7 +1043,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
1048 if (priv->stations[sta_id].tid[tid].agg.state == 1043 if (priv->stations[sta_id].tid[tid].agg.state ==
1049 IWL_EMPTYING_HW_QUEUE_ADDBA) { 1044 IWL_EMPTYING_HW_QUEUE_ADDBA) {
1050 IWL_DEBUG_HT(priv, "AGG stop before setup done\n"); 1045 IWL_DEBUG_HT(priv, "AGG stop before setup done\n");
1051 ieee80211_stop_tx_ba_cb_irqsafe(vif, ra, tid); 1046 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
1052 priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF; 1047 priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF;
1053 return 0; 1048 return 0;
1054 } 1049 }
@@ -1085,7 +1080,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
1085 tx_fifo_id); 1080 tx_fifo_id);
1086 spin_unlock_irqrestore(&priv->lock, flags); 1081 spin_unlock_irqrestore(&priv->lock, flags);
1087 1082
1088 ieee80211_stop_tx_ba_cb_irqsafe(vif, ra, tid); 1083 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
1089 1084
1090 return 0; 1085 return 0;
1091} 1086}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8a4b83073540..3265b637db2e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3154,17 +3154,17 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
3154 switch (action) { 3154 switch (action) {
3155 case IEEE80211_AMPDU_RX_START: 3155 case IEEE80211_AMPDU_RX_START:
3156 IWL_DEBUG_HT(priv, "start Rx\n"); 3156 IWL_DEBUG_HT(priv, "start Rx\n");
3157 return iwl_sta_rx_agg_start(priv, sta->addr, tid, *ssn); 3157 return iwl_sta_rx_agg_start(priv, sta, tid, *ssn);
3158 case IEEE80211_AMPDU_RX_STOP: 3158 case IEEE80211_AMPDU_RX_STOP:
3159 IWL_DEBUG_HT(priv, "stop Rx\n"); 3159 IWL_DEBUG_HT(priv, "stop Rx\n");
3160 ret = iwl_sta_rx_agg_stop(priv, sta->addr, tid); 3160 ret = iwl_sta_rx_agg_stop(priv, sta, tid);
3161 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 3161 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
3162 return 0; 3162 return 0;
3163 else 3163 else
3164 return ret; 3164 return ret;
3165 case IEEE80211_AMPDU_TX_START: 3165 case IEEE80211_AMPDU_TX_START:
3166 IWL_DEBUG_HT(priv, "start Tx\n"); 3166 IWL_DEBUG_HT(priv, "start Tx\n");
3167 ret = iwlagn_tx_agg_start(priv, vif, sta->addr, tid, ssn); 3167 ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
3168 if (ret == 0) { 3168 if (ret == 0) {
3169 priv->_agn.agg_tids_count++; 3169 priv->_agn.agg_tids_count++;
3170 IWL_DEBUG_HT(priv, "priv->_agn.agg_tids_count = %u\n", 3170 IWL_DEBUG_HT(priv, "priv->_agn.agg_tids_count = %u\n",
@@ -3173,7 +3173,7 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
3173 return ret; 3173 return ret;
3174 case IEEE80211_AMPDU_TX_STOP: 3174 case IEEE80211_AMPDU_TX_STOP:
3175 IWL_DEBUG_HT(priv, "stop Tx\n"); 3175 IWL_DEBUG_HT(priv, "stop Tx\n");
3176 ret = iwlagn_tx_agg_stop(priv, vif, sta->addr, tid); 3176 ret = iwlagn_tx_agg_stop(priv, vif, sta, tid);
3177 if ((ret == 0) && (priv->_agn.agg_tids_count > 0)) { 3177 if ((ret == 0) && (priv->_agn.agg_tids_count > 0)) {
3178 priv->_agn.agg_tids_count--; 3178 priv->_agn.agg_tids_count--;
3179 IWL_DEBUG_HT(priv, "priv->_agn.agg_tids_count = %u\n", 3179 IWL_DEBUG_HT(priv, "priv->_agn.agg_tids_count = %u\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index c4417739a64c..2d748053358e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -136,9 +136,9 @@ void iwlagn_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags,
136 struct ieee80211_tx_info *info); 136 struct ieee80211_tx_info *info);
137int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb); 137int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb);
138int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, 138int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
139 const u8 *ra, u16 tid, u16 *ssn); 139 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
140int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, 140int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
141 const u8 *ra, u16 tid); 141 struct ieee80211_sta *sta, u16 tid);
142int iwlagn_txq_check_empty(struct iwl_priv *priv, 142int iwlagn_txq_check_empty(struct iwl_priv *priv,
143 int sta_id, u8 tid, int txq_id); 143 int sta_id, u8 tid, int txq_id);
144void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, 144void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 4be7940ad566..8fec0263f016 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -1324,13 +1324,13 @@ void iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid)
1324} 1324}
1325EXPORT_SYMBOL(iwl_sta_tx_modify_enable_tid); 1325EXPORT_SYMBOL(iwl_sta_tx_modify_enable_tid);
1326 1326
1327int iwl_sta_rx_agg_start(struct iwl_priv *priv, 1327int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
1328 const u8 *addr, int tid, u16 ssn) 1328 int tid, u16 ssn)
1329{ 1329{
1330 unsigned long flags; 1330 unsigned long flags;
1331 int sta_id; 1331 int sta_id;
1332 1332
1333 sta_id = iwl_find_station(priv, addr); 1333 sta_id = iwl_sta_id(sta);
1334 if (sta_id == IWL_INVALID_STATION) 1334 if (sta_id == IWL_INVALID_STATION)
1335 return -ENXIO; 1335 return -ENXIO;
1336 1336
@@ -1343,16 +1343,17 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv,
1343 spin_unlock_irqrestore(&priv->sta_lock, flags); 1343 spin_unlock_irqrestore(&priv->sta_lock, flags);
1344 1344
1345 return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, 1345 return iwl_send_add_sta(priv, &priv->stations[sta_id].sta,
1346 CMD_ASYNC); 1346 CMD_ASYNC);
1347} 1347}
1348EXPORT_SYMBOL(iwl_sta_rx_agg_start); 1348EXPORT_SYMBOL(iwl_sta_rx_agg_start);
1349 1349
1350int iwl_sta_rx_agg_stop(struct iwl_priv *priv, const u8 *addr, int tid) 1350int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
1351 int tid)
1351{ 1352{
1352 unsigned long flags; 1353 unsigned long flags;
1353 int sta_id; 1354 int sta_id;
1354 1355
1355 sta_id = iwl_find_station(priv, addr); 1356 sta_id = iwl_sta_id(sta);
1356 if (sta_id == IWL_INVALID_STATION) { 1357 if (sta_id == IWL_INVALID_STATION) {
1357 IWL_ERR(priv, "Invalid station for AGG tid %d\n", tid); 1358 IWL_ERR(priv, "Invalid station for AGG tid %d\n", tid);
1358 return -ENXIO; 1359 return -ENXIO;
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index 646f644974ca..d0ab3f8f7c0f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -80,9 +80,10 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id,
80int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 80int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
81 struct ieee80211_sta *sta); 81 struct ieee80211_sta *sta);
82void iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid); 82void iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid);
83int iwl_sta_rx_agg_start(struct iwl_priv *priv, 83int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
84 const u8 *addr, int tid, u16 ssn); 84 int tid, u16 ssn);
85int iwl_sta_rx_agg_stop(struct iwl_priv *priv, const u8 *addr, int tid); 85int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
86 int tid);
86void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id); 87void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id);
87void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); 88void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt);
88 89