From patchwork Tue Jun 25 15:31:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: voncken X-Patchwork-Id: 2779131 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EE0BE9F3A0 for ; Tue, 25 Jun 2013 18:53:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9AFE20464 for ; Tue, 25 Jun 2013 18:53:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D63E20462 for ; Tue, 25 Jun 2013 18:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427Ab3FYSw4 (ORCPT ); Tue, 25 Jun 2013 14:52:56 -0400 Received: from smtp-out06.msg.oleane.net ([62.161.7.4]:56449 "EHLO smtp-out06.msg.oleane.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752807Ab3FYSwz (ORCPT ); Tue, 25 Jun 2013 14:52:55 -0400 X-Greylist: delayed 10856 seconds by postgrey-1.27 at vger.kernel.org; Tue, 25 Jun 2013 14:52:54 EDT Received: from smtp26.msg.oleane.net (smtp26.mail.priv [172.17.20.148]) by smtp-out06.msg.oleane.net with ESMTP id r5PFpuw0025165 for ; Tue, 25 Jun 2013 17:51:56 +0200 Received: from acksys.fr ([195.6.104.67]) (authenticated) by smtp26.msg.oleane.net (MTA) with ESMTP id r5PFVU6u018724 for ; Tue, 25 Jun 2013 17:31:30 +0200 Received: from localhost.localdomain ([192.168.1.29]) by acksys.fr with Microsoft SMTPSVC(6.0.3790.4675); Tue, 25 Jun 2013 17:32:15 +0200 From: cedric.voncken@acksys.fr To: linux-wireless@vger.kernel.org Cc: Cedric Voncken Subject: [PATCH] wireless: vlan priority handling in WMM Date: Tue, 25 Jun 2013 17:31:02 +0200 Message-Id: <1372174262-13526-1-git-send-email-cedric.voncken@acksys.fr> X-Mailer: git-send-email 1.7.2.5 X-OriginalArrivalTime: 25 Jun 2013 15:32:15.0500 (UTC) FILETIME=[2B9E34C0:01CE71B9] X-PMX-Spam: Probability=10% X-PFSI-Info: PMX 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.6.25.150624 (no antivirus check) X-Orange-Auth: bWMxNDg4LTg= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Cedric Voncken If the VLAN priority is set in skb->vlan_tci use it to determine the WMM priority. Signed-off-by: Cedric Voncken --- net/wireless/util.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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;