Skip to content

Commit

Permalink
mac80211: use offchannel queue only when supported
Browse files Browse the repository at this point in the history
Commit 3a25a8c ("mac80211: add improved HW queue control")
added support for offchannel queue mapping. However, this
mapping is only valid when the driver supports
IEEE80211_HW_QUEUE_CONTROL.

Check whether the driver supports IEEE80211_HW_QUEUE_CONTROL
before setting the hw_queue to the mapped offchannel queue.

(This patch doesn't have any actual effect, because
hw_queue is overridden in ieee80211_tx() anyway,
so this is merely some cleanup)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
elp authored and linvjw committed Jun 5, 2012
1 parent 72d7872 commit c53f7e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,8 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,

IEEE80211_SKB_CB(skb)->flags = flags;

if (flags & IEEE80211_TX_CTL_TX_OFFCHAN)
if (local->hw.flags & IEEE80211_HW_QUEUE_CONTROL &&
flags & IEEE80211_TX_CTL_TX_OFFCHAN)
IEEE80211_SKB_CB(skb)->hw_queue =
local->hw.offchannel_tx_hw_queue;

Expand Down Expand Up @@ -2349,8 +2350,9 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
/* modify cookie to prevent API mismatches */
*cookie ^= 2;
IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN;
IEEE80211_SKB_CB(skb)->hw_queue =
local->hw.offchannel_tx_hw_queue;
if (local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)
IEEE80211_SKB_CB(skb)->hw_queue =
local->hw.offchannel_tx_hw_queue;
local->hw_roc_skb = skb;
local->hw_roc_skb_for_status = skb;
mutex_unlock(&local->mtx);
Expand Down

0 comments on commit c53f7e1

Please sign in to comment.