linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] vlan priority handling in WMM
@ 2013-06-27  7:52 cedric.voncken
  2013-07-01  7:25 ` voncken
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: cedric.voncken @ 2013-06-27  7:52 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, cedric voncken

From: cedric voncken <cedric.voncken@acksys.fr>

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

V2 modifications :
	Fix indentation
	Use symbolic constant
	include the header linux/if_vlan.h

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

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 74458b7..13937db 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -10,6 +10,7 @@
 #include <net/cfg80211.h>
 #include <net/ip.h>
 #include <net/dsfield.h>
+#include <linux/if_vlan.h>
 #include "core.h"
 #include "rdev-ops.h"
 
@@ -685,6 +686,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 +696,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 & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
+	if (vlan_priority > 0)
+		return vlan_priority;
+
 	switch (skb->protocol) {
 	case htons(ETH_P_IP):
 		dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-07-08 12:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-27  7:52 [PATCH V2] vlan priority handling in WMM cedric.voncken
2013-07-01  7:25 ` voncken
2013-07-04  7:18   ` voncken
2013-07-04  7:46     ` Johannes Berg
2013-07-04  7:59       ` voncken
2013-07-05  9:57 ` Johannes Berg
2013-07-05  9:59 ` Johannes Berg
2013-07-05 14:39   ` voncken
2013-07-08  8:51     ` Johannes Berg
2013-07-08 10:39       ` voncken
2013-07-08 12:15         ` 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).