From patchwork Sun Mar 24 12:24:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1063134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KB0m7BVJ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44RxRQ2S05z9sSH for ; Sun, 24 Mar 2019 23:24:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=jI6J+ojert+hO7eXOLEOOL6Vzt4Mv/pzC9F1I8m1fxk=; b=KB0 m7BVJVTO8BNyI1KQ2QVIsle8es1dxDveM7FJbeJG3vX86GFXYVnhgSjFr4dIxwLYDYr7itpOF5pDE rIzX9HNLXeYbkJfbe3R3FKaxN4T7R44gTWBVfztTdMmUB2mEUM4YxWFrgsjISa0WQWKETOEtGFN9K aS9T3+oOorvNyOf+4StdCAgafZztyCebYFwfICQKEKhSu1OFk+MytpAhLk5wRCpqtNDzMB2cTojBG TMqalKP0NEpyZpMryJxSQYc+n/3YCN5Rh2+smt3x/qn1Jscuxo/296j6YPVUgbDvV7fc+ATd6PJT7 Xv4dUVFaZz79Lzjf128JcWwFwRMNf8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h82Au-0006qM-K5; Sun, 24 Mar 2019 12:24:28 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h82Ar-0006pt-Sl for hostap@lists.infradead.org; Sun, 24 Mar 2019 12:24:27 +0000 Received: from p548c810f.dip0.t-ipconnect.de ([84.140.129.15] helo=bertha.fritz.box) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1h82Ak-00009e-Ei; Sun, 24 Mar 2019 13:24:18 +0100 From: John Crispin To: hostap@lists.infradead.org Subject: [PATCH] HE: Fix Operation Parameters order Date: Sun, 24 Mar 2019 13:24:06 +0100 Message-Id: <20190324122406.5212-1-john@phrozen.org> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190324_052426_100592_62C15DDF X-CRM114-Status: GOOD ( 11.58 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Crispin MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org According to D4.0 - 9.4.2.238 HE Operation element the BSS Color Information field is located behind the Parameters field. This patch fixes the ordering and post-apply wireshark3.2 is able to properly parse and display beacon frames. Signed-off-by: John Crispin --- src/ap/ieee802_11_he.c | 8 +++++--- src/common/ieee802_11_defs.h | 29 ++++++++++++++++------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index 072135863..09ba6f231 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -64,9 +64,6 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) oper = (struct ieee80211_he_operation *) pos; os_memset(oper, 0, sizeof(*oper)); - if (hapd->iface->conf->he_op.he_bss_color) - oper->he_oper_params |= hapd->iface->conf->he_op.he_bss_color; - if (hapd->iface->conf->he_op.he_default_pe_duration) oper->he_oper_params |= (hapd->iface->conf->he_op.he_default_pe_duration << @@ -80,6 +77,11 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) (hapd->iface->conf->he_op.he_rts_threshold << HE_OPERATION_RTS_THRESHOLD_OFFSET); + if (hapd->iface->conf->he_op.he_bss_color) + oper->he_oper_params |= + (hapd->iface->conf->he_op.he_bss_color << + HE_OPERATION_BSS_COLOR_OFFSET); + /* TODO: conditional MaxBSSID Indicator subfield */ pos += sizeof(*oper); diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index b285d13a7..ff811d851 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2128,21 +2128,24 @@ struct ieee80211_he_operation { /* HE Operation defines */ /* HE Operation Parameters and BSS Color Information fields */ -#define HE_OPERATION_BSS_COLOR_MASK ((u32) (BIT(0) | BIT(1) | \ - BIT(2) | BIT(3) | \ - BIT(4) | BIT(5))) -#define HE_OPERATION_PARTIAL_BSS_COLOR ((u32) BIT(6)) -#define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(7)) #define HE_OPERATION_DFLT_PE_DURATION_MASK ((u32) (BIT(8) | BIT(9) | \ BIT(10))) -#define HE_OPERATION_DFLT_PE_DURATION_OFFSET 8 -#define HE_OPERATION_TWT_REQUIRED ((u32) BIT(11)) -#define HE_OPERATION_RTS_THRESHOLD_MASK ((u32) (BIT(12) | BIT(13) | \ - BIT(14) | BIT(15) | \ - BIT(16) | BIT(17) | \ - BIT(18) | BIT(19) | \ - BIT(20) | BIT(21))) -#define HE_OPERATION_RTS_THRESHOLD_OFFSET 12 +#define HE_OPERATION_DFLT_PE_DURATION_OFFSET 0 +#define HE_OPERATION_TWT_REQUIRED ((u32) BIT(3)) +#define HE_OPERATION_RTS_THRESHOLD_MASK ((u32) (BIT(4) | BIT(5) | \ + BIT(6) | BIT(7) | \ + BIT(8) | BIT(9) | \ + BIT(10) | BIT(11) | \ + BIT(12) | BIT(13))) +#define HE_OPERATION_RTS_THRESHOLD_OFFSET 4 +#define HE_OPERATION_BSS_COLOR_MASK ((u32) (BIT(24) | BIT(25) | \ + BIT(26) | BIT(27) | \ + BIT(28) | BIT(29))) +#define HE_OPERATION_PARTIAL_BSS_COLOR ((u32) BIT(30)) +#define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(31)) +#define HE_OPERATION_BSS_COLOR_OFFSET 24 + + struct ieee80211_he_mu_edca_parameter_set { u8 he_qos_info;