aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2010-11-06 09:07:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:26:12 -0500
commit041fb8f504fb0a6b61bc2131679da554b2fa8c9d (patch)
treee1c4553b0432c145085d5a4fa4a93a4a6427372a
parentffa56e540c3949c4560dcce45eca247819e183c1 (diff)
carl9170: tx path review
This patch fixes a few shortcomings in the tx path. * move temp. ampdu_[ack]_len out of txinfo->pad. * fix WARN_ON from tx.c:line 300 when tx_ampdu_queue fails to queue the frame. * In tx_prepare, we already have a local pointer to the station's ieee80211_sta struct. * remove a second !sta check, tx_prepare already takes care of that. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/carl9170/tx.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index b27969c41812..688eede48516 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -242,9 +242,11 @@ static void carl9170_tx_release(struct kref *ref)
242 ar->tx_ampdu_schedule = true; 242 ar->tx_ampdu_schedule = true;
243 243
244 if (txinfo->flags & IEEE80211_TX_STAT_AMPDU) { 244 if (txinfo->flags & IEEE80211_TX_STAT_AMPDU) {
245 txinfo->status.ampdu_len = txinfo->pad[0]; 245 struct _carl9170_tx_superframe *super;
246 txinfo->status.ampdu_ack_len = txinfo->pad[1]; 246
247 txinfo->pad[0] = txinfo->pad[1] = 0; 247 super = (void *)skb->data;
248 txinfo->status.ampdu_len = super->s.rix;
249 txinfo->status.ampdu_ack_len = super->s.cnt;
248 } else if (txinfo->flags & IEEE80211_TX_STAT_ACK) { 250 } else if (txinfo->flags & IEEE80211_TX_STAT_ACK) {
249 /* 251 /*
250 * drop redundant tx_status reports: 252 * drop redundant tx_status reports:
@@ -337,7 +339,8 @@ static void carl9170_tx_status_process_ampdu(struct ar9170 *ar,
337 u8 tid; 339 u8 tid;
338 340
339 if (!(txinfo->flags & IEEE80211_TX_CTL_AMPDU) || 341 if (!(txinfo->flags & IEEE80211_TX_CTL_AMPDU) ||
340 txinfo->flags & IEEE80211_TX_CTL_INJECTED) 342 txinfo->flags & IEEE80211_TX_CTL_INJECTED ||
343 (!(super->f.mac_control & cpu_to_le16(AR9170_TX_MAC_AGGR))))
341 return; 344 return;
342 345
343 tx_info = IEEE80211_SKB_CB(skb); 346 tx_info = IEEE80211_SKB_CB(skb);
@@ -389,8 +392,8 @@ static void carl9170_tx_status_process_ampdu(struct ar9170 *ar,
389 sta_info->stats[tid].ampdu_ack_len++; 392 sta_info->stats[tid].ampdu_ack_len++;
390 393
391 if (super->f.mac_control & cpu_to_le16(AR9170_TX_MAC_IMM_BA)) { 394 if (super->f.mac_control & cpu_to_le16(AR9170_TX_MAC_IMM_BA)) {
392 txinfo->pad[0] = sta_info->stats[tid].ampdu_len; 395 super->s.rix = sta_info->stats[tid].ampdu_len;
393 txinfo->pad[1] = sta_info->stats[tid].ampdu_ack_len; 396 super->s.cnt = sta_info->stats[tid].ampdu_ack_len;
394 txinfo->flags |= IEEE80211_TX_STAT_AMPDU; 397 txinfo->flags |= IEEE80211_TX_STAT_AMPDU;
395 sta_info->stats[tid].clear = true; 398 sta_info->stats[tid].clear = true;
396 } 399 }
@@ -896,10 +899,8 @@ static int carl9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb)
896 if (unlikely(!sta || !cvif)) 899 if (unlikely(!sta || !cvif))
897 goto err_out; 900 goto err_out;
898 901
899 factor = min_t(unsigned int, 1u, 902 factor = min_t(unsigned int, 1u, sta->ht_cap.ampdu_factor);
900 info->control.sta->ht_cap.ampdu_factor); 903 density = sta->ht_cap.ampdu_density;
901
902 density = info->control.sta->ht_cap.ampdu_density;
903 904
904 if (density) { 905 if (density) {
905 /* 906 /*
@@ -1260,6 +1261,7 @@ static void carl9170_tx(struct ar9170 *ar)
1260static bool carl9170_tx_ampdu_queue(struct ar9170 *ar, 1261static bool carl9170_tx_ampdu_queue(struct ar9170 *ar,
1261 struct ieee80211_sta *sta, struct sk_buff *skb) 1262 struct ieee80211_sta *sta, struct sk_buff *skb)
1262{ 1263{
1264 struct _carl9170_tx_superframe *super = (void *) super;
1263 struct carl9170_sta_info *sta_info; 1265 struct carl9170_sta_info *sta_info;
1264 struct carl9170_sta_tid *agg; 1266 struct carl9170_sta_tid *agg;
1265 struct sk_buff *iter; 1267 struct sk_buff *iter;
@@ -1328,6 +1330,7 @@ err_unlock:
1328 1330
1329err_unlock_rcu: 1331err_unlock_rcu:
1330 rcu_read_unlock(); 1332 rcu_read_unlock();
1333 super->f.mac_control &= ~cpu_to_le16(AR9170_TX_MAC_AGGR);
1331 carl9170_tx_status(ar, skb, false); 1334 carl9170_tx_status(ar, skb, false);
1332 ar->tx_dropped++; 1335 ar->tx_dropped++;
1333 return false; 1336 return false;
@@ -1356,9 +1359,6 @@ int carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1356 */ 1359 */
1357 1360
1358 if (info->flags & IEEE80211_TX_CTL_AMPDU) { 1361 if (info->flags & IEEE80211_TX_CTL_AMPDU) {
1359 if (WARN_ON_ONCE(!sta))
1360 goto err_free;
1361
1362 run = carl9170_tx_ampdu_queue(ar, sta, skb); 1362 run = carl9170_tx_ampdu_queue(ar, sta, skb);
1363 if (run) 1363 if (run)
1364 carl9170_tx_ampdu(ar); 1364 carl9170_tx_ampdu(ar);