From patchwork Tue Aug 13 13:50:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 1146382 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=fail (p=none dis=none) header.from=narfation.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tgzf+0Vc"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="RlJ4mtAZ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 467DdR59d3z9sN6 for ; Tue, 13 Aug 2019 23:51:07 +1000 (AEST) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=1W12SThVzG+7w2H92hfsePEDtJzrlIjdiqpjNAkKK5o=; b=Tgzf+0VcfYg8AA DJ4+MTWkubq3LSTad/lLmqTqHPMQv7PifZqfykHbF2aRhCzDHlNelc5stQ50WjVtuNEU/5g6UIqOW PWNWSY/Rpbz4DFzGoNw6ygbLNDgBoICcaLql23XgL2asSRpN8OeA0sdlBLE8ZOgC2RGrPjneztoeN I4M7MRDT2UwXUDoCREo4QrIJkRZw2z7iUcyb7brWVSPsghhU9DaLaZe3Wnpac+IuRmGXRqEuHMq6G n6xk0nTDwxq1X2/S7G4gmK+alirHg3LuJt3C0Fj1oIjEZt6kDHCjFuESdcfB/wDnTLcOvF1bA9dKw J04+8N/7A2YFtwhyqYpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxXCa-0004p4-Hu; Tue, 13 Aug 2019 13:51:04 +0000 Received: from dvalin.narfation.org ([2a00:17d8:100::8b1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxXCX-0004ol-5P for hostap@lists.infradead.org; Tue, 13 Aug 2019 13:51:03 +0000 Received: from sven-desktop.home.narfation.org (p200300C59716A6EC000000000000051D.dip0.t-ipconnect.de [IPv6:2003:c5:9716:a6ec::51d]) by dvalin.narfation.org (Postfix) with ESMTPSA id 124192002D; Tue, 13 Aug 2019 13:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1565704257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Lz2KQAtfrCEQoac8fJ7X7eaLDsRNP1X9jasMXKiLqvU=; b=RlJ4mtAZmdI8sUBKUsfA01inwLuKxfJQ7/kY1dKyVBMFNQxIQxqcsJ8mFcolCnCjYXgjpf BDUNAVXNuD0YQ5fC+CVB91QhprFlptDHh1nbLbHsZ/SfUhl/O6ewE8+k3udF+sGipHJPm5 8JsAuWH02f78cv9kwMLxzV2R1SUKcSI= From: Sven Eckelmann To: hostap@lists.infradead.org Subject: [PATCH] mesh: HE: Don't enable HE on 5GHz without VHT Date: Tue, 13 Aug 2019 15:50:52 +0200 Message-Id: <20190813135052.18251-1-sven@narfation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1565704257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Lz2KQAtfrCEQoac8fJ7X7eaLDsRNP1X9jasMXKiLqvU=; b=rpZZlv+HyRHtXw4V7haAVOThy8Wts7SXekk4Dh27fT6Fz40dDNVHugaXayzbawz0sI90sh kRQqma+52UB61xDGlUNiQM2TbPKTwmrr/l5ivxpm8+Sv2IQnGA9ZqfS6DKHIiTAGhCiIlg I8qdLrC4ugCvQ+zUE8mrDRFJHMyeJP4= ARC-Seal: i=1; s=20121; d=narfation.org; t=1565704257; a=rsa-sha256; cv=none; b=ZZBIte4BQ1f9h4Gx9hV1Kv6fxcGYCpmhkrxvp4KyBcN1bgU8tD7qI7K3IYpBgaUqD4a2zM vv7ckXHzUQorQlFtiPUDnK759reDpy56rodn9wGAF+Ct1OEMVCKuSzlnI49+7b0+xfh6eR bIVRg4F9pxYzDt11cIgyztFZdIkkggc= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sven smtp.mailfrom=sven@narfation.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190813_065101_506556_AE6AE6A1 X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a00:17d8:100:0:0:0:0:8b1 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Sven Eckelmann The commit ad9a1bfe788e ("nl80211: Share VHT channel configuration for HE") always enforced that VHT is enabled when HE was enabled. This broke the mesh functionality on 2.4GHz with HE because ibss_mesh_setup_freq() isn't setting up the VHT parameters for 2.4GHz. This problem was resolved for 2.4GHz by commit df4f959988b6 ("nl80211: Don't force VHT channel definition with HE"). But it is still possible to disable VHT during the mesh/IBSS freq setup on 5GHz - which would result in the same problem as seen on 2.4GHz. The code enabling HE for IBSS/mesh must now make sure that it doesn't enable HE when VHT could be enforced by the nl80211 driver code but disabled by the user. Fixes: 3459c54ac78b ("mesh: Add support for HE mode") Signed-off-by: Sven Eckelmann --- This is a compromise between the original patch [1] (which removed the enforcing of VHT when HE is enabled) and the orginal implementation (which enforced VHT when HE is enabled). This fixes following test cases: * mesh_secure_ocv_mix_legacy * wpas_mesh_open_ht40 * mesh_secure_ocv_mix_ht When the mac8011_hwsim HE patch [2] is applied on the kernel. [1] https://patchwork.ozlabs.org/patch/1125305/ [2] https://patchwork.kernel.org/patch/11091267/ --- wpa_supplicant/wpa_supplicant.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 21ef6fad1..8fcf6e535 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2155,6 +2155,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; u32 vht_caps = 0; + int is_24ghz; freq->freq = ssid->frequency; @@ -2206,8 +2207,8 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, if (!mode) return; - /* HE can work without HT + VHT */ - freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; + is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G || + hw_mode == HOSTAPD_MODE_IEEE80211B; #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht) { @@ -2220,6 +2221,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, if (!freq->ht_enabled) return; + /* allow HE on 2.4GHz without VHT: see nl80211_put_freq_params() */ + if (is_24ghz) + freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; + /* Setup higher BW only for 5 GHz */ if (mode->mode != HOSTAPD_MODE_IEEE80211A) return; @@ -2340,6 +2345,9 @@ skip_ht40: if (!vht_freq.vht_enabled) return; + /* enable HE for VHT */ + vht_freq.he_enabled = mode->he_capab[ieee80211_mode].he_supported; + /* setup center_freq1, bandwidth */ for (j = 0; j < ARRAY_SIZE(vht80); j++) { if (freq->channel >= vht80[j] &&