aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/agg-tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/agg-tx.c')
-rw-r--r--net/mac80211/agg-tx.c86
1 files changed, 41 insertions, 45 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index b064e4df12c..2e4b961648d 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -303,6 +303,38 @@ ieee80211_wake_queue_agg(struct ieee80211_local *local, int tid)
303 __release(agg_queue); 303 __release(agg_queue);
304} 304}
305 305
306/*
307 * splice packets from the STA's pending to the local pending,
308 * requires a call to ieee80211_agg_splice_finish later
309 */
310static void __acquires(agg_queue)
311ieee80211_agg_splice_packets(struct ieee80211_local *local,
312 struct tid_ampdu_tx *tid_tx, u16 tid)
313{
314 int queue = ieee80211_ac_from_tid(tid);
315 unsigned long flags;
316
317 ieee80211_stop_queue_agg(local, tid);
318
319 if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates"
320 " from the pending queue\n", tid))
321 return;
322
323 if (!skb_queue_empty(&tid_tx->pending)) {
324 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
325 /* copy over remaining packets */
326 skb_queue_splice_tail_init(&tid_tx->pending,
327 &local->pending[queue]);
328 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
329 }
330}
331
332static void __releases(agg_queue)
333ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid)
334{
335 ieee80211_wake_queue_agg(local, tid);
336}
337
306void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) 338void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
307{ 339{
308 struct tid_ampdu_tx *tid_tx; 340 struct tid_ampdu_tx *tid_tx;
@@ -314,19 +346,17 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
314 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 346 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
315 347
316 /* 348 /*
317 * While we're asking the driver about the aggregation, 349 * Start queuing up packets for this aggregation session.
318 * stop the AC queue so that we don't have to worry 350 * We're going to release them once the driver is OK with
319 * about frames that came in while we were doing that, 351 * that.
320 * which would require us to put them to the AC pending
321 * afterwards which just makes the code more complex.
322 */ 352 */
323 ieee80211_stop_queue_agg(local, tid);
324
325 clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); 353 clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state);
326 354
327 /* 355 /*
328 * make sure no packets are being processed to get 356 * Make sure no packets are being processed. This ensures that
329 * valid starting sequence number 357 * we have a valid starting sequence number and that in-flight
358 * packets have been flushed out and no packets for this TID
359 * will go into the driver during the ampdu_action call.
330 */ 360 */
331 synchronize_net(); 361 synchronize_net();
332 362
@@ -340,17 +370,15 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
340 " tid %d\n", tid); 370 " tid %d\n", tid);
341#endif 371#endif
342 spin_lock_bh(&sta->lock); 372 spin_lock_bh(&sta->lock);
373 ieee80211_agg_splice_packets(local, tid_tx, tid);
343 ieee80211_assign_tid_tx(sta, tid, NULL); 374 ieee80211_assign_tid_tx(sta, tid, NULL);
375 ieee80211_agg_splice_finish(local, tid);
344 spin_unlock_bh(&sta->lock); 376 spin_unlock_bh(&sta->lock);
345 377
346 ieee80211_wake_queue_agg(local, tid);
347 kfree_rcu(tid_tx, rcu_head); 378 kfree_rcu(tid_tx, rcu_head);
348 return; 379 return;
349 } 380 }
350 381
351 /* we can take packets again now */
352 ieee80211_wake_queue_agg(local, tid);
353
354 /* activate the timer for the recipient's addBA response */ 382 /* activate the timer for the recipient's addBA response */
355 mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); 383 mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
356#ifdef CONFIG_MAC80211_HT_DEBUG 384#ifdef CONFIG_MAC80211_HT_DEBUG
@@ -466,38 +494,6 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
466} 494}
467EXPORT_SYMBOL(ieee80211_start_tx_ba_session); 495EXPORT_SYMBOL(ieee80211_start_tx_ba_session);
468 496
469/*
470 * splice packets from the STA's pending to the local pending,
471 * requires a call to ieee80211_agg_splice_finish later
472 */
473static void __acquires(agg_queue)
474ieee80211_agg_splice_packets(struct ieee80211_local *local,
475 struct tid_ampdu_tx *tid_tx, u16 tid)
476{
477 int queue = ieee80211_ac_from_tid(tid);
478 unsigned long flags;
479
480 ieee80211_stop_queue_agg(local, tid);
481
482 if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates"
483 " from the pending queue\n", tid))
484 return;
485
486 if (!skb_queue_empty(&tid_tx->pending)) {
487 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
488 /* copy over remaining packets */
489 skb_queue_splice_tail_init(&tid_tx->pending,
490 &local->pending[queue]);
491 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
492 }
493}
494
495static void __releases(agg_queue)
496ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid)
497{
498 ieee80211_wake_queue_agg(local, tid);
499}
500
501static void ieee80211_agg_tx_operational(struct ieee80211_local *local, 497static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
502 struct sta_info *sta, u16 tid) 498 struct sta_info *sta, u16 tid)
503{ 499{