brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code

Bug #1646961 reported by Cristian Aravena Romero
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Raspbian
Incomplete
Undecided
Paolo Pisati

Bug Description

Open bug:
https://bugzilla.kernel.org/show_bug.cgi?id=189581

[ 1928.362187] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code

Revision history for this message
Guy Taylor (thebiggerguy) wrote :

So it looks like the Kernel is doing the right thing and filtering out invalid ISO country codes (code at https://github.com/torvalds/linux/blob/v4.10/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c#L6705 ).

Via https://wireless.wiki.kernel.org/en/users/drivers/brcm80211#regulatory_implementation_for_brcmsmac I have found a reference to a "X2" country code that is "special" for this chipset. If this is the issue, the "2" in the "special" country code breaks this assertion that only A-Z are valid. The upstream Kernel does have additional logging that would confirm this hypothesis.

Also of note is this patch that adds the extra debugging info may fix this issue in question. https://patchwork.kernel.org/patch/8336131/

What would it take to get https://patchwork.kernel.org/patch/8336131/ applied?

Paolo Pisati (p-pisati)
Changed in raspbian:
assignee: nobody → Paolo Pisati (p-pisati)
Revision history for this message
Paolo Pisati (p-pisati) wrote :

I'm confused about this bug / patch cause in drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c::brcmf_cfg80211_reg_notifier():

        /* ignore non-ISO3166 country codes */
        for (i = 0; i < sizeof(req->alpha2); i++)
                if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
                       brcmf_err("not a ISO3166 code\n");
                        return;
                }

we hit that condition when the conuntry code is out of the A-Z range,
but the patch that is supposed to fix it, actually doesn't change that:

        /* ignore non-ISO3166 country codes */
        for (i = 0; i < sizeof(req->alpha2); i++)
                if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
- brcmf_err("not a ISO3166 code\n");
+ brcmf_err("not a ISO3166 code (0x%02x 0x%02x)\n",
+ req->alpha2[0], req->alpha2[1]);
                        return;
                }

it just slightly modify the warning and, again, return immediately.

Anyhow, i printed out the country code:

- brcmf_err("not a ISO3166 code (0x%02x 0x%02x)\n",
+ brcmf_err("not a ISO3166 code (%c%c)\n",

...
[ 7.670455] brcmf_c_preinit_dcmds: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
[ 7.726720] brcmf_cfg80211_reg_notifier: not a ISO3166 code (00)
...

and we get '00' per country code, not 'X2'.

Revision history for this message
Paolo Pisati (p-pisati) wrote :

On top of that, can you actually tell me what this bug is about?

What's the problem? What's the expected behaviour and how to test it?

Thanks.

Changed in raspbian:
status: New → Incomplete
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

I can see this message from dmesg command on a AMD64 system as well, so I think it's not limited to this raspbian project.

This happens every time when I disconnect from a WiFi AP.

The chip on this system is BCM4350 [14e4:43a3]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.