This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
iwlwifi/zh-cn
Warning: Display title "iwlwifi/zh-cn" overrides earlier display title "Iwlwifi".
iwlwifi 是Intel's current wireless chips的无线驱动
内核
To make it work some kernel configuration is needed. The driver supports 802.11a/b/g/n/ac (depending on the device), so IEEE 802.11 should be enabled.
IEEE 802.11
至少激活cfg80211 和 mac80211 。一些无线驱动程序也需要 rate control algorithm.
[*] Networking support ---> [*] Wireless ---> <*> cfg80211 - wireless configuration API [ ] nl80211 testmode command [ ] enable developer warnings [ ] cfg80211 regulatory debugging [ ] cfg80211 certification onus [*] enable powersave by default [ ] cfg80211 DebugFS entries [ ] use statically compiled regulatory rules database [ ] cfg80211 wireless extensions compatibility <*> Generic IEEE 802.11 Networking Stack (mac80211) [*] Minstrel [*] Minstrel 802.11n support [ ] Minstrel 802.11ac support Default rate control algorithm (Minstrel) ---> [ ] Enable mac80211 mesh networking (pre-802.11s) support -*- Enable LED triggers [ ] Export mac80211 internals in DebugFS [ ] Trace all mac80211 debug messages [ ] Select mac80211 debugging features ----
Minstrel 和 its 802.11n 支持 rate control algorithm.
Device driver iwlwifi
Use this driver for Intel's current wireless chips. Set it as a module <M>
as shown here. Also the correct DVM or MVM option according to the Module column of the firmware table is needed.
Device Drivers ---> [*] Network device support ---> --- Network device support [*] Wireless LAN ---> --- Wireless LAN [ ] ADMtek devices [ ] Atheros/Qualcomm devices [ ] Atmel devices [ ] Broadcom devices [ ] Cisco devices [*] Intel devices < > Intel PRO/Wireless 2100 Network Connection < > Intel PRO/Wireless 2200BG and 2915ABG Network Connection < > Intel Wireless WiFi 4965AGN (iwl4965) < > Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945) <M> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <M> Intel Wireless WiFi DVM Firmware support <M> Intel Wireless WiFi MVM Firmware support [ ] Enable broadcast filtering (NEW) [ ] Enable runtime power management mode for PCIe devices (NEW) Debugging Options ---> [ ] Intersil devices [ ] Marvell devices [ ] MediaTek devices [ ] Ralink devices [ ] Realtek devices [ ] Redpine Signals Inc devices [ ] STMicroelectronics devices [ ] Texas Instrument devices [ ] ZyDAS devices < > Simulated radio testing tool for mac80211 < > Wireless RNDIS USB support
In case the driver is built into the kernel (
<*>
) instead as a module (<M>
), also the firmware needs to be built into the kernel. See the section When using built-in configuration.
After changes on kernel configuration do not forget to rebuild the kernel.
After rebuilding the kernel and rebooting with this kernel, the selected options can be verified as follows:
Support for the /proc/config.gz pseudo-file is enabled through the Kernel/IKCONFIG_Support feature.
user $
zgrep 'IWLWIFI\|IWLDVM\|IWLMVM' /proc/config.gz
硬件
Also firmware for the individual device is needed as listed in this table. It is available in sys-kernel/linux-firmware and in device-specific sys-firmware/iwlxxxx-*ucode packages.
root #
emerge --ask sys-kernel/linux-firmware
When using built-in configuration
In case the driver is built into the kernel (<*>
) instead as a module (<M>
), also the firmware needs to be built into the kernel.
Device Drivers ---> Generic Driver Options ---> -*- Userspace firmware loading support [ ] Include in-kernel firmware blobs in kernel binary (iwlwifi-xxxx.ucode) External firmware blobs to build into the kernel binary (/lib64/firmware) Firmware blobs root directory [ ] Fallback user-helper invocation for firmware loading
In this case replace iwlwifi-xxxx.ucode
with the exact firmware name. Some attention seems to be needed for FW_LOADER_USER_HELPER_FALLBACK.
网络设备名称
内核提供的网络设备名称 eth0
, wlan0
等可以通过 /lib/udev/rules.d/80-net-name-slot.rules udev 规则在启动时更改参见 dmesg。
为了保持经典的命名,这个规则可以用 /etc/udev/rules.d 目录中用同样命名的空文件覆盖:
root #
touch /etc/udev/rules.d/80-net-name-slot.rules
测试
After a reboot with the new kernel or after loading the modules, the device can be checked for availability by using following methods:
- Using the /sys 文件系统
- Using the ip 命令
- Using the ifconfig 命令
- Using the iw 命令
/sys 文件系统
通过使用 ls -al 或 tree 命令(由app-text/tree 包提供))列出 /sys/class/net 目录内容来获取设备名称:
user $
tree /sys/class/net
/sys/class/net/ ├── enp2s14 -> ../../devices/pci0000:00/0000:00:1e.0/0000:02:0e.0/net/enp2s14 ├── lo -> ../../devices/virtual/net/lo ├── sit0 -> ../../devices/virtual/net/sit0 └── wlp8s0 -> ../../devices/pci0000:00/0000:00:1c.0/0000:08:00.0/net/wlp8s0
ip命令
To obtain the device name and verify that the wireless card is detected, execute the following ip command:
user $
ip addr
3: wlan0: ...
ifconfig 命令
ifconfig 命令是 sys-apps/net-tools 包提供的。使用 ifconfig -a列出所有检测到的网卡,即使那些尚未启用/尚未活动的网卡:
user $
ifconfig -a
wlan0 ...
网卡可以用下面的方法激活:
root #
ifconfig -v wlan0 up
SIOCSIFFLAGS: Operation not possible due to RF-kill WARNING: at least one error occurred. (-1)
In this example, enabling the wireless card failed as a radio frequency kill state is set (usually to keep power consumption at bay and not connect by accident to a wireless network).
iw命令
If the wireless network card driver supports the nl80211 stack, then the iw command as offered by the net-wireless/iw package can show the detected wireless cards:
root #
iw dev
phy#0 Interface wlan0 ifindex 4 type managed
modprobe and modinfo
modprobe should return nothing:
root #
modprobe iwlwifi
Most information about the driver module can be obtained by modinfo iwlwifi
user $
modinfo iwlwifi
lspci
lspci should display iwlwifi
for both Kernel driver in use:
and Kernel modules:
.
root #
lspci -nnkv | sed -n '/Network/,/^$/p'
03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] [8086:0082] (rev 34) Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN [8086:1321] Flags: bus master, fast devsel, latency 0, IRQ 33 Memory at f7d00000 (64-bit, non-prefetchable) [size=8K] Capabilities: [c8] Power Management version 3 Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [e0] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [140] Device Serial Number confidential Kernel driver in use: iwlwifi Kernel modules: iwlwifi
The xx:xx.x
identifier will be useful for grepping specific information from dmesg.
dmesg
Check the output of dmesg. Replace 03:00.0
with the identifier from lspci and wlp
with the network interface name.
user $
dmesg | grep -i -E '03:00.0|wlp|iwl|80211'
[ 1.200902] pci 0000:03:00.0: [8086:0082] type 00 class 0x028000 [ 1.201065] pci 0000:03:00.0: reg 0x10: [mem 0xf7d00000-0xf7d01fff 64bit] [ 1.201776] pci 0000:03:00.0: PME# supported from D0 D3hot D3cold [ 1.201999] pci 0000:03:00.0: System wakeup disabled by ACPI [ 18.260461] iwlwifi 0000:03:00.0: enabling device (0100 -> 0102) [ 18.260598] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control [ 18.419884] iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1 op_mode iwldvm [ 18.671329] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG enabled [ 18.671330] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS enabled [ 18.671330] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled [ 18.671332] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Advanced-N 6205 AGN, REV=0xB0 [ 18.673421] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled [ 18.705882] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs' [ 18.706468] iwlwifi 0000:03:00.0 wlp3s0: renamed from wlan0 [ 23.286871] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready ......... snip ......... [ 48.176954] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready [ 92.720710] wlp3s0: authenticate with my WLAN AP [ 92.724440] wlp3s0: send auth to my WLAN AP (try 1/3) [ 92.728436] wlp3s0: authenticated [ 92.728646] wlp3s0: waiting for beacon from my WLAN AP [ 92.821389] wlp3s0: associate with my WLAN AP (try 1/3) [ 92.828148] wlp3s0: RX AssocResp from my WLAN AP (capab=0x431 status=0 aid=4) [ 92.853124] wlp3s0: associated [ 92.853173] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready
故障排除
内核未加载
检查是否加载了正确的内核。这可以如下完成(取决于IKCONFIG feature):
user $
zgrep CONFIG_IWL /proc/config.gz
固件问题
- For systems using udev or systemd, it is imperative to configure the kernel to load binary blobs. In this case the wireless card's firmware is the firmware that needs loaded. More information on configuring the kernel in this manner can be found in the following thread on the Gentoo forums: FW_LOADER_USER_HELPER_FALLBACK.
无线网络不工作
- Intel Corporation Wireless 8260 (rev 3a) can't access the RSA semaphore it is write protected
参考
- Handbook:AMD64/Networking/Wireless
- wifi
- wpa_supplicant — a wifi supplicant to handle network authentication.
- Network management using DHCPCD
- netifrc
- Troubleshooting