Comment 2 for bug 1646961

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'.