From patchwork Fri Sep 27 10:09:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: voncken X-Patchwork-Id: 2953661 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C78B8BFF0B for ; Fri, 27 Sep 2013 10:30:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0A7A20333 for ; Fri, 27 Sep 2013 10:30:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EF8E20318 for ; Fri, 27 Sep 2013 10:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751679Ab3I0KaN (ORCPT ); Fri, 27 Sep 2013 06:30:13 -0400 Received: from smtp-out05.msg.oleane.net ([62.161.7.3]:37457 "EHLO smtp-out05.msg.oleane.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966Ab3I0KaM convert rfc822-to-8bit (ORCPT ); Fri, 27 Sep 2013 06:30:12 -0400 Received: from smtp03.msg.oleane.net (smtp03.mail.priv [172.17.20.112]) by smtp-out05.msg.oleane.net with ESMTP id r8RAUApu003469 for ; Fri, 27 Sep 2013 12:30:10 +0200 Received: from acksys.fr ([195.6.104.67]) (authenticated) by smtp03.msg.oleane.net (MTA) with ESMTP id r8RA9ROV016347; Fri, 27 Sep 2013 12:09:28 +0200 Content-class: urn:content-classes:message Subject: [PATCH V4] cfg80211: vlan priority handling in WMM Date: Fri, 27 Sep 2013 12:09:26 +0200 Message-ID: <773DB8A82AB6A046AE0195C68612A3190164B0BF@sbs2003.acksys.local> MIME-Version: 1.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH V4] cfg80211: vlan priority handling in WMM X-MimeOLE: Produced By Microsoft Exchange V6.5.7235.2 Thread-Index: Ac67aSSBegPJB8RLTryQVd3f3o5VQg== From: "Cedric VONCKEN" To: Cc: X-PMX-Spam: Probability=8% X-PFSI-Info: PMX 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.9.27.100015 (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=-9.3 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 If the VLAN tci is set in skb->vlan_tci use the priority field to determine the WMM priority. Signed-off-by: cedric Voncken --- net/wireless/util.c | 8 +++++++ 1 files changed, 8 insertions(+), 0 deletions(-) V2 modifications: Fix indentation Use symbolic constant include the header linux/if_vlan.h V3 modifications: Check the vlan_tci validity with macro vlan_tx_tag_present Get the vlan_tci field value with macro vlan_tx_tag_get Request to netdev mailling list to know if the VLAN priority value 0 must be treated as no priority request. I add the Ben Hutchings reply below: IEEE 802.1q refers to the definition in 802.1d: > The user_priority parameter is the priority requested by the > originating service user. The value of this parameter is in the range > 0 through 7. > > NOTE -- The default user_priority value is 0. Values 1 through 7 form an > ordered sequence of user_priorities, with 1 being the lowest value and > 7 the highest. See 7.7.3 and Annex G (informative) for further > explanation of the use of user_priority values. So a value of 0 should be treated as no priority request, same as for an untagged frame. V4 modifications: Fix patch format @@ -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; --- 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 --git a/net/wireless/util.c b/net/wireless/util.c index ce090c1..9e4cac2 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "core.h" #include "rdev-ops.h" @@ -691,5 +692,6 @@ 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