Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1146699rdb; Fri, 20 Oct 2023 09:35:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvQgA7n3kWP9Or7LJvxEQfUD7QslxBn9cryYAsFzvPO2py3n1mq7MBxkwDSgjVEFhsm/gQ X-Received: by 2002:a17:902:cecc:b0:1ca:7909:6eda with SMTP id d12-20020a170902cecc00b001ca79096edamr3228242plg.23.1697819743482; Fri, 20 Oct 2023 09:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697819743; cv=none; d=google.com; s=arc-20160816; b=eQvSKgvUiz0wDv9ASsrlCJC8OJZ9PyNjGBYGzSUGhxQxrB3boNbz3X8NRIRY6L+8+g 28M2dk+Fjs1i2CYU2QrmgvVPc8v112fXZCHXcDv69YzONytUE/ykPv9rXlH6nY2die4H 4t8p7vmNdx6PcMiTBLw+L/+CaEf3KRyhj2J3W3LjBpd4tXvCOL7vu3529S27qxeyXIep akMWAIM4JCTwNCFkBYT13/CLzYEEVcV3YktviX4UhyAqhnKcAMa+wJz2o5nO3vLMzinW NRTUeqCNyOZcyi6PBe002PRilxb7h/hxxWwTvfEdQVuHfiI1SN4YRC9nQbFk7YuQtRTX HEJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Jp6YfYGoVMtTsSCroLFUYhmimeWjcHuUGyEJ+OCnT1g=; fh=qJotNKxq/9J27AySKlDZCVKXUIjdeWpUF8dOMvUIxYc=; b=CNNdzUBffhmYlpVo9L9VQ++KFK+gTh9LyvU1uktQ7FlDjkkGLnCaD5RNC6PwROAazj ow6gsT33KKCoXALU5z03mtZFprUPqrTaSvAoD7QYF0Nr7zuKhzsnR8q8/GvUL4Jh0oYJ 9to4IyAFtR3YzrzsBvD0OMy8HEVAcB1O41wg0BmV4ko/jag3NT3GI4JBbyg6v23Kzxj4 tvKGq4k8l7lbYX1vCUG/nosKtOdxj6WetFYM0JHXvn2OHAVpPicCg0dPgq3T0MugVQ6+ 1rJxYzS2j2XIUhu8+4hxsceSDXbkHuCTcoXc8D4Qy+4X7dUt2Z+eR/yItNrH6+lvzu9z 9o8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dberlin.org header.s=google header.b=gqKe6wDI; 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 n10-20020a170902e54a00b001c895ddcdcasi2195434plf.544.2023.10.20.09.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 09:35:43 -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=gqKe6wDI; 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 B3879833CE25; Fri, 20 Oct 2023 09:35:40 -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 S229795AbjJTQfd (ORCPT + 52 others); Fri, 20 Oct 2023 12:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjJTQfb (ORCPT ); Fri, 20 Oct 2023 12:35:31 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 955BDD5E for ; Fri, 20 Oct 2023 09:35:29 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c54c8934abso15117641fa.0 for ; Fri, 20 Oct 2023 09:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dberlin.org; s=google; t=1697819728; x=1698424528; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Jp6YfYGoVMtTsSCroLFUYhmimeWjcHuUGyEJ+OCnT1g=; b=gqKe6wDI4X0t/jcjf+IcWV5pToIAmV4zvN+4lM+E74i2p9na72KiW7PJ/F68np8mXC Zi6hNo+I5JTXCbWiUlnByPqResw1eVp8mcUjeFWuUGoGDVpZCNU9uDOsXRrKRtExXa9I 02UivF40ZIMyYFbtTAidEEKvx79D2jLhvbipuIynkQo/yBDS0zLvI0G/nUULD3dwPM7Q TDFjMzhjtjOtvp4qSYt4DbJmZDXPkEIUKE+W1SJVLZvQ/6Iwz4bF71pzWriqrSdhCrxU osts/z4fGLedt8n/Hi3scAYmnuNwlzBIBylSvzMmRKwRVFaGh1k0RFIb5X0Q3KJdYuW0 eQpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697819728; x=1698424528; h=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=Jp6YfYGoVMtTsSCroLFUYhmimeWjcHuUGyEJ+OCnT1g=; b=N9kFwUE7WApEAupq6wBL6toXd+pHKSIXynA7wZ6aI5vy1xymg5OPd/WsVmCxv8ewtw fZGequJUgDdjMmH+f6mmGQABfXPC7qeFiOHVL6BqCC60kPyeLhUgCK93/xTMG5rrUvy5 f48ekRC8Ppr++OT0OYYX8+r5Wtxis4QqQkic+nA+cju43blxuZjD8+/1ZmobI7EuiQ+N qxFGUdgYZh64MmQo6V/oLhN13Io7WYGIxctxkmDRQ+TD0HuflBm6mPYn+Zb8ts4TdGBP T3b6nPDh/q2kQkT+umleyMTJg0UMZlFSAucE/jFBr/D+I3LWUg5mLNVUZE/KUZg86Hi+ QCTA== X-Gm-Message-State: AOJu0YwaxRLjbd66qSOJao3aYeJK66zwi243kqdh3/Y/BSGFiUVnQTqq UkYRp5DeXdhrQXWBfbmmDzaYHBouF5NpiJadQsPXTA== X-Received: by 2002:a05:651c:198c:b0:2c0:2f51:cb97 with SMTP id bx12-20020a05651c198c00b002c02f51cb97mr1972942ljb.6.1697819727424; Fri, 20 Oct 2023 09:35:27 -0700 (PDT) MIME-Version: 1.0 References: <52c993fd93e13ac015be935a5284294c9a74ea8e.1697650207.git.dberlin@dberlin.org> In-Reply-To: From: Daniel Berlin Date: Fri, 20 Oct 2023 12:35:16 -0400 Message-ID: Subject: Re: [PATCH 2/5] [brcmfmac] Add support for 6G bands 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" 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:35:40 -0700 (PDT) > > > maybe handle channel 2 here as well, ie.: > .center_freq = ((_channel) == 2) ? 5935 : 5950 + (5 * (_channel)), > > > + .hw_value = (_channel), \ > > + .max_antenna_gain = 0, \ > > + .max_power = 30, \ > > +} > > so we can drop this one below... > Will do. > > > > + /* We ignore this BSS ID rather than try to continue on. > > + * Otherwise we will cause an OOPs because our frequency is 0. > > + * The main case this occurs is some new frequency band > > + * we have not seen before, and if we return an error, > > + * we will cause the scan to fail. It seems better to > > + * report the error, skip this BSS, and move on. > > + */ > > + return 0; > > + } > > bss_data.chan = ieee80211_get_channel(wiphy, freq); > > How could this fail? Our wiphy registers all possible channels so if > ieee80211_channel_to_frequency() succeeds ieee80211_get_channel() can > not fail. I agree. > > > > @@ -6965,6 +7066,10 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg, > > for (i = 0; i < band->n_channels; i++) > > band->channels[i].flags = IEEE80211_CHAN_DISABLED; > > band = wiphy->bands[NL80211_BAND_5GHZ]; > > + if (band) > > Eh. Why is this conditional? We are creating all bands in the wiphy > instance so why the null check here? I just matched what was there, I can remove all of them if we want. (I'll take care of the rest of the comments between here) > > > - brcmf_dbg(INFO, "nmode=%d, vhtmode=%d, bw_cap=(%d, %d)\n", > > + brcmf_dbg(INFO, > > + "nmode=%d, vhtmode=%d, bw_cap=(%d, %d, %d), he_cap=(%d, %d)\n", > > nmode, vhtmode, bw_cap[NL80211_BAND_2GHZ], > > - bw_cap[NL80211_BAND_5GHZ]); > > + bw_cap[NL80211_BAND_5GHZ], bw_cap[NL80211_BAND_6GHZ], > > + he_cap[0], he_cap[1]); > > So are these he mac and phy capabilities? ... No, unfortunately, it's either 1 or 0 on these chips, and all chips i tested. This is the hardware capability iovar. In the debug firmware i have access to (not apple's), i do see a command that looks like it may give the he cap, but i can't find how it would ever be triggered. (The iovar code for the iovar above is either always just return 0 or return 1) There are no obvious iovars that relate, and the absolute latest bcmdhd hardcodes the he caps, as do infineon's latest ifx code. :( I'l hack around see if i can get the caps out of it. I'll double check other ones. > > @@ -8331,18 +8589,21 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, > > if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_DUMP_OBSS)) > > ops->dump_survey = brcmf_cfg80211_dump_survey; > > > > - err = wiphy_register(wiphy); > > - if (err < 0) { > > - bphy_err(drvr, "Could not register wiphy device (%d)\n", err); > > - goto priv_out; > > - } > > - > > + /* We have to configure the bands before we register the wiphy device > > + * because it requires that band capabilities be correct. > > + */ > > Is it? If you register the 6g band without he_cap set, 80211 is unhappy. It sanity checks the bands in wiphy_register, and we get caught in the HE supported check for 6g. See here: https://elixir.bootlin.com/linux/latest/source/net/wireless/core.c#L823 In general, you can see it sanity checks the bands/etc as part of registration. It happens that 6g triggers the he one, but it seems in general the bands are supposed to be sane before registration. > The order was deliberate. brcmf_setup_wiphybands() calls > brcmf_construct_chaninfo() which disables all channels. When you do that > before wiphy_register() the orig_flags of the channel will be DISABLED > and can never be used. I'll take care of this by copying the flags around. > > > err = brcmf_setup_wiphybands(cfg); > > if (err) { > > bphy_err(drvr, "Setting wiphy bands failed (%d)\n", err); > > goto wiphy_unreg_out; > > } > > > > + err = wiphy_register(wiphy); > > + if (err < 0) { > > + bphy_err(drvr, "Could not register wiphy device (%d)\n", err); > > + goto priv_out; > > + } > > + > > /* If cfg80211 didn't disable 40MHz HT CAP in wiphy_register(), > > * setup 40MHz in 2GHz band and enable OBSS scanning. > > */ >