Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp572318rdb; Mon, 29 Jan 2024 10:49:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvz5GJogG8/GEY+3dvD8yUltSKy6qRnR8tOykW70UR4OgimFUb462lOQdJGjyTW3sMS1SD X-Received: by 2002:a17:902:ba86:b0:1d7:8570:e53 with SMTP id k6-20020a170902ba8600b001d785700e53mr6642387pls.38.1706554197859; Mon, 29 Jan 2024 10:49:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706554197; cv=pass; d=google.com; s=arc-20160816; b=IOrOLq8AFZgvmmgYgqU3b592Sx7DoWN1j5tuYlqm2mBBogDZyCrIajMIh80GHr7jy2 yjolDdNNMowR6Tei5oTAAqJQa6BkkOvEBnYKmR3N05QetQ3JOoSPqVGPeoJgyhGFXHyK yUcwSuFUWjNnNk8Q5E5siOKH90fncFsNeGHmMCy1kSSRqbui8hwz/VzQRU2UPTjguqfc xoQ7Iaz4P8X8k/L6aQY6rdLe8dhEW/hESbSlQ3P0pRJQW/2ZYX49lmQfDoFKr5k0IVLy ZoMcMm/1EqZaLwq9/ocin9XSwAey/CQ4Ut2NkXSVbwmheBS/Nv6noFa2oqvZVDcOhWe9 XgYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7VPX9NwJpTHKYHRItXywbNP0KCjhWXjk9SYC7FdSOU0=; fh=9j5yg6xQzYMxfVBCMZQtzj36JildZcwAPrgnZtBBGyE=; b=uuYmz6n84RKU+deYD++vV4EG1mnJr1KmAA8d9WcCoafXSy1v0Yi1O/X8n4mK/bQkjL O5hgd1/k33+FtxQj7XvLrBDru+Z9N29vwv/W3br38HxlRd+YknNKZ86JbAPKmSWOxBXi FUwZvtupY52eDv2fT9fsKy7lEaCAgBEvmEZDG4WWE7r72ZhNg53dDUZeUgMiUUET5WKd jVj4fq+kEiU9j81fsEbKnIbs5pkc50/X9Zwanz0nhaBwkvYkjZWyUwcsA50vNtyoD1Vd 6dJUE9t7louJkzp9kWfx2OuQ+VaxhxdaxNmMcO1hIgD3ub+J+8mBHfF6XRmjla3PE8fv 5b8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=ddIcnx8G; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2689-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCW3+MexIy1JauLGAEgrWDwtfzRyKndATFILUjf3OwhbvXzFsj0QWbOfAP9rLqjz9cJkDImgfeWRg0lE5dP5Yy5VdMd8oY7cAH4p/P5rDg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s10-20020a170902ea0a00b001d78541f961si6247433plg.378.2024.01.29.10.49.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2689-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=ddIcnx8G; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2689-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1F81D284CFC for ; Mon, 29 Jan 2024 18:49:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE28C15A4A5; Mon, 29 Jan 2024 18:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="ddIcnx8G" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 821F814A82 for ; Mon, 29 Jan 2024 18:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706553686; cv=none; b=my0PcquogI/a4gKN9O0Dp69CUI3gBjM2LnSVrEfIgK+eTYWtx4qVPck1S+EXKjXDl8WciaMZO3j6rfZLkJ+KqRXs3mAm3vOhgSAqTbUNvm0XsWI8hARka4NSbqmeXppkSaUYOeA4sRQqB3f2lgVHnNzdF1dlastxQpL2BUy+UvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706553686; c=relaxed/simple; bh=4KItb5zXboJ/qQGUUbD9vjVMCX0ihnjzhWewMN6lD/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PdOX9XCBYyoMb97ieMdLo/pIH1G0KjDJBwnXsUBg7cGSQ6thSbxNXfskjRuYeBLSyfCm8lkutGZZUgoVl4YnFT1dacv6wTiMeqb/wO/gaDVdSpzLun4cZMVPix8JiuWRzhTDKKJHl8x/mQo31h2sykinud9/jiXVgN69ahsEPfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=ddIcnx8G; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=7VPX9NwJpTHKYHRItXywbNP0KCjhWXjk9SYC7FdSOU0=; t=1706553684; x=1707763284; b=ddIcnx8GPfF6SO8RWiSEe40OGu0Yym2tJKDpH5NIMMtlpL8 KCXy7byhOzYYM1O7IJAkjBMFXC6rpJGVqbtDtZEgSEUFsMnJfmsFQWx61vD/W1nZc1AQDaVhz+wd8 5VEdC8X2RZkYW8YtIk04nkOuTlsNPzuXc2/clpQlOVpqo6slOu+4L7caysfAroGUIXL8zI/jfOHIt KgjjfjgCn/MGBvGvhkTKbjQeKL4TlCmHoYXpACvitkUJ+rVK+4tyY6G1A9bQ+kMHTC5+Zdz3DxCwU iW56l7D+XRodea8WRWrcctYGXbuIQECHyjQEnxN7xRZ4xYDvh1TkQeYvx9985EQg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUWZM-00000004z9N-3bXD; Mon, 29 Jan 2024 19:41:21 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 12/15] wifi: wireless: declare different S1G chandefs incompatible Date: Mon, 29 Jan 2024 19:34:46 +0100 Message-ID: <20240129194108.b28fb0644a8c.I9297ada5cf1baf00dbbdf8fcffd1806883489fc9@changeid> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129184108.49639-17-johannes@sipsolutions.net> References: <20240129184108.49639-17-johannes@sipsolutions.net> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg It doesn't look like we can get into this code, but make it more robust and declare two S1G chandefs to be incompatible unless they're identical. Signed-off-by: Johannes Berg --- net/wireless/chan.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 71f1bd456d88..159b8aac451e 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -465,13 +465,18 @@ cfg80211_chandef_compatible(const struct cfg80211_chan_def *c1, return NULL; /* - * can't be compatible if one of them is 5 or 10 MHz, + * can't be compatible if one of them is 5/10 MHz or S1G * but they don't have the same width. */ - if (c1->width == NL80211_CHAN_WIDTH_5 || - c1->width == NL80211_CHAN_WIDTH_10 || - c2->width == NL80211_CHAN_WIDTH_5 || - c2->width == NL80211_CHAN_WIDTH_10) +#define NARROW_OR_S1G(width) ((width) == NL80211_CHAN_WIDTH_5 || \ + (width) == NL80211_CHAN_WIDTH_10 || \ + (width) == NL80211_CHAN_WIDTH_1 || \ + (width) == NL80211_CHAN_WIDTH_2 || \ + (width) == NL80211_CHAN_WIDTH_4 || \ + (width) == NL80211_CHAN_WIDTH_8 || \ + (width) == NL80211_CHAN_WIDTH_16) + + if (NARROW_OR_S1G(c1->width) || NARROW_OR_S1G(c2->width)) return NULL; if (c1->width == NL80211_CHAN_WIDTH_20_NOHT || -- 2.43.0