* [PATCH] mac80211: use offchannel queue only when supported
@ 2012-05-13 13:47 Eliad Peller
2012-05-29 7:17 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2012-05-13 13:47 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
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>
---
net/mac80211/cfg.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 6a82ae3..6b60593 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2303,7 +2303,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;
@@ -2348,8 +2349,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);
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mac80211: use offchannel queue only when supported
2012-05-13 13:47 [PATCH] mac80211: use offchannel queue only when supported Eliad Peller
@ 2012-05-29 7:17 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-05-29 7:17 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Sun, 2012-05-13 at 16:47 +0300, Eliad Peller wrote:
> 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>
> ---
> net/mac80211/cfg.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 6a82ae3..6b60593 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -2303,7 +2303,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;
>
> @@ -2348,8 +2349,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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-29 7:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-13 13:47 [PATCH] mac80211: use offchannel queue only when supported Eliad Peller
2012-05-29 7:17 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).