设置国家/地区以启用 Wi-Fi 通道 12 和 13

设置国家/地区以启用 Wi-Fi 通道 12 和 13

首先,我们使用的不是标准 Linux,而是 NXP 的嵌入式 Linux。

我们遇到的问题是我们无法设置国家/地区以启用频道 12 和 13。

我们已经安装了 CRDA,并且正在使用 Cypress (broadcom) 的 Wi-Fi 芯片组

问题:

当 Linux 启动时,我们没有启动 wlan0,因此 ifconfig 显示如下:

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

如果wlan0没有启用,我们可以更改区域国家:

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)

因此,如果我们检查 iw 列表,我们可以看到通道 12 和 13 已启用:

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)

问题是:当我们启动 wlan0 时,使用 ifup wlan0 或 ip lik set wlan0 up,iw 重置通道 11 和 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)

Broadcom 使用命令工具“wl”。只有当 wlan0 启动后,我们才能使用这个工具。如果我们检查可用频道,我们可以看到频道 11 和 12 不可用:

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

如果我们设置国家地区,使用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

我们可以看到频道 12 和 13 可用,但 iw 没有显示这些频道:

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)

如果我们尝试再次设置国家地区,则不起作用。

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)

问题:

1-为什么 ifup 更改/重置“频道”?在 ifup 期间加载“驱动程序”:

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-也许问题是我必须在启动 wlan0 接口之前执行 wl 工具,但如果接口未启动,wl 命令无法找到该接口。

谢谢你的时间。

答案1

问题出在司机身上。制造商确认了该错误。

相关内容