Skip to content

Commit c6ca5e2

Browse files
acksysjmberg-intel
authored andcommitted
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>
1 parent 131a19b commit c6ca5e2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎net/wireless/util.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <net/cfg80211.h>
1111
#include <net/ip.h>
1212
#include <net/dsfield.h>
13+
#include <linux/if_vlan.h>
1314
#include "core.h"
1415
#include "rdev-ops.h"
1516

@@ -691,6 +692,7 @@ EXPORT_SYMBOL(ieee80211_amsdu_to_8023s);
691692
unsigned int cfg80211_classify8021d(struct sk_buff *skb)
692693
{
693694
unsigned int dscp;
695+
unsigned char vlan_priority;
694696

695697
/* skb->priority values from 256->263 are magic values to
696698
* directly indicate a specific 802.1d priority. This is used
@@ -700,6 +702,13 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
700702
if (skb->priority >= 256 && skb->priority <= 263)
701703
return skb->priority - 256;
702704

705+
if (vlan_tx_tag_present(skb)) {
706+
vlan_priority = (vlan_tx_tag_get(skb) & VLAN_PRIO_MASK)
707+
>> VLAN_PRIO_SHIFT;
708+
if (vlan_priority > 0)
709+
return vlan_priority;
710+
}
711+
703712
switch (skb->protocol) {
704713
case htons(ETH_P_IP):
705714
dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;

0 commit comments

Comments
 (0)