O problema estava no driver. O fabricante confirmou o bug.
Primeiro, não estamos usando um linux padrão, estamos usando um linux embutido do NXP.
O problema que temos é que não podemos definir a região do país para ativar os canais 12 e 13.
Instalamos o CRDA e estamos usando um chipset Wi-Fi da Cypress (broadcom)
O problema:
Quando o Linux é inicializado, não temos o wlan0 ativado, então o ifconfig mostra isso:
13:52:15 root@i:~> ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%1995577040/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:256 errors:0 dropped:0 overruns:0 frame:0
TX packets:256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18944 (18.5 KiB) TX bytes:18944 (18.5 KiB)
13:58:41 root@i:~> iw dev
phy#0
Interface wlan0
ifindex 4
wdev 0x1
addr 00:90:4c:11:22:33
type managed
Se o wlan0 não estiver ativado, podemos alterar o país da região:
iw reg set JP
13:54:15 root@i:~> cfg80211: Regulatory domain changed to country: JP
cfg80211: DFS Master region: JP
cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), ( dfs_cac_time)
cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
cfg80211: (4910000 KHz - 4990000 KHz @ 40000 KHz), (N/A, 2300 mBm), (N/A)
cfg80211: (5030000 KHz - 5090000 KHz @ 40000 KHz), (N/A, 2300 mBm), (N/A)
cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2300 mBm), (0 s)
Então, se verificarmos a lista do iw, podemos ver que os canais 12 e 13 estão ativados:
13:58:27 root@i:~> iw list |grep MHz
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (20.0 dBm)
O problema é: Quando trazemos o wlan0, usando ifup wlan0 ou ip lik set wlan0, o iw reinicia os canais 11 e 12:
14:01:53 root@i:~> iw list |grep MHz
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
A Broadcom usa a ferramenta de comando "wl". Nós só podemos usar esta ferramenta, uma vez que o wlan0 esteja ativo. Se verificarmos os canais disponíveis, podemos ver que os canais 11 e 12 não estão disponíveis:
14:02:03 root@i:~> wl chan_info
Channel 1 B Band
Channel 2 B Band
Channel 3 B Band
Channel 4 B Band
Channel 5 B Band
Channel 6 B Band
Channel 7 B Band
Channel 8 B Band
Channel 9 B Band
Channel 10 B Band
Channel 11 B Band
Se definirmos a região do país, usando wl:
14:03:32 root@i:~> wl country GB
14:04:25 root@i:~> wl chan_info
Channel 1 B Band
Channel 2 B Band
Channel 3 B Band
Channel 4 B Band
Channel 5 B Band
Channel 6 B Band
Channel 7 B Band
Channel 8 B Band
Channel 9 B Band
Channel 10 B Band
Channel 11 B Band
Channel 12 B Band
Channel 13 B Band
Podemos ver que os canais 12 e 13 estão disponíveis, mas o iw não está exibindo esses canais:
14:01:53 root@i:~> iw list |grep MHz
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
Se tentarmos definir novamente a região do país, isso não funcionará.
14:07:55 root@i:~> iw reg set GB
14:08:01 root@i:~> cfg80211: Regulatory domain changed to country: GB
cfg80211: DFS Master region: ETSI
cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
14:01:53 root@i:~> iw list |grep MHz
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
Perguntas:
1-Por que ifup muda / redefine os "canais"? Durante o ifup, o 'driver' é carregado:
13:59:45 root@i:~> ifup wlan0
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
Dongle Host Driver, version 1.141.92 (r)
Compiled in drivers/net/wireless/bcmdhd
wl_android_wifi_on in
mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (6 bytes)
F1 signature OK, socitype:0x1 chip:0xa9a6 rev:0x1 pkg:0x3
DHD: dongle ram size is set to 524288(orig 524288) at 0x0
dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
wifi_platform_get_mac_addr
Firmware up: op_mode=0x0005, MAC=60:f1:89:cb:cb:17
Firmware version = wl0: Dec 11 2014 04:20:45 version 7.10.323.34 (r520360) FWID 01-ea2beeba
dhd_wlfc_init(): successfully enabled bdcv2 tlv signaling, 79
dhd_wlfc_init: query wlfc_mode succeed, fw_caps=0x1c
dhd_wlfc_init(): wlfc_mode=0x1c, ret=0
CFG80211-ERROR) wl_update_wiphybands : error reading vhtmode (-23)
wl_create_event_handler(): thread:wl_event_handler:246 started
CFG80211-ERROR) wl_event_handler : tsk Enter, tsk = 0x8a46143c
2-Talvez o problema seja que eu tenho que executar a ferramenta wl antes de abrir a interface wlan0, mas o comando wl não consegue encontrar a interface se ela não estiver ativa.
Obrigado pelo seu tempo.
O problema estava no driver. O fabricante confirmou o bug.