有些东西一直在改变我的无线监管范围

有些东西一直在改变我的无线监管范围

我有一台 Thinkpad T450s 和 KXStudio(Ubuntu+KDE)。我的连接经常中断,我认为问题与频繁的 CRDA 呼叫有关。我住在德国,但不知为何我的电脑似乎真的很喜欢美国(或者更确切地说是国际前缀 00)!

以下是典型的输出dmesg

[  404.422554] wlan0: deauthenticated from 78:8d:f7:28:5b:48 (Reason: 6)
[  404.433563] cfg80211: Calling CRDA to update world regulatory domain
[  404.435411] cfg80211: World regulatory domain updated:
[  404.435413] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[  404.435415] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  404.435416] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  404.435417] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[  404.435418] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  404.435419] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  404.435429] cfg80211: Calling CRDA for country: DE
[  404.437056] cfg80211: Regulatory domain changed to country: DE
[  404.437060] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[  404.437062] cfg80211:   (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  404.437064] cfg80211:   (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  404.437066] cfg80211:   (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  404.437068] cfg80211:   (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
[  404.437069] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
[  414.946644] wlan0: authenticate with 78:8d:f7:28:5b:48
[  414.950643] wlan0: send auth to 78:8d:f7:28:5b:48 (try 1/3)
[  415.059726] wlan0: send auth to 78:8d:f7:28:5b:48 (try 2/3)
[  415.065667] wlan0: authenticated
[  415.066268] wlan0: associate with 78:8d:f7:28:5b:48 (try 1/3)
[  415.089862] wlan0: RX AssocResp from 78:8d:f7:28:5b:48 (capab=0xc11 status=0 aid=2)
[  415.105275] wlan0: associated
[  415.105430] cfg80211: Calling CRDA for country: US
[  415.110984] cfg80211: Regulatory domain changed to country: US
[  415.110992] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[  415.110996] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[  415.111000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[  415.111004] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  415.111007] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  415.111010] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  415.111013] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[  415.111016] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
[  419.277506] wlan0: deauthenticating from 78:8d:f7:28:5b:48 by local choice (reason=3)
[  419.281900] cfg80211: Calling CRDA to update world regulatory domain
[  419.285000] cfg80211: World regulatory domain updated:
[  419.285003] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[  419.285005] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  419.285007] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  419.285008] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[  419.285010] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  419.285011] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  419.285024] cfg80211: Calling CRDA for country: DE
[  419.287014] cfg80211: Regulatory domain changed to country: DE
[  419.287017] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[  419.287018] cfg80211:   (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  419.287019] cfg80211:   (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  419.287020] cfg80211:   (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  419.287020] cfg80211:   (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
[  419.287021] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)

以下是典型的输出udevadm monitor --environment kernel

KERNEL[316.218832] change   /devices/platform/regulatory.0 (platform)
ACTION=change
COUNTRY=DE
DEVPATH=/devices/platform/regulatory.0
MODALIAS=platform:regulatory
SEQNUM=2334
SUBSYSTEM=platform

UDEV  [316.219479] change   /devices/platform/regulatory.0 (platform)
ACTION=change
COUNTRY=00
DEVPATH=/devices/platform/regulatory.0
MODALIAS=platform:regulatory
SEQNUM=2333
SUBSYSTEM=platform
USEC_INITIALIZED=6216391

UDEV  [316.221855] change   /devices/platform/regulatory.0 (platform)
ACTION=change
COUNTRY=DE
DEVPATH=/devices/platform/regulatory.0
MODALIAS=platform:regulatory
SEQNUM=2334
SUBSYSTEM=platform
USEC_INITIALIZED=18676

KERNEL[319.092483] change   /devices/platform/regulatory.0 (platform)
ACTION=change
COUNTRY=US
DEVPATH=/devices/platform/regulatory.0
MODALIAS=platform:regulatory
SEQNUM=2335
SUBSYSTEM=platform

UDEV  [319.096341] change   /devices/platform/regulatory.0 (platform)
ACTION=change
COUNTRY=US
DEVPATH=/devices/platform/regulatory.0
MODALIAS=platform:regulatory
SEQNUM=2335
SUBSYSTEM=platform
USEC_INITIALIZED=92541

/etc/default/crda我已经在德国设置了,但是crda返回:

COUNTRY environment variable not set.

如果我跑步export COUNTRY=DE并且crda得到:

Failed to set regulatory domain: -28

但问题(我认为)是其他问题:为什么 CRDA 如此频繁地被调用?由什么调用?为什么它被美国调用?

答案1

我认为至少有三件事会影响 CRDA。首先,正如您所知,文件 /etc/default/crda 应该有一行未注释的内容:

REGDOMAIN=DE

其次,模块 cfg80211 出现问题消息;让我们尝试修复它:

sudo -i
echo "options cfg80211 ieee80211_regdom=DE"  >  /etc/modprobe.d/cfg80211.conf
exit

最后,由于您的无线接口是“受管理的”,即由路由器管理信道、比特率等,我强烈怀疑如果路由器或更确切地说是其固件是为美国使用而制造的,则路由器会设置 CRDA,仅允许使用某些信道。我建议您从路由器制造商的德国或至少欧洲网站更新固件,看看是否有帮助。重新启动路由器。

重新启动并查看连接是否改善。CRDA 只是我为解决类似问题而提出的建议之一。如果您的问题未得到解决,我很乐意继续。

编辑:我遇到了这个,这可能会有所帮助:https://bbs.archlinux.org/viewtopic.php?id=124574

此外,就我个人而言,在 USB 无线中,所有试图覆盖 CRDA 的尝试都失败了。国家代码显然是硬编码在设备 ROM 中的。我唯一能连接的方式是检查消息

cfg80211: Calling CRDA for country: CN

然后设置相同的区域:

sudo iw reg set CN

USB 立即连接。

相关内容