From patchwork Thu Sep 11 14:30:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rostislav Lisovy X-Patchwork-Id: 4888391 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 BFDEEC0338 for ; Thu, 11 Sep 2014 14:31:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77B4E20254 for ; Thu, 11 Sep 2014 14:31:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3133A201F7 for ; Thu, 11 Sep 2014 14:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbaIKOav (ORCPT ); Thu, 11 Sep 2014 10:30:51 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:49305 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755844AbaIKOat (ORCPT ); Thu, 11 Sep 2014 10:30:49 -0400 Received: by mail-wg0-f45.google.com with SMTP id z12so5819879wgg.16 for ; Thu, 11 Sep 2014 07:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rkX1zExI0uemyGGhlMan0gQIN/dDgKo0OY6VDx8U1Zs=; b=Nt7Jz8LZFkhx9okiLvCy/1ElSdbNjM16+y/iOPMGDw8z8Vb5pPFFTjiOeO2gwpiOt/ 0TLViTEW6inFwRnwoG22ydxO5TCya9rZcThYue+n7hEwxR9KRR+IMHZFUWuaLoxqgNya sFs+YJINF3+fv7DbkB/8BPDpdT4pw8UguNPVHWVd8gVGD4PA1A3JqnuuluYbjwhI0LlH 1U4j3IMy1weuoK4nD8NSg+d16Z31L0NxyG9B7Vo4c/5fFsfkFd38lsGuhb5E4QmFZIEl ieiK0g6oPunxqvtYMbXPvW3W8WnCKu6qwojxJUbD0MFeWm0t3+3+O97guYwf1wD+hQ1i BNmw== X-Received: by 10.194.108.41 with SMTP id hh9mr2020470wjb.68.1410445843806; Thu, 11 Sep 2014 07:30:43 -0700 (PDT) Received: from c2c-vostro1.felk.cvut.cz ([147.32.86.112]) by mx.google.com with ESMTPSA id m9sm1386276wjz.35.2014.09.11.07.30.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Sep 2014 07:30:43 -0700 (PDT) From: Rostislav Lisovy X-Google-Original-From: Rostislav Lisovy To: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michal Sojka , s.sander@nordsys.de, jan-niklas.meier@volkswagen.de, burak.simsek@volkswagen.de, Emmanuel Thierry , laszlo.virag@commsignia.com, lisovy@gmail.com, Rostislav Lisovy Subject: [PATCH 2/4] mac80211: Use different EDCA config for OCB Date: Thu, 11 Sep 2014 16:30:20 +0200 Message-Id: <1410445822-6559-3-git-send-email-rostislav.lisovy@fel.cvut.cz> X-Mailer: git-send-email 2.0.0.rc4 In-Reply-To: <1410445822-6559-1-git-send-email-rostislav.lisovy@fel.cvut.cz> References: <1410445822-6559-1-git-send-email-rostislav.lisovy@fel.cvut.cz> 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, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 The IEEE 802.11p specifies different EDCA parameters for the OCB mode. Signed-off-by: Rostislav Lisovy --- net/mac80211/util.c | 27 ++++++++++++++++++++++----- net/mac80211/wme.c | 4 ++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 3eb4151..cac57eb 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1073,6 +1073,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, struct ieee80211_chanctx_conf *chanctx_conf; int ac; bool use_11b, enable_qos; + bool is_ocb; /* Use another EDCA parameters if dot11OCBEnabled is true */ int aCWmin, aCWmax; if (!local->ops->conf_tx) @@ -1097,6 +1098,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, */ enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION); + is_ocb = (sdata->vif.type == NL80211_IFTYPE_OCB); + /* Set defaults according to 802.11-2007 Table 7-37 */ aCWmax = 1023; if (use_11b) @@ -1118,7 +1121,10 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, qparam.cw_max = aCWmax; qparam.cw_min = aCWmin; qparam.txop = 0; - qparam.aifs = 7; + if (is_ocb) + qparam.aifs = 9; + else + qparam.aifs = 7; break; /* never happens but let's not leave undefined */ default: @@ -1126,21 +1132,32 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, qparam.cw_max = aCWmax; qparam.cw_min = aCWmin; qparam.txop = 0; - qparam.aifs = 3; + if (is_ocb) + qparam.aifs = 6; + else + qparam.aifs = 3; break; case IEEE80211_AC_VI: qparam.cw_max = aCWmin; qparam.cw_min = (aCWmin + 1) / 2 - 1; - if (use_11b) + if (is_ocb) + qparam.txop = 0; + else if (use_11b) qparam.txop = 6016/32; else qparam.txop = 3008/32; - qparam.aifs = 2; + + if (is_ocb) + qparam.aifs = 3; + else + qparam.aifs = 2; break; case IEEE80211_AC_VO: qparam.cw_max = (aCWmin + 1) / 2 - 1; qparam.cw_min = (aCWmin + 1) / 4 - 1; - if (use_11b) + if (is_ocb) + qparam.txop = 0; + else if (use_11b) qparam.txop = 3264/32; else qparam.txop = 1504/32; diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 3b87398..456fa1c 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -139,6 +139,10 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, case NL80211_IFTYPE_ADHOC: ra = skb->data; break; + case NL80211_IFTYPE_OCB: + /* all stations are required to support WME */ + qos = true; + break; default: break; }