summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorcedric Voncken <cedric.voncken@acksys.fr>2013-08-26 14:04:52 +0200
committerJohannes Berg <johannes.berg@intel.com>2013-10-02 11:04:33 +0200
commitc6ca5e28bc005f109b2772765c62b4d4ec35c954 (patch)
tree1f51d4dc7bd56c953cc9bf282972e5222d62436e /net/wireless
parent131a19bc924c32cecd014be7036686f2186b48ad (diff)
cfg80211: vlan priority handling in WMM
If the VLAN tci is set in skb->vlan_tci use the priority field to determine the WMM priority. Signed-off-by: cedric Voncken <cedric.voncken@acksys.fr> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index ce090c1c5e4..3c8be6104ba 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"
@@ -691,6 +692,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
@@ -700,6 +702,13 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
if (skb->priority >= 256 && skb->priority <= 263)
return skb->priority - 256;
+ if (vlan_tx_tag_present(skb)) {
+ vlan_priority = (vlan_tx_tag_get(skb) & 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;