diff mbox

wireless: vlan priority handling in WMM

Message ID 1372174262-13526-1-git-send-email-cedric.voncken@acksys.fr (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

voncken June 25, 2013, 3:31 p.m. UTC
From: Cedric Voncken <cedric.voncken@acksys.fr>

If the VLAN priority is set in skb->vlan_tci use it to determine the WMM priority.

Signed-off-by: Cedric Voncken <cedric.voncken@acksys.fr>
---
 net/wireless/util.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Johannes Berg June 26, 2013, 7:33 a.m. UTC | #1
On Tue, 2013-06-25 at 17:31 +0200, cedric.voncken@acksys.fr wrote:
> From: Cedric Voncken <cedric.voncken@acksys.fr>
> 
> If the VLAN priority is set in skb->vlan_tci use it to determine the WMM priority.

What's the VLAN priority? How are you even running 802.1q on top of
wifi? heh.

> @@ -694,6 +695,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
>  	if (skb->priority >= 256 && skb->priority <= 263)
>  		return skb->priority - 256;
>  
> +	vlan_priority = (skb->vlan_tci >> 13) & 0x07;

Are there no symbolic constants for this?

> +		if (vlan_priority > 0)
> +			return vlan_priority;

I think you got indentation a bit confused :-)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
voncken June 26, 2013, 9:36 a.m. UTC | #2
>>On Tue, 2013-06-25 at 17:31 +0200, cedric.voncken@acksys.fr wrote:
>> From: Cedric Voncken <cedric.voncken@acksys.fr>
>> 
>> If the VLAN priority is set in skb->vlan_tci use it to determine the WMM priority.

>What's the VLAN priority? How are you even running 802.1q on top of wifi? heh.
I used the wireless as bridge (The wireless vif client is bridged with my eth0). The VLAN tag is already present in frame when I received it from eth0. The eth0 driver set the skb->vlan_tci. 

>> @@ -694,6 +695,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
>>  	if (skb->priority >= 256 && skb->priority <= 263)
>>  		return skb->priority - 256;
>>  
>> +	vlan_priority = (skb->vlan_tci >> 13) & 0x07;

>Are there no symbolic constants for this?
Fix in V2

>> +		if (vlan_priority > 0)
>> +			return vlan_priority;

>I think you got indentation a bit confused :-)
Sorry, it will fix in V2.

Cedric


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 74458b7..6f57ae7 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -685,6 +685,7 @@  EXPORT_SYMBOL(ieee80211_amsdu_to_8023s);
 unsigned int cfg80211_classify8021d(struct sk_buff *skb)
 {
 	unsigned int dscp;
+	unsigned char vlan_priority;
 
 	/* skb->priority values from 256->263 are magic values to
 	 * directly indicate a specific 802.1d priority.  This is used
@@ -694,6 +695,10 @@  unsigned int cfg80211_classify8021d(struct sk_buff *skb)
 	if (skb->priority >= 256 && skb->priority <= 263)
 		return skb->priority - 256;
 
+	vlan_priority = (skb->vlan_tci >> 13) & 0x07;
+		if (vlan_priority > 0)
+			return vlan_priority;
+
 	switch (skb->protocol) {
 	case htons(ETH_P_IP):
 		dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;