Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1147151rdb; Fri, 20 Oct 2023 09:36:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHL8606Qkp0TLZfvYQmBwXpvYSsLUYnBGHJyOs3vY+D+j3n5WEMhe1mYvJly/PR9abVQ+q X-Received: by 2002:a05:6870:b91:b0:1e9:cddf:f825 with SMTP id lg17-20020a0568700b9100b001e9cddff825mr2945985oab.15.1697819783493; Fri, 20 Oct 2023 09:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697819783; cv=none; d=google.com; s=arc-20160816; b=YWiOpBX4eZqRYs0WxxjqptftKSYFxrMyyENfDhsdwIuueET2gX+AErgk40BLKPfU1b h3oKzFj1+37O6lA3Pkmx8XS8pYGnPUMa7WD+A4zMgjl/wDfZkDSolOwj+D3Rta6lpd6a 1t1SW6E8RRmoUwDGLqgUH7SFVFNiC5zJUjCCq6gPNfG8FWnZWT/Qtb5dUzaAAJw6onoY LIwBsFCX6w8eCdYiozh3fJ9KNvq6GcMlrLF7Ub4vacbFaXNJ655tl7F8mrG14NGLDIuY xTR+3mb6jd1KHGSEyaWxyTTPl/dKrz03c88Ymua/5O3m+OAg1RmUS97rkOP/7hku/ej0 5mNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AWikgjvSE35PTGSbSuie+aPwQzHN09c8HW1HYQB+sf0=; fh=qJotNKxq/9J27AySKlDZCVKXUIjdeWpUF8dOMvUIxYc=; b=Lcl/g8yli85WCdSBvci+wGhNi6M5jn0PNxLLuVg/Iar2ysHmyY56hUvu0osbyM+RKL Tqnk855pXAsKWGBLd81uLoTfMLiJFyz3KSUwwW6bU5ZHVDvHBNLEIzFmPtqZUwJFkdi7 GNK/Nuin3Cqu0Mng0dRcFD9y/bUJgFVegRqAAupgK/OqwuPPGEhKrDHg1Xp6kzW0V8Fv DxZVPPeTbuoovmBXilLUe6u3eewcVZBWEtBYywwUMmT/UvHwIlEugaPbHubVaeVtFLgw KB6VEPMQ7Vop884eqXBh14mUdsNXNePcP3mGdgNAcOTcRJd/effb3yoqD2ZfBuDCEnGG PMig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dberlin.org header.s=google header.b=VkEV5wNc; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t2-20020a639542000000b005897813624fsi2077126pgn.476.2023.10.20.09.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 09:36:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@dberlin.org header.s=google header.b=VkEV5wNc; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8DE898369F6A; Fri, 20 Oct 2023 09:36:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjJTQgT (ORCPT + 52 others); Fri, 20 Oct 2023 12:36:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbjJTQgR (ORCPT ); Fri, 20 Oct 2023 12:36:17 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 486CCD6B for ; Fri, 20 Oct 2023 09:36:15 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c523ac38fbso15123481fa.0 for ; Fri, 20 Oct 2023 09:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dberlin.org; s=google; t=1697819773; x=1698424573; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AWikgjvSE35PTGSbSuie+aPwQzHN09c8HW1HYQB+sf0=; b=VkEV5wNcYCYbxoaE2thD1Lilw4JWGh2GPuUn5UafR17g7R2BzGsupWb7k4M9ERSYR8 akb0j9Lu7fmqpdMfMCgp/h98avIHVDGAGtMExbJjRzDn65qDqZQK0YQh6GiTo+V4cXqJ ZaddcVdsuAHqbwanCdohP/vvS63dq5jmOb5Gwvu3U5ozVCv7cecARV0vPaR9853OflPZ j1gM0qT2zVPYBHZnKsERidIQ56zkDlYKdViAqk18LRgDKuV52JB7tzM9dtTSH1pU76T0 NjFHGSbeDFyaHp/sdSOjYYCom6U6xhcpFNQ4vESFcH1J3sIFiXAu65QqzFlp+ZlDfRJ0 QY0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697819773; x=1698424573; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWikgjvSE35PTGSbSuie+aPwQzHN09c8HW1HYQB+sf0=; b=n6e/CTo5+RJFuBYwZzh6VuzCoBK9EXtvq7OL3WnlIwhuBQSoUjcdhlWbZ+/41mPlvY 9ae4REToXKY2VYDWNrgyObRV0SJ0VJzKLTPk87EZSfVvW0MVHbp5B4PXUVmSU1Ot92Zi qvgys1JCQxYgXL+sZ2wdKRgobYtLatTRMVtWE4+guUafBtsJxY1wdJRB3zY0zagVJgm7 KV+TeR7QpCMToyw0TwVEhEW6HckIxvehCfGYRmtdOaUrgekRB5dboyfNRIjj37hWfgMr k0n0GRKcfQfa0IHhbZhuG4x7H6vRIkdEjfusxconlW88bgKLhd6/UuEZ4SIjP3irtmYe Erow== X-Gm-Message-State: AOJu0YxgPFCJulNHoOYU1IbDlBnqsFvcMRsWD+l0NtmkXE/xhmeZplrE D33yNenNgoxGVP5hVDxhIPxpmDfgb5twL2Y3BSJmIw== X-Received: by 2002:a05:651c:1a28:b0:2c5:80d:53b1 with SMTP id by40-20020a05651c1a2800b002c5080d53b1mr2380888ljb.43.1697819773114; Fri, 20 Oct 2023 09:36:13 -0700 (PDT) MIME-Version: 1.0 References: <0b95944fcf047b3ec83cecb0c65ca24de43810fd.1697650207.git.dberlin@dberlin.org> In-Reply-To: From: Daniel Berlin Date: Fri, 20 Oct 2023 12:36:01 -0400 Message-ID: Subject: Re: [PATCH 1/5] [brcmfmac] Add support for encoding/decoding 6g chanspecs To: Arend van Spriel Cc: Arend van Spriel , Franky Lin , Hante Meuleman , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 20 Oct 2023 09:36:19 -0700 (PDT) I'll remove the extra prints, and the 320MHZ. On Fri, Oct 20, 2023 at 5:57=E2=80=AFAM Arend van Spriel wrote: > > On 10/19/2023 3:42 AM, Daniel Berlin wrote: > > This patch adds support for 6G chanspecs, as part of adding 6G and > > 802.11ax support. > > > > I added the correct values for the upcoming 320mhz as well so that the > > info is complete. > > Reviewed-by: Arend van Spriel > > Signed-off-by: Daniel Berlin > > --- > > .../broadcom/brcm80211/brcmutil/d11.c | 46 +++++++++++++++---= - > > .../broadcom/brcm80211/include/brcmu_d11.h | 46 +++++++++++++-----= - > > .../broadcom/brcm80211/include/brcmu_wifi.h | 27 ++++++++--- > > 3 files changed, 89 insertions(+), 30 deletions(-) > > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c b/d= rivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c > > index 1e2b1e487eb7..faf7eeeeb2d5 100644 > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c > > [...] > > > @@ -117,7 +127,9 @@ static void brcmu_d11n_decchspec(struct brcmu_chan = *ch) > > } > > break; > > default: > > - WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); > > + WARN_ONCE(1, > > + "Invalid chanspec - unknown 11n bandwidth 0x%04= x\n", > > + ch->chspec); > > I don't think this provides more info. The WARN_ONCE() already prints > code location and stack trace. > > > break; > > } > > > > @@ -129,7 +141,8 @@ static void brcmu_d11n_decchspec(struct brcmu_chan = *ch) > > ch->band =3D BRCMU_CHAN_BAND_2G; > > break; > > default: > > - WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); > > + WARN_ONCE(1, "Invalid chanspec - unknown 11n band 0x%04x\= n", > > + ch->chspec); > > ditto > > > break; > > } > > } > > @@ -156,7 +169,9 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan= *ch) > > ch->sb =3D BRCMU_CHAN_SB_U; > > ch->control_ch_num +=3D CH_10MHZ_APART; > > } else { > > - WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chs= pec); > > + WARN_ONCE(1, > > + "Invalid chanspec - unknown 11ac channe= l distance 0x%04x\n", > > + ch->chspec); > > ditto > > > } > > break; > > case BRCMU_CHSPEC_D11AC_BW_80: > > @@ -177,7 +192,9 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan= *ch) > > ch->control_ch_num +=3D CH_30MHZ_APART; > > break; > > default: > > - WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chs= pec); > > + WARN_ONCE(1, > > + "Invalid chanspec - unknown 11ac channe= l distance 0x%04x\n", > > + ch->chspec); > > ditto > > > break; > > } > > break; > > @@ -211,17 +228,24 @@ static void brcmu_d11ac_decchspec(struct brcmu_ch= an *ch) > > ch->control_ch_num +=3D CH_70MHZ_APART; > > break; > > default: > > - WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chs= pec); > > + WARN_ONCE(1, > > + "Invalid chanspec - unknown 11ac channe= l distance 0x%04x\n", > > + ch->chspec); > > ditto > > > break; > > } > > break; > > case BRCMU_CHSPEC_D11AC_BW_8080: > > default: > > - WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); > > + WARN_ONCE(1, > > + "Invalid chanspec - unknown 11ac channel bandwi= dth 0x%04x\n", > > + ch->chspec); > > break; > > } > > > > switch (ch->chspec & BRCMU_CHSPEC_D11AC_BND_MASK) { > > + case BRCMU_CHSPEC_D11AC_BND_6G: > > + ch->band =3D BRCMU_CHAN_BAND_6G; > > + break; > > case BRCMU_CHSPEC_D11AC_BND_5G: > > ch->band =3D BRCMU_CHAN_BAND_5G; > > break; > > [...] > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.= h b/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h > > index f6344023855c..bb48b7442062 100644 > > --- a/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h > > +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h > > @@ -69,24 +69,44 @@ > > #define BRCMU_CHSPEC_D11AC_SB_UU BRCMU_CHSPEC_D11AC_SB_LUU > > #define BRCMU_CHSPEC_D11AC_SB_L BRCMU_CHSPEC_D11AC_SB_LLL > > #define BRCMU_CHSPEC_D11AC_SB_U BRCMU_CHSPEC_D11AC_SB_LLU > > +/* channel sideband indication for frequency >=3D 240MHz */ > > +#define BRCMU_CHSPEC_D11AC_320_SB_MASK 0x0780 > > +#define BRCMU_CHSPEC_D11AC_320_SB_SHIFT 7 > > +#define BRCMU_CHSPEC_D11AC_SB_LLLL 0x0000 > > +#define BRCMU_CHSPEC_D11AC_SB_LLLU 0x0080 > > +#define BRCMU_CHSPEC_D11AC_SB_LLUL 0x0100 > > +#define BRCMU_CHSPEC_D11AC_SB_LLUU 0x0180 > > +#define BRCMU_CHSPEC_D11AC_SB_LULL 0x0200 > > +#define BRCMU_CHSPEC_D11AC_SB_LULU 0x0280 > > +#define BRCMU_CHSPEC_D11AC_SB_LUUL 0x0300 > > +#define BRCMU_CHSPEC_D11AC_SB_LUUU 0x0380 > > +#define BRCMU_CHSPEC_D11AC_SB_ULLL 0x0400 > > +#define BRCMU_CHSPEC_D11AC_SB_ULLU 0x0480 > > +#define BRCMU_CHSPEC_D11AC_SB_ULUL 0x0500 > > +#define BRCMU_CHSPEC_D11AC_SB_ULUU 0x0580 > > +#define BRCMU_CHSPEC_D11AC_SB_UULL 0x0600 > > +#define BRCMU_CHSPEC_D11AC_SB_UULU 0x0680 > > +#define BRCMU_CHSPEC_D11AC_SB_UUUL 0x0700 > > +#define BRCMU_CHSPEC_D11AC_SB_UUUU 0x0780 > > These are WCC specific, but I think it is okay to have these definitions > here. > > > #define BRCMU_CHSPEC_D11AC_BW_MASK 0x3800 > > #define BRCMU_CHSPEC_D11AC_BW_SHIFT 11 > > -#define BRCMU_CHSPEC_D11AC_BW_5 0x0000 > > -#define BRCMU_CHSPEC_D11AC_BW_10 0x0800 > > -#define BRCMU_CHSPEC_D11AC_BW_20 0x1000 > > -#define BRCMU_CHSPEC_D11AC_BW_40 0x1800 > > -#define BRCMU_CHSPEC_D11AC_BW_80 0x2000 > > -#define BRCMU_CHSPEC_D11AC_BW_160 0x2800 > > -#define BRCMU_CHSPEC_D11AC_BW_8080 0x3000 > > -#define BRCMU_CHSPEC_D11AC_BND_MASK 0xc000 > > -#define BRCMU_CHSPEC_D11AC_BND_SHIFT 14 > > -#define BRCMU_CHSPEC_D11AC_BND_2G 0x0000 > > -#define BRCMU_CHSPEC_D11AC_BND_3G 0x4000 > > -#define BRCMU_CHSPEC_D11AC_BND_4G 0x8000 > > -#define BRCMU_CHSPEC_D11AC_BND_5G 0xc000 > > +#define BRCMU_CHSPEC_D11AC_BW_10 0x0800 > > +#define BRCMU_CHSPEC_D11AC_BW_20 0x1000 > > +#define BRCMU_CHSPEC_D11AC_BW_40 0x1800 > > +#define BRCMU_CHSPEC_D11AC_BW_80 0x2000 > > +#define BRCMU_CHSPEC_D11AC_BW_160 0x2800 > > +#define BRCMU_CHSPEC_D11AC_BW_320 0x0000 > > 320MHz is 802.11be. No need to add this already, but not a biggy. > > > +#define BRCMU_CHSPEC_D11AC_BW_8080 0x3000 > > +#define BRCMU_CHSPEC_D11AC_BND_MASK 0xc000 > > +#define BRCMU_CHSPEC_D11AC_BND_SHIFT 14 > > +#define BRCMU_CHSPEC_D11AC_BND_2G 0x0000 > > +#define BRCMU_CHSPEC_D11AC_BND_4G 0x8000 > > +#define BRCMU_CHSPEC_D11AC_BND_5G 0xc000 > > +#define BRCMU_CHSPEC_D11AC_BND_6G 0x4000 > > > > #define BRCMU_CHAN_BAND_2G 0 > > #define BRCMU_CHAN_BAND_5G 1 > > +#define BRCMU_CHAN_BAND_6G 2 > > > > enum brcmu_chan_bw { > > BRCMU_CHAN_BW_20, >