diff options
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 949d857debd8..66ce96a69f31 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -341,6 +341,52 @@ void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue) | |||
341 | } | 341 | } |
342 | EXPORT_SYMBOL(ieee80211_stop_queue); | 342 | EXPORT_SYMBOL(ieee80211_stop_queue); |
343 | 343 | ||
344 | void ieee80211_add_pending_skb(struct ieee80211_local *local, | ||
345 | struct sk_buff *skb) | ||
346 | { | ||
347 | struct ieee80211_hw *hw = &local->hw; | ||
348 | unsigned long flags; | ||
349 | int queue = skb_get_queue_mapping(skb); | ||
350 | |||
351 | spin_lock_irqsave(&local->queue_stop_reason_lock, flags); | ||
352 | __ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | ||
353 | __ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_PENDING); | ||
354 | skb_queue_tail(&local->pending[queue], skb); | ||
355 | __ieee80211_wake_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | ||
356 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | ||
357 | } | ||
358 | |||
359 | int ieee80211_add_pending_skbs(struct ieee80211_local *local, | ||
360 | struct sk_buff_head *skbs) | ||
361 | { | ||
362 | struct ieee80211_hw *hw = &local->hw; | ||
363 | struct sk_buff *skb; | ||
364 | unsigned long flags; | ||
365 | int queue, ret = 0, i; | ||
366 | |||
367 | spin_lock_irqsave(&local->queue_stop_reason_lock, flags); | ||
368 | for (i = 0; i < hw->queues; i++) | ||
369 | __ieee80211_stop_queue(hw, i, | ||
370 | IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | ||
371 | |||
372 | while ((skb = skb_dequeue(skbs))) { | ||
373 | ret++; | ||
374 | queue = skb_get_queue_mapping(skb); | ||
375 | skb_queue_tail(&local->pending[queue], skb); | ||
376 | } | ||
377 | |||
378 | for (i = 0; i < hw->queues; i++) { | ||
379 | if (ret) | ||
380 | __ieee80211_stop_queue(hw, i, | ||
381 | IEEE80211_QUEUE_STOP_REASON_PENDING); | ||
382 | __ieee80211_wake_queue(hw, i, | ||
383 | IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | ||
384 | } | ||
385 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | ||
386 | |||
387 | return ret; | ||
388 | } | ||
389 | |||
344 | void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, | 390 | void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, |
345 | enum queue_stop_reason reason) | 391 | enum queue_stop_reason reason) |
346 | { | 392 | { |
@@ -657,15 +703,15 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata) | |||
657 | 703 | ||
658 | switch (queue) { | 704 | switch (queue) { |
659 | case 3: /* AC_BK */ | 705 | case 3: /* AC_BK */ |
660 | qparam.cw_max = aCWmin; | 706 | qparam.cw_max = aCWmax; |
661 | qparam.cw_min = aCWmax; | 707 | qparam.cw_min = aCWmin; |
662 | qparam.txop = 0; | 708 | qparam.txop = 0; |
663 | qparam.aifs = 7; | 709 | qparam.aifs = 7; |
664 | break; | 710 | break; |
665 | default: /* never happens but let's not leave undefined */ | 711 | default: /* never happens but let's not leave undefined */ |
666 | case 2: /* AC_BE */ | 712 | case 2: /* AC_BE */ |
667 | qparam.cw_max = aCWmin; | 713 | qparam.cw_max = aCWmax; |
668 | qparam.cw_min = aCWmax; | 714 | qparam.cw_min = aCWmin; |
669 | qparam.txop = 0; | 715 | qparam.txop = 0; |
670 | qparam.aifs = 3; | 716 | qparam.aifs = 3; |
671 | break; | 717 | break; |
@@ -973,7 +1019,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
973 | if (local->open_count) { | 1019 | if (local->open_count) { |
974 | res = drv_start(local); | 1020 | res = drv_start(local); |
975 | 1021 | ||
976 | ieee80211_led_radio(local, hw->conf.radio_enabled); | 1022 | ieee80211_led_radio(local, true); |
977 | } | 1023 | } |
978 | 1024 | ||
979 | /* add interfaces */ | 1025 | /* add interfaces */ |