From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFB9AC433EF for ; Wed, 8 Sep 2021 01:04:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEB1861139 for ; Wed, 8 Sep 2021 01:04:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AEB1861139 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3VKcJILLhkVVVnBzg06SMBgtqqheMh0qkIe+8NDn7Gw=; b=d6t/d7xNPY5+Nd Wq15Xa604+OzbjQNfeYXaU5GduFID9IZmusL03A+Ir5qhjgftmcx8+vRykR2HYhzDAVXTjD9UpwdU 6r13OPU4sdWGkGgxDn4ryV91AX2sDt+A9y44rVfGXaSQf0PL2hU4epCOB6bmO0LwWuXlOrjVEuJy2 AhHq99HMVclyF91vY84Qe3fmT1zRBTvFhgCKyf32NZyAHC7f0pnKcpyHV+kK6gxpRQidmcAghrGWV Yd/m8nRUIB6RtINcNR6UtZ9NEymZam95LMCy/QDd5xut/dEg7AClGaflrV68uHxnqQaucQkntN+td OY4eJ7DMDR7cKPf5pDJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNlxh-0056sY-H9; Wed, 08 Sep 2021 01:01:13 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNlxd-0056s5-QT for linux-arm-kernel@lists.infradead.org; Wed, 08 Sep 2021 01:01:11 +0000 Received: by mail-pl1-x636.google.com with SMTP id u1so249091plq.5 for ; Tue, 07 Sep 2021 18:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=fL7IHHdZ/gzoOTGUPxPDxAU1KAMX+gAeeQ7IEIgS92I=; b=fUGYNrjWnrb3I1eaPcRpBHa5uCveys5QZgedEq6FkqjUD4OZbSwa4C3wVTN3Ea0J1E NEeFEDtPtBpxrAKvOWTnaDwo2B2v/P/5kd5YLX/XwbKcaO8nplHt67j6ZHZVQpMteY+4 0eAtp+P3YO9W747F5K61gMUrXOoE1IA72GO8EM4UhZ02fP45WR68o9G/TsFy4xh+tT6j 8Gh/i3SW9y/vNeQtT6qSMbCQ9H+zzZF6E2bhHT6OyoUZ3m6dfTL3zikE4O0/Fj8Ue6Rj Bh5cOEbzVLnmPBaFdSs4A1+vikjxpd4fQt9bHyJ402yyWqWjZTTapx4aTi1GtG/PfSRF MbAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=fL7IHHdZ/gzoOTGUPxPDxAU1KAMX+gAeeQ7IEIgS92I=; b=cUc6XovkbMFGJC7sndYyTDzrF2G0b8Pd7TskDV/C0nJisXQ0MvEUIO+EaWKaUovl6t 9vqU3ThPANWI2lNOig3kz+UOqQaltHwikHOYSG5vKmMJP2dcznxBDf/1v0DNN6GkyvzT YgvBqUijufyz0EUOHWV1zCrBh9X95TH/TUCJbRYZxrrYMTm6c4TLIkZDteYgoJJzhSF6 eMA8eMopdn57xpf+TiXdQT+nLTHV+EnWoKQ9HkkCjEfCsM+FJRsxv9WBEneqE4e/98DZ s8/G00JqY37BEg0SeSTeTdnuTCzy5a6b30eAbacqsaCb96+bu22P7hC4QmtM4bQOKsZe wYJw== X-Gm-Message-State: AOAM533r8g+MyJBMTSRhXGtSViIFH7gPFulCeb59cN93WhCR5j+fwagO svrjZx9xeHtQPr/A17zsDGsD7Q== X-Google-Smtp-Source: ABdhPJzn6dDaPFPvD6xD3dX6BMiDBYlT3VapdFvc9aR8lJIc1mWPZRw21Ia813useTb+MqcxrF740A== X-Received: by 2002:a17:90b:33c8:: with SMTP id lk8mr1221312pjb.241.1631062867247; Tue, 07 Sep 2021 18:01:07 -0700 (PDT) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id g2sm239957pfo.154.2021.09.07.18.01.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Sep 2021 18:01:06 -0700 (PDT) Date: Wed, 8 Sep 2021 09:00:58 +0800 From: Shawn Guo To: Soeren Moch Cc: Kalle Valo , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-rockchip@lists.infradead.org" Subject: Re: [BUG] Re: [PATCH] brcmfmac: use ISO3166 country code and 0 rev as fallback Message-ID: <20210908010057.GB25255@dragon> References: <20210425110200.3050-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210907_180109_972107_230940C7 X-CRM114-Status: GOOD ( 29.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Soeren, On Tue, Sep 07, 2021 at 09:22:52PM +0200, Soeren Moch wrote: > On 25.04.21 13:02, Shawn Guo wrote: > > Instead of aborting country code setup in firmware, use ISO3166 country > > code and 0 rev as fallback, when country_codes mapping table is not > > configured. This fallback saves the country_codes table setup for rece= nt > > brcmfmac chipsets/firmwares, which just use ISO3166 code and require no > > revision number. > This patch breaks wireless support on RockPro64. At least the access > point is not usable, station mode not tested. > = > brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4359/9 wl0: Mar=A0 6 2017 > 10:16:06 version 9.87.51.7 (r686312) FWID 01-4dcc75d9 > = > Reverting this patch makes the access point show up again with linux-5.14= . Sorry for breaking your device! So it sounds like you do not have country_codes configured for your BCM4359/9 device, while it needs particular `rev` setup for the ccode you are testing with. It was "working" likely because you have a static `ccode` and `regrev` setting in nvram file. But roaming to a different region will mostly get you a broken WiFi support. Is it possible to set up the country_codes for your device to get it work properly? Shawn > = > Regards, > Soeren > > Signed-off-by: Shawn Guo > > --- > > .../broadcom/brcm80211/brcmfmac/cfg80211.c | 17 +++++++++++------ > > 1 file changed, 11 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.= c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > > index f4405d7861b6..6cb09c7c37b6 100644 > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > > @@ -7442,18 +7442,23 @@ static s32 brcmf_translate_country_code(struct = brcmf_pub *drvr, char alpha2[2], > > s32 found_index; > > int i; > > > > - country_codes =3D drvr->settings->country_codes; > > - if (!country_codes) { > > - brcmf_dbg(TRACE, "No country codes configured for device\n"); > > - return -EINVAL; > > - } > > - > > if ((alpha2[0] =3D=3D ccreq->country_abbrev[0]) && > > (alpha2[1] =3D=3D ccreq->country_abbrev[1])) { > > brcmf_dbg(TRACE, "Country code already set\n"); > > return -EAGAIN; > > } > > > > + country_codes =3D drvr->settings->country_codes; > > + if (!country_codes) { > > + brcmf_dbg(TRACE, "No country codes configured for device, using ISO3= 166 code and 0 rev\n"); > > + memset(ccreq, 0, sizeof(*ccreq)); > > + ccreq->country_abbrev[0] =3D alpha2[0]; > > + ccreq->country_abbrev[1] =3D alpha2[1]; > > + ccreq->ccode[0] =3D alpha2[0]; > > + ccreq->ccode[1] =3D alpha2[1]; > > + return 0; > > + } > > + > > found_index =3D -1; > > for (i =3D 0; i < country_codes->table_size; i++) { > > cc =3D &country_codes->table[i]; > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel