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=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 9CCADC433F5 for ; Wed, 8 Sep 2021 01:01:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A4F9603E7 for ; Wed, 8 Sep 2021 01:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345948AbhIHBCP (ORCPT ); Tue, 7 Sep 2021 21:02:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232947AbhIHBCO (ORCPT ); Tue, 7 Sep 2021 21:02:14 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B84C7C061575 for ; Tue, 7 Sep 2021 18:01:07 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id bg1so228143plb.13 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=SkHfFR/CgiQaVXxszlX2kEJJMC5FsovJ8bOzCIJpnrrc4BA/SgCxZKUZz5J3xKV1Pf LuxU+Tutirj7Tgr4ysv4KOWovlmEDgicWoNJB+eUo1RgKNwBRSCSXsFn/EElrZe/Sp9j ei/rn6i15swnT1DCzwHWJlLwXxBpxr4H0eoGYigxY6wlhh9K614uNlRF3E+89Q248vz3 RXlA8MHuBcp1Dg6BkNTCc6bipr+GNdLGEKqZKlnVYwTI61kyysZcW7u7YPaQwj07eual nO4MIBvq9tlSk3JW8FNQO3EaJx0cwjnvlSicSQCYrsKTLLZ70fsNp8yRgP73CPWoGuvo 0mUw== X-Gm-Message-State: AOAM533YALBZRhjHBYoGZFTHjnsk70IcUjmh6zhQdGMKc5CJkA76CuXf vXmJ/udVh7BtHwPw2HrMm+B66w== 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-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 recent > > 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  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 = drvr->settings->country_codes; > > - if (!country_codes) { > > - brcmf_dbg(TRACE, "No country codes configured for device\n"); > > - return -EINVAL; > > - } > > - > > if ((alpha2[0] == ccreq->country_abbrev[0]) && > > (alpha2[1] == ccreq->country_abbrev[1])) { > > brcmf_dbg(TRACE, "Country code already set\n"); > > return -EAGAIN; > > } > > > > + country_codes = drvr->settings->country_codes; > > + if (!country_codes) { > > + brcmf_dbg(TRACE, "No country codes configured for device, using ISO3166 code and 0 rev\n"); > > + memset(ccreq, 0, sizeof(*ccreq)); > > + ccreq->country_abbrev[0] = alpha2[0]; > > + ccreq->country_abbrev[1] = alpha2[1]; > > + ccreq->ccode[0] = alpha2[0]; > > + ccreq->ccode[1] = alpha2[1]; > > + return 0; > > + } > > + > > found_index = -1; > > for (i = 0; i < country_codes->table_size; i++) { > > cc = &country_codes->table[i]; >