Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp71543pxb; Tue, 7 Sep 2021 18:03:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymLTh7XKYDYth3qN0Ke697QsI5tvFhc0LZ/M9v7LveXy8BipePAISU7Fme40ux/JB5iknk X-Received: by 2002:a02:908a:: with SMTP id x10mr1110117jaf.30.1631063004087; Tue, 07 Sep 2021 18:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631063004; cv=none; d=google.com; s=arc-20160816; b=R1OH0ipfqEhQ6Q5zIGmZpGf2KZip7sG3MrySutMizH5QgUUeFjQS2WUR/Wy18t28QE y/ddPE0PqV0dFow/ZSptk/mqkREK2iAs6Fjw2evcrycDbP6CBIs+eIpBNulo1STatQ0K swJF6ViREsepwaWXms6lz61MaoWPhnAt+omep+0IME5FcCXDENBNUGfnsETs10v3jG1+ QJudvkhiDGXSg56KDS5A7f3ctmng9xdyU7IVRi0DKzCZRFYuNmlKqbi5mOB4FIUngCBl mHpOwTCpZuAP9fFVZMqgN2JlzOwl7vPn3KJUws6/47s4egdlELO2CA2vB83bQ746axXI BCig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fL7IHHdZ/gzoOTGUPxPDxAU1KAMX+gAeeQ7IEIgS92I=; b=cRgz2Q5fDRfzlcRek3gAFSs4adISYRfrm/Kv9ZGtDrtsF+dIZWslDyrJvEabZix6Gz 1Ir9/o+X1VOZhyMAOwAMCsOVbzE6f3F7sI/6dizK69U4Ii38WDitXg4Mg/2onpsQe2lt RGK4b80XieckLsDeF+Xkm3lhtfQ7T8bBqctyGA6KsWu3KHTEQHhPqwWifgGHrMdEgHcf JdLuPm4Ao/hG52aTK8HpWlwzyn5A+2iiQhshMLncZqI62DvJZiZm4nv/5ysyKJFfRKPf +MxV1sUfLYE3VIMSpNK1HgPblpiypDDZj8bttiBEcWvKxYCMISh12DWsppftO1ElcG1X 9GJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fUGYNrjW; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 20si528352ioz.25.2021.09.07.18.03.03; Tue, 07 Sep 2021 18:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fUGYNrjW; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345948AbhIHBCP (ORCPT + 99 others); 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-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]; >