Linux WIFI模块驱动移植_wl_cfg80211_netdev_notifier_call : wdev null. do n-程序员宅基地

技术标签: linux  linux内核与驱动开发  

作者

QQ群:852283276
微信:arm80x86
微信公众号:青儿创客基地
B站:主页 https://space.bilibili.com/208826118

参考

请问有知道atheros无线网卡Linux驱动官方下载地址是什么吗?
Ubuntu 16.04 - Can’t connect to home Wi-Fi with Killer 1535 (QCA6174)
ath10k-firmware
linux-firmware.git
ubuntu下安装Qualcomm Atheros QCA6174无线网卡驱动方法
ubuntu18.0.4 无线网卡无法上网解决!
无线网卡驱动Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter
imx6ull linux下wifi驱动移植
Linux移植wifi驱动
嵌入式系统添加无线wifi模块
基于Atheros 300M MiniPCI网卡(AR9223-AL1A)的嵌入式x86路由器/Mesh节点的配置
11AC ath10k的移植
cfg80211 subsystem
Atheros-CSI-Tool(Ubuntu版本安装及使用过程)[原教程来自xieyaxiong]
ubuntu 安装Qualcomm Atheros QCA9565 AR9565 无线网卡驱动并连接wifi网络
Backports Project
如何在编译内核时添加缺少的固件(以intel wireless 5100 AGN的 iwlwifi 为例)
wpa_supplicant 配置与应用
wpa_supplicant_8_ti hostapd wpa_supplicant TI 官方的wpa_supplicant hostapd 移植到linux
wpa_supplicant、hostapd编译
hostapd and wpa_supplicant
hostapd和wpa_supplicant工具移植到ARM Linux
hostapd 与 wpa_supplicant详解
linux下WIFI模块使用:wpa_supplicant工具交叉编译以及配置
linux下使用shell命令通过wpa_cli控制wpa_supplicant连接wifi
Linux系统Wpa_supplicant用法小结
使用wpa_supplicant手动配置连接wifi
Linux环境下使用WIFI模块:使用wpa_supplicant工具配置和连接WIFI
Could not connect to wpa_supplicant: p2p-dev-wlan0 - re-trying
嵌入式linux开发板上增加rfkill命令
eunseong/rfkill
wpa_supplicant及wpa_cli使用方法
wpa_cli 操作指令使用指南
hostapd基本配置
用Hostapd创建可用的软AP
ubuntu下搭建udhcpd服务器
udhcpd配置及使用
Yocto i.MX6 (TQIMX6) (03) : wifi网卡的相关工具wpa_supplicant与dhcp
Yocto tips (11): Yocto如何往最终的rootfs中添加软件
802.11 a/b/g/n/ac 是什么以及它们有什么区别
Linux博通43xx系列网卡驱动
安装centOS 7双系统(四)——解决Broadcom博通BCM 43xx无线网卡驱动问题
博通的网卡linux驱动,Centos&Redhat下bcm43142博通无线网卡linux驱动
linux内核makefile概览
linux – 内核模块编译和KBUILD_NOPEDANTIC

视频

Xilinx Zynq通过PCIe WIFI模块联网
Xilinx Zynq通过PCIe WIFI速度测试
Xilinx Zynq PCIe WIFI速度测试后续

WIFI6

Wi-Fi6无线网卡横评,killer 1650 vs Intel AX210 vs Intel AX200
不只有ax200,Wi-Fi6网卡大盘点

wifi6对应802.11ax,可同时支持2.4G/5G。
Intel AX210 vs Intel AX200,AX210采用M.2 2230或M.2 1216形态设计,除了支持Wi-Fi 6E,还支持蓝牙5.2,2x2天线,无线速度最高3000Mbps。高级特性方面,首先就是Wi-Fi 6E独有的6GHz频段,虽然穿墙不佳,但近距离传输速度更快。当然要想用上,外围设备也得支持才行,否则就是传统Wi-Fi 6的2.4GHz和5GHz。

速度

开启5G,VHT80,WPEQ-257 QCA988X不支持VHT160,使用手机iperf3测速,测试手机红米K30 Pro,骁龙865 SOC,接收速度57MB/s,发送速度30MB/s,

root@zynq-v2019:~# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.43.30, port 46802
[  5] local 192.168.43.1 port 5201 connected to 192.168.43.30 port 46804
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  49.0 MBytes   411 Mbits/sec                  
[  5]   1.00-2.00   sec  58.1 MBytes   487 Mbits/sec                  
[  5]   2.00-3.00   sec  57.1 MBytes   479 Mbits/sec                  
[  5]   3.00-4.00   sec  57.1 MBytes   479 Mbits/sec                  
[  5]   4.00-5.00   sec  57.1 MBytes   479 Mbits/sec                  
[  5]   5.00-5.06   sec  3.22 MBytes   492 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-5.06   sec   282 MBytes   467 Mbits/sec                  receiver
root@zynq-v2019:~# iperf3 -c 192.168.43.30
Connecting to host 192.168.43.30, port 5201
[  5] local 192.168.43.1 port 56530 connected to 192.168.43.30 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  27.8 MBytes   233 Mbits/sec    0    532 KBytes       
[  5]   1.00-2.00   sec  31.8 MBytes   267 Mbits/sec    0    638 KBytes       
[  5]   2.00-3.00   sec  33.2 MBytes   278 Mbits/sec    0    675 KBytes       
[  5]   3.00-4.00   sec  30.5 MBytes   256 Mbits/sec    0    675 KBytes       
[  5]   4.00-5.00   sec  29.7 MBytes   249 Mbits/sec    0    675 KBytes       
[  5]   5.00-6.00   sec  31.7 MBytes   266 Mbits/sec    0    711 KBytes       
[  5]   6.00-7.00   sec  30.0 MBytes   251 Mbits/sec    0    711 KBytes       
[  5]   7.00-8.00   sec  30.3 MBytes   254 Mbits/sec    0    711 KBytes       
[  5]   8.00-9.00   sec  31.7 MBytes   265 Mbits/sec    0    711 KBytes       
[  5]   9.00-10.00  sec  30.3 MBytes   255 Mbits/sec    0    711 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   307 MBytes   257 Mbits/sec    0             sender
[  5]   0.00-10.00  sec   306 MBytes   256 Mbits/sec                  receiver

iperf Done.

802.11a/b/g/n/ac

56

rfkill

内核需要开启这个支持,

[*]   RF switch input support

WPEQ-261ACN(BT)

管脚

  • WAKE_L(OPT) 模块输出给系统的,用于唤醒系统
  • CLKREQ_L 模块输出给系统的,提示是否需要给模块提供时钟,低功耗用途
  • W_DISABLE_L(OPT) 系统输出给模块的,可关闭模块射频信号
  • PERST_L 系统给模块的复位

驱动

使用的驱动是ath_10k,选择Atheros 802.11ac wireless cards support

#define ATH10K_FW_DIR			"ath10k"

/* QCA988X 1.0 definitions (unsupported) */
#define QCA988X_HW_1_0_CHIP_ID_REV	0x0

/* QCA988X 2.0 definitions */
#define QCA988X_HW_2_0_VERSION		0x4100016c
#define QCA988X_HW_2_0_CHIP_ID_REV	0x2
#define QCA988X_HW_2_0_FW_DIR		ATH10K_FW_DIR "/QCA988X/hw2.0"
#define QCA988X_HW_2_0_FW_FILE		"firmware.bin"
#define QCA988X_HW_2_0_OTP_FILE		"otp.bin"
#define QCA988X_HW_2_0_BOARD_DATA_FILE	"board.bin"
#define QCA988X_HW_2_0_PATCH_LOAD_ADDR	0x1234

#define ATH10K_FW_API2_FILE		"firmware-2.bin"
#define ATH10K_FW_API3_FILE		"firmware-3.bin"

#define ATH10K_FW_UTF_FILE		"utf.bin"

/* includes also the null byte */
#define ATH10K_FIRMWARE_MAGIC               "QCA-ATH10K"

加载驱动,

$ sudo lspci -vv -s 04:00.0
04:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 131
	Region 0: Memory at f7200000 (64-bit, non-prefetchable) [size=2M]
	Expansion ROM at f7400000 [disabled] [size=64K]
	Capabilities: [40] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable+ Count=1/8 Maskable+ 64bit-
		Address: fee003b8  Data: 0000
		Masking: 00fe00fe  Pending: 00000000
	Capabilities: [70] Express (v2) Endpoint, MSI 00
		DevCap:	MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 <64us
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10.000W
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 256 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <64us
			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
		AERCap:	First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
	Capabilities: [140 v1] Virtual Channel
		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
		Arb:	Fixed- WRR32- WRR64- WRR128-
		Ctrl:	ArbSelect=Fixed
		Status:	InProgress-
		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
			Status:	NegoPending- InProgress-
	Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
	Kernel driver in use: ath10k_pci
	Kernel modules: ath10k_pci

$ sudo memtool md 0xf7200000
f7200000: deadbeef deadbeef deadbeef deadbeef                ................
f7200010: deadbeef deadbeef deadbeef deadbeef                ................
f7200020: deadbeef deadbeef deadbeef deadbeef                ................
f7200030: deadbeef deadbeef deadbeef deadbeef                ................
f7200040: deadbeef deadbeef deadbeef deadbeef                ................
f7200050: deadbeef deadbeef deadbeef deadbeef                ................
f7200060: deadbeef deadbeef deadbeef deadbeef                ................
f7200070: deadbeef deadbeef deadbeef deadbeef                ................
f7200080: deadbeef deadbeef deadbeef deadbeef                ................
f7200090: deadbeef deadbeef deadbeef deadbeef                ................
f72000a0: deadbeef deadbeef deadbeef deadbeef                ................
f72000b0: deadbeef deadbeef deadbeef deadbeef                ................
f72000c0: deadbeef deadbeef deadbeef deadbeef                ................
f72000d0: deadbeef deadbeef deadbeef deadbeef                ................
f72000e0: deadbeef deadbeef deadbeef deadbeef                ................
f72000f0: deadbeef deadbeef deadbeef deadbeef                ................
$ sudo memtool md 0xf7280000
f7280000: 000002d3 00000001 00000000 00001801                ................
f7280010: 00001000 0000106a 00006da4 00002840                ....j....m..@(..
f7280020: 00003184 00000000 00000000 00000000                .1..............
f7280030: 00000000 00000000 00000000 00000000                ................
f7280040: 00000000 00000000 00000000 00000000                ................
f7280050: 00000000 00000000 00000000 00000000                ................
f7280060: 00000000 00000000 00000000 00000000                ................
f7280070: 00000000 00000000 00000000 00000000                ................
f7280080: 00000000 00000000 00000000 00000000                ................
f7280090: 00000000 00000000 00000000 00000000                ................
f72800a0: 00000000 00000000 00000000 00000000                ................
f72800b0: 00000000 00000000 00000000 00000000                ................
f72800c0: 00000000 00000000 00000000 00000000                ................
f72800d0: 00000000 00000000 00000000 00000000                ................
f72800e0: 00000000 00000000 00000000 00000000                ................
f72800f0: 00000000 00000000 00000000 00000000                ................
$ uname -a
Linux qe-pc 5.3.0-62-generic #56~18.04.1-Ubuntu SMP Wed Jun 24 16:17:03 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dmesg
[    0.000000] microcode: microcode updated early to revision 0xd6, date = 2020-04-27
[    0.000000] Linux version 5.3.0-62-generic (buildd@lcy01-amd64-004) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #56~18.04.1-Ubuntu SMP Wed Jun 24 16:17:03 UTC 2020 (Ubuntu 5.3.0-62.56~18.04.1-generic 5.3.18)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.3.0-62-generic root=UUID=e06d0026-9e0b-4014-bb55-efe51b0b1db4 ro quiet splash vt.handoff=1
...
[    1.166246] pci 0000:04:00.0: [168c:003c] type 00 class 0x028000
[    1.166275] pci 0000:04:00.0: reg 0x10: [mem 0xf7200000-0xf73fffff 64bit]
[    1.166320] pci 0000:04:00.0: reg 0x30: [mem 0xf7400000-0xf740ffff pref]
[    1.166389] pci 0000:04:00.0: supports D1 D2
[    1.166389] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
...
[    4.904377] ath10k_pci 0000:04:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[    5.090421] ath10k_pci 0000:04:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043222ff sub 0000:0000
[    5.090423] ath10k_pci 0000:04:00.0: kconfig debug 0 debugfs 1 tracing 1 dfs 0 testmode 0
[    5.090542] ath10k_pci 0000:04:00.0: firmware ver 10.2.4-1.0-00037 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 a4a52adb
[    5.177177] ath10k_pci 0000:04:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[    6.299615] ath10k_pci 0000:04:00.0: unsupported HTC service id: 1536
[    6.318851] ath10k_pci 0000:04:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1
[    6.396351] ath: EEPROM regdomain: 0x0
[    6.396353] ath: EEPROM indicates default country code should be used
[    6.396353] ath: doing EEPROM country->regdmn map search
[    6.396354] ath: country maps to regdmn code: 0x3a
[    6.396354] ath: Country alpha2 being used: US
[    6.396354] ath: Regpair used: 0x3a
[    6.399092] ath10k_pci 0000:04:00.0 wlp4s0: renamed from wlan0
...
[  622.364317] rfkill: input handler disabled

在zynq上出了点bug,在zu开发板上就没识别到,这个模块必须先上电,否则无法linkup,

$ modprobe ath10k_pci
pci 0000:00:00.0: enabling device (0140 -> 0142)
ath10k_pci 0000:01:00.0: enabling device (0140 -> 0142)
ath10k_pci 0000:01:00.0: failed to wake up: -110
ath10k_pci: probe of 0000:01:00.0 failed with error -110
xilinx-pcie 50000000.pciex: Slave Completer Abort
xilinx-pcie 50000000.pciex: Slave Completer Abort
Bus error
Unhandled fault: imprecise external abort (0x1406) at 0x80c80004

性能

5G双频,性能,

# iperf3 -c 192.168.43.30
Connecting to host 192.168.43.30, port 5201
[  5] local 192.168.43.1 port 53816 connected to 192.168.43.30 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  22.3 MBytes   187 Mbits/sec    0    421 KBytes       
[  5]   1.00-2.00   sec  27.2 MBytes   228 Mbits/sec    0    444 KBytes       
[  5]   2.00-3.00   sec  25.7 MBytes   216 Mbits/sec    0    465 KBytes       
[  5]   3.00-4.00   sec  27.6 MBytes   231 Mbits/sec    0    465 KBytes       
[  5]   4.00-5.00   sec  27.2 MBytes   229 Mbits/sec    0    495 KBytes       
[  5]   5.00-6.00   sec  27.2 MBytes   228 Mbits/sec    0    495 KBytes       
[  5]   6.00-7.00   sec  26.9 MBytes   226 Mbits/sec    0    495 KBytes       
[  5]   7.00-8.00   sec  26.8 MBytes   225 Mbits/sec    0    495 KBytes       
[  5]   8.00-9.00   sec  25.1 MBytes   211 Mbits/sec    0    547 KBytes       
[  5]   9.00-10.00  sec  27.2 MBytes   228 Mbits/sec    0    583 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   263 MBytes   221 Mbits/sec    0             sender
[  5]   0.00-10.00  sec   262 MBytes   220 Mbits/sec                  receiver

iperf Done.
# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.43.30, port 42696
[  5] local 192.168.43.1 port 5201 connected to 192.168.43.30 port 42698
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  36.1 MBytes   303 Mbits/sec                  
[  5]   1.00-2.00   sec  38.0 MBytes   319 Mbits/sec                  
[  5]   2.00-3.00   sec  38.9 MBytes   326 Mbits/sec                  
[  5]   3.00-4.00   sec  36.8 MBytes   309 Mbits/sec                  
[  5]   4.00-5.00   sec  37.2 MBytes   312 Mbits/sec                  
[  5]   5.00-5.03   sec  1.30 MBytes   332 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-5.03   sec   188 MBytes   314 Mbits/sec                  receiver

WPEB-265AXI(BT)

采用博通的bcm43752a2,支持WIFI6E,采用厂商给的bcmdhd驱动,不是从博通官网下载的,目前只调通了2.4g,性能如下,

# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.43.30, port 43592
[  5] local 192.168.43.1 port 5201 connected to 192.168.43.30 port 43594
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  9.39 MBytes  78.7 Mbits/sec                  
[  5]   1.00-2.00   sec  11.3 MBytes  94.5 Mbits/sec                  
[  5]   2.00-3.00   sec  13.4 MBytes   113 Mbits/sec                  
[  5]   3.00-4.00   sec  14.5 MBytes   122 Mbits/sec                  
[  5]   4.00-5.00   sec  14.2 MBytes   119 Mbits/sec                  
[  5]   5.00-5.12   sec  1.54 MBytes   109 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-5.12   sec  64.3 MBytes   105 Mbits/sec                  receiver
# iperf3 -c 192.168.43.30
Connecting to host 192.168.43.30, port 5201
[  5] local 192.168.43.1 port 42240 connected to 192.168.43.30 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  9.02 MBytes  75.6 Mbits/sec    0    486 KBytes       
[  5]   1.00-2.00   sec  13.6 MBytes   114 Mbits/sec   33    706 KBytes       
[  5]   2.00-3.00   sec  10.4 MBytes  87.4 Mbits/sec    0    803 KBytes       
[  5]   3.00-4.00   sec  15.2 MBytes   127 Mbits/sec    0    875 KBytes       
[  5]   4.00-5.00   sec  16.2 MBytes   136 Mbits/sec    0    928 KBytes       
[  5]   5.00-6.00   sec  15.3 MBytes   129 Mbits/sec    0    962 KBytes       
[  5]   6.00-7.00   sec  14.1 MBytes   118 Mbits/sec    2    700 KBytes       
[  5]   7.00-8.00   sec  16.3 MBytes   137 Mbits/sec    0    754 KBytes       
[  5]   8.00-9.00   sec  18.8 MBytes   158 Mbits/sec    0    792 KBytes       
[  5]   9.00-10.00  sec  16.8 MBytes   141 Mbits/sec    0    814 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   146 MBytes   122 Mbits/sec   35             sender
[  5]   0.00-10.00  sec   144 MBytes   121 Mbits/sec                  receiver

iperf Done.

驱动加载信息,尝试搜索频段,失败,802.11ac初始化失败,

# dmesg | grep dhd
[dhd] dhd_module_init: in Dongle Host Driver, version 100.10.545.16_S8 (r826445-20201221-1)
[dhd] ======== dhd_wlan_init_plat_data ========
[dhd] dhd_wlan_init_gpio: WL_REG_ON=-1
[dhd] dhd_wifi_platform_load: Enter
[dhd] dhdpcie_pci_probe : no mutex held. set lock
[dhd] PCI_PROBE:  bus 1, slot 0,vendor 14E4, device 449D(good PCI location)
[dhd] dhdpcie_init: found adapter info 'DHD generic adapter'
[dhd] Disable CTO
[dhd] ******** Perform FLR ********
[dhd] read_config: reg=0x88 read val=0xb080
[dhd] read_config: reg=0x88 read val=0x8080
[dhd] ******** FLR Succedeed ********
[dhd] DHD: dongle ram size is set to 1310720(orig 1310720) at 0x170000
[dhd] dhd_conf_set_chiprev : chip=0xaae8, chiprev=2
[dhd] dhd_pktid_map_init:2095: pktid_audit init succeeded 1025
[dhd] dhd_pktid_map_init:2095: pktid_audit init succeeded 1025
[dhd] dhd_pktid_map_init:2095: pktid_audit init succeeded 36865
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] dhd_attach(): thread:dhd_watchdog_thread:3f1 started
[dhd] dhd_deferred_work_init: work queue initialized
[dhd] dhd_tcpack_suppress_set: TCP ACK Suppress mode 0 -> mode 3
[dhd] dhd_cpumasks_init CPU masks primary(big)=0x0 secondary(little)=0xfe
[dhd] dhdpcie_bus_attach: making DHD_BUS_DOWN
[dhd] dhdpcie_init: rc_dev from dev->bus->self (10ee:7124) is (ptrval)
[dhd] dhdpcie_access_cap: PCI Cap(0x1e) not supported.
[dhd] dhd_bus_is_rc_ep_l1ss_capable RC is not l1ss capable
[dhd] dhdpcie_init: rc_ep_aspm_cap: 1 rc_ep_l1ss_cap: 0
[dhd] dhdpcie_request_irq: MSI enabled
[dhd] dhd_bus_download_firmware: firmware path=/lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin, nvram path=/lib/firmware/bcmdhd/nvram_ap6275p.txt
[dhd] dhdpcie_dump_resource: BAR0(VA): 0x(ptrval), BAR0(PA): 0x40400000, SIZE: 32768
[dhd] dhdpcie_dump_resource: BAR1(VA): 0x(ptrval), BAR1(PA): 0x40000000, SIZE: 4194304
[dhd] dhd_conf_read_config : Ignore config file /lib/firmware/bcmdhd/config.txt
[dhd] dhd_conf_set_path_params : Final fw_path=/lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin
[dhd] dhd_conf_set_path_params : Final nv_path=/lib/firmware/bcmdhd/nvram_ap6275p.txt
[dhd] dhd_conf_set_path_params : Final clm_path=/lib/firmware/bcmdhd/clm_bcm43752a2_pcie_ag.blob
[dhd] dhd_conf_set_path_params : Final conf_path=/lib/firmware/bcmdhd/config.txt
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin (818176 bytes) open success
[dhd] dhdpcie_download_code_file: dhd_tcm_test_enable 0
[dhd] dhdpcie_download_code_file: download firmware /lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin (818176 bytes) open success
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/nvram_ap6275p.txt (8576 bytes) open success
[dhd] dhdpcie_download_nvram: dhd_get_download_buffer len 8576
[dhd] NVRAM version:  AP12275_PB33_PB18_PR33_PR18_NVRAM_V1.3_20210113_FCC
[dhd] dhdpcie_download_nvram: process_nvram_vars len 5948
[dhd] dhdpcie_bus_write_vars: Download, Upload and compare of NVRAM succeeded.
[dhd] dhd_bus_aer_config: Configure AER registers for EP
[dhd] dhd_bus_aer_config: Configure AER registers for RC
[dhd] dhdpcie_access_cap: PCI Cap(0x01) not supported.
[dhd] dhd_bus_aer_config: Invalid RC's PCIE_ADV_CORR_ERR_MASK: 0xffffffff
[dhd] dhdpcie_readshared: PCIe shared addr (0x001ef954) read took 56383 usec before dongle is ready
[dhd] H2D DMA WR INDX : array size 172 = 4 * 43
[dhd] D2H DMA RD INDX : array size 16 = 4 * 4
[dhd] D2H DMA WR INDX : array size 16 = 4 * 4
[dhd] H2D DMA RD INDX : array size 172 = 4 * 43
[dhd] dhdpcie_readshared: max H2D queues 40
[dhd] FW supports debug buf dest ? N 
[dhd] dhd_bus_start: Initializing 43 h2drings
[dhd] dhd_prot_init:3207: h2d_max_txpost = 512
[dhd] dhd_prot_init:3216: MAX_RXBUFPOST = 511
[dhd] ENABLING DW:0
[dhd] IDMA inited
[dhd] Enable hostcap: EXTD TXS in txcpl
[dhd] dhd_prot_d2h_sync_init(): D2H sync mechanism is NONE 
[dhd] dhd_bus_hostready : Read PCICMD Reg: 0x00100546
[dhd] dhd_bus_dump_dar_registers: dar_clk_ctrl(0xa08:0x1030040) dar_pwr_ctrl(0xa0c:0x30000) dar_intstat(0xa10:0x0)
[dhd] dhd_bus_dump_dar_registers: dar_errlog(0xa60:0x0) dar_erraddr(0xa64:0x0) dar_pcie_mbint(0xa68:0x0)
[dhd] dhd_bus_hostready: Ring Hostready:1
[dhd] Attach flowrings pool for 40 rings
[dhd] iDMA enabled PCIEControl = 00000001
[dhd] dhd_send_d2h_ringcreate ringid: 3 idx: 46 max_h2d: 43
[dhd] info buffer post after ring create
[dhd] dhd_sync_with_dongle: GET_REVINFO device 0x449d, vendor 0x14e4, chipnum 0xaae8
[dhd] dhd_sync_with_dongle: RxBuf Post : 2048
[dhd] dhd_tcpack_suppress_set 382: already set to 3
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/clm_bcm43752a2_pcie_ag.blob (28865 bytes) open success
[dhd] dhd_check_current_clm_data: ----- This FW is not included CLM data -----
[dhd] dhd_check_current_clm_data: ----- This FW is included CLM data -----
[dhd] Firmware up: op_mode=0x0002, MAC=00:0e:8e:9c:9f:28
[dhd] dhd_preinit_ioctls: event_log_max_sets: 26 ret: 0
[dhd]   Driver: 100.10.545.16_S8 (r826445-20201221-1)
[dhd] dhd_pno_init: Support Android Location Service
[dhd] dhd_ecounter_autoconfig Ecounter autoconfig in FW not supported
[dhd] [INIT] logset:8 is preserve/chatty
[dhd] [INIT] logset:10 is preserve/chatty
[dhd] dhd_conf_set_country : set country XZ, revision 0
[dhd] dhd_rx_frame: net device is NOT registered. drop event packet
[dhd] dhd_conf_set_country : Country code: XZ (XZ/0)
[dhd] Dongle Host Driver, version 100.10.545.16_S8 (r826445-20201221-1)
[dhd] Register interface [wlan0]  MAC: 00:0e:8e:9c:9f:28
[dhd] dhd_tcpack_suppress_set: TCP ACK Suppress mode 3 -> mode 0
[dhd] dhd_bus_devreset: == Power OFF ==
[dhd] dhd_bus_devreset: making dhdpub up FALSE
[dhd] dhd_bus_stop: making DHD_BUS_DOWN
[dhd] dhd_dpc_kill: tasklet disabled
[dhd] dhd_bus_devreset: making DHD_BUS_DOWN
[dhd] dhd_bus_devreset:  WLAN OFF Done
[dhd] wifi_platform_set_power = 0, delay: 0 msec
[dhd] ======== PULL WL_REG_ON(-1) LOW! ========
[dhd] dhdpcie_pci_probe : the lock is released.
[dhd] dhd_module_init: Exit err=0
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[dhd] dhd_open: Enter wlan0
[dhd] dhd_open : no mutex held. set lock
[dhd] 
[dhd-wlan0] wl_android_wifi_on : in g_wifi_on=0
[dhd] wifi_platform_set_power = 1, delay: 200 msec
[dhd] ======== PULL WL_REG_ON(-1) HIGH! ========
[dhd] dhd_bus_devreset: == Power ON ==
[dhd] Disable CTO
[dhd] DHD: dongle ram size is set to 1310720(orig 1310720) at 0x170000
[dhd] dhdpcie_request_irq: MSI enabled
[dhd] dhd_bus_download_firmware: firmware path=/lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin, nvram path=/lib/firmware/bcmdhd/nvram_ap6275p.txt
[dhd] dhdpcie_dump_resource: BAR0(VA): 0x(ptrval), BAR0(PA): 0x40400000, SIZE: 32768
[dhd] dhdpcie_dump_resource: BAR1(VA): 0x(ptrval), BAR1(PA): 0x40000000, SIZE: 4194304
[dhd] dhd_conf_read_config : Ignore config file /lib/firmware/bcmdhd/config.txt
[dhd] dhd_conf_set_path_params : Final fw_path=/lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin
[dhd] dhd_conf_set_path_params : Final nv_path=/lib/firmware/bcmdhd/nvram_ap6275p.txt
[dhd] dhd_conf_set_path_params : Final clm_path=/lib/firmware/bcmdhd/clm_bcm43752a2_pcie_ag.blob
[dhd] dhd_conf_set_path_params : Final conf_path=/lib/firmware/bcmdhd/config.txt
[dhd] dhdpcie_download_code_file: dhd_tcm_test_enable 0
[dhd] dhdpcie_download_code_file: download firmware /lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/fw_bcm43752a2_pcie_ag_apsta.bin (818176 bytes) open success
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/nvram_ap6275p.txt (8576 bytes) open success
[dhd] dhdpcie_download_nvram: dhd_get_download_buffer len 8576
[dhd] NVRAM version:  AP12275_PB33_PB18_PR33_PR18_NVRAM_V1.3_20210113_FCC
[dhd] dhdpcie_download_nvram: process_nvram_vars len 5948
[dhd] dhdpcie_bus_write_vars: Download, Upload and compare of NVRAM succeeded.
[dhd] dhd_bus_aer_config: Configure AER registers for EP
[dhd] dhd_bus_aer_config: Configure AER registers for RC
[dhd] dhdpcie_access_cap: PCI Cap(0x01) not supported.
[dhd] dhd_bus_aer_config: Invalid RC's PCIE_ADV_CORR_ERR_MASK: 0xffffffff
[dhd] dhdpcie_readshared: PCIe shared addr (0x001ef954) read took 56383 usec before dongle is ready
[dhd] H2D DMA WR INDX : array size 172 = 4 * 43
[dhd] D2H DMA RD INDX : array size 16 = 4 * 4
[dhd] D2H DMA WR INDX : array size 16 = 4 * 4
[dhd] H2D DMA RD INDX : array size 172 = 4 * 43
[dhd] dhdpcie_readshared: max H2D queues 40
[dhd] FW supports debug buf dest ? N 
[dhd] dhd_bus_start: Initializing 43 h2drings
[dhd] dhd_prot_init:3207: h2d_max_txpost = 512
[dhd] dhd_prot_init:3216: MAX_RXBUFPOST = 511
[dhd] ENABLING DW:0
[dhd] IDMA inited
[dhd] Enable hostcap: EXTD TXS in txcpl
[dhd] dhd_prot_d2h_sync_init(): D2H sync mechanism is NONE 
[dhd] dhd_bus_hostready : Read PCICMD Reg: 0x00100546
[dhd] dhd_bus_dump_dar_registers: dar_clk_ctrl(0xa08:0x1030040) dar_pwr_ctrl(0xa0c:0x30000) dar_intstat(0xa10:0x0)
[dhd] dhd_bus_dump_dar_registers: dar_errlog(0xa60:0x0) dar_erraddr(0xa64:0x0) dar_pcie_mbint(0xa68:0x0)
[dhd] dhd_bus_hostready: Ring Hostready:2
[dhd] iDMA enabled PCIEControl = 00000001
[dhd] dhd_send_d2h_ringcreate ringid: 3 idx: 46 max_h2d: 43
[dhd] info buffer post after ring create
[dhd] dhd_sync_with_dongle: GET_REVINFO device 0x449d, vendor 0x14e4, chipnum 0xaae8
[dhd] dhd_sync_with_dongle: RxBuf Post : 2048
[dhd] dhd_tcpack_suppress_set: TCP ACK Suppress mode 0 -> mode 3
[dhd] dhd_os_open_image1: /lib/firmware/bcmdhd/clm_bcm43752a2_pcie_ag.blob (28865 bytes) open success
[dhd] dhd_check_current_clm_data: ----- This FW is not included CLM data -----
[dhd] dhd_check_current_clm_data: ----- This FW is included CLM data -----
[dhd] Firmware up: op_mode=0x0002, MAC=00:0e:8e:9c:9f:28
[dhd] dhd_preinit_ioctls: event_log_max_sets: 26 ret: 0
[dhd]   Driver: 100.10.545.16_S8 (r826445-20201221-1)
[dhd] dhd_pno_init: Support Android Location Service
[dhd] dhd_ecounter_autoconfig Ecounter autoconfig in FW not supported
[dhd] [INIT] logset:8 is preserve/chatty
[dhd] [INIT] logset:10 is preserve/chatty
[dhd] dhd_conf_set_country : set country XZ, revision 0
[dhd] dhd_rx_frame: net device is NOT registered. drop event packet
[dhd] dhd_conf_set_country : Country code: XZ (XZ/0)
[dhd] dhd_bus_devreset: WLAN Power On Done
[dhd-wlan0] wl_android_wifi_on : Success
[dhd] dhd_open : the lock is released.
[dhd] dhd_open: Exit wlan0 ret=0
[dhd] [wlan0] tx queue started
[dhd-wlan0] wl_cfg80211_add_del_bss : wl bss 2 bssidx:0
[dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 0, bssidx: 0
[dhd] CFG80211-ERROR) wl_run_escan :  Escan set error (-4)
[dhd] CFG80211-ERROR) wl_run_escan : scan error (-4)
[dhd] CFG80211-ERROR) wl_cfg80211_scan : scan error (-11)
[dhd-wlan0] wl_cfg80211_add_del_bss : wl bss 3 bssidx:0
[dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 1, bssidx: 0
[dhd] CFG80211-ERROR) wl_run_escan :  Escan set error (-4)
[dhd] CFG80211-ERROR) wl_run_escan : scan error (-4)
[dhd] CFG80211-ERROR) wl_cfg80211_scan : scan error (-11)
[dhd-wlan0] wl_cfg80211_add_del_bss : wl bss 2 bssidx:0
[dhd-wlan0] wl_cfg80211_del_station : Disconnect STA : ff:ff:ff:ff:ff:ff scb_val.val 3
[dhd-wlan0] wl_cfg80211_add_del_bss : wl bss 3 bssidx:0

intel 7265AC

在zynq上可以正常加载驱动,

$ lspci -vv
01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)
        Subsystem: Intel Corporation Dual Band Wireless-AC 7260
        Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 165
        Region 0: Memory at 40000000 (64-bit, non-prefetchable) [disabled] [size=8K]
        Capabilities: [c8] Power Management version 3
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [40] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 unlimited
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr+ NoSnoop+ FLReset-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <32us
                        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR+, OBFF Via WAKE#
                DevCtl2: Completion Timeout: 16ms to 55ms, TimeoutDis-, LTR-, OBFF Disabled
                LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
                         EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
        Capabilities: [100 v1] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr+ BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
                AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
        Capabilities: [140 v1] Device Serial Number 48-51-b7-ff-ff-5a-28-37
        Capabilities: [14c v1] Latency Tolerance Reporting
                Max snoop latency: 0ns
                Max no snoop latency: 0ns
        Capabilities: [154 v1] Vendor Specific Information: ID=cafe Rev=1 Len=014 <?>
root@zynq:~# modprobe iwlwifi
Intel(R) Wireless WiFi driver for Linux, in-tree:
Copyright(c) 2003- 2014 Intel Corporation
iwlwifi 0000:01:00.0: loaded firmware version 25.17.12.0 op_mode iwlmvm
iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144
iwlwifi 0000:01:00.0: L1 Disabled - LTR Disabled
iwlwifi 0000:01:00.0: L1 Disabled - LTR Disabled
$ ls -l /lib/firmware
-rw-r--r--    1 root     root        672352 Nov  2  2020 iwlwifi-7260-10.ucode
-rw-r--r--    1 root     root        782300 Nov  2  2020 iwlwifi-7260-12.ucode
-rw-r--r--    1 root     root        680508 Nov  2  2020 iwlwifi-7260-9.ucode
$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 16:25:C6:0F:D0:E9  
          inet addr:192.168.26.21  Bcast:192.168.26.255  Mask:255.255.255.0
          inet6 addr: fe80::1425:c6ff:fe0f:d0e9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1764 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1012 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2248915 (2.1 MiB)  TX bytes:83000 (81.0 KiB)
          Interrupt:145 Base address:0xb000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:100 (100.0 B)  TX bytes:100 (100.0 B)

wlan0     Link encap:Ethernet  HWaddr 48:51:B7:5A:28:37  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Realtek

LB-Link公司的产品,产品列表,其中BL-M8188NP1 MINI PCI-E WLAN Module 支持IEEE 802.11 b/g/n,2.4G频段,采用Realtek RTL8188EE芯片,1688批量订货

rtlwifi驱动分析

开启驱动中的调试打印,

int rtl_pci_probe(struct pci_dev *pdev,
			    const struct pci_device_id *id)
{
    
...
	// 从pci_device_id中拿到cfg
	rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data);
...
	// 初始化调试接口
	rtl_dbgp_flag_init(hw);
...
	/*like read eeprom and so on */
	//pci_read32_sync crash here
	rtlpriv->cfg->ops->read_eeprom_info(hw);
	//初始化一些软件变量,包括调试接口的global_debuglevel
	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
    
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
		err = -ENODEV;
		goto fail3;
	}
	rtlpriv->cfg->ops->init_sw_leds(hw);
...
}

调试接口相关

void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
{
    
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	u8 i;
	// 设置了所有的标志位
	rtlpriv->dbg.global_debugcomponents =
	    COMP_ERR | COMP_FW | COMP_INIT | COMP_RECV | COMP_SEND |
	    COMP_MLME | COMP_SCAN | COMP_INTR | COMP_LED | COMP_SEC |
	    COMP_BEACON | COMP_RATE | COMP_RXDESC | COMP_DIG | COMP_TXAGC |
	    COMP_POWER | COMP_POWER_TRACKING | COMP_BB_POWERSAVING | COMP_SWAS |
	    COMP_RF | COMP_TURBO | COMP_RATR | COMP_CMD |
	    COMP_EFUSE | COMP_QOS | COMP_MAC80211 | COMP_REGD | COMP_CHAN |
	    COMP_EASY_CONCURRENT | COMP_EFUSE | COMP_QOS | COMP_MAC80211 |
	    COMP_REGD | COMP_CHAN | COMP_BT_COEXIST;


	for (i = 0; i < DBGP_TYPE_MAX; i++)
		rtlpriv->dbg.dbgp_type[i] = 0;

	/*Init Debug flag enable condition */
}
EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init);
// global_debugcomponents设置了所有的标志位,所以能不能打印就看global_debuglevel
#define RT_TRACE(rtlpriv, comp, level, fmt, ...)			\
do {									\
	if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) &&	\
		     ((level) <= rtlpriv->dbg.global_debuglevel))) {	\
		printk(KERN_DEBUG KBUILD_MODNAME ":%s():<%lx-%x> " fmt,	\
		       __func__, in_interrupt(), in_atomic(),		\
		       ##__VA_ARGS__);					\
	}								\
} while (0)
//drivers\net\wireless\rtlwifi\rtl8192ee\sw.c
int rtl92ee_init_sw_vars(struct ieee80211_hw *hw)
{
    
...
	rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
...
}
root@zynq:~# pci 0000:00:00.0: enabling device (0140 -> 0143)
rtl8192ee 0000:01:00.0: enabling device (0140 -> 0143)
xilinx-pcie 40000000.pciex: Slave Completer Abort
Unhandled fault: imprecise external abort (0x1406) at 0x36f8c000
Internal error: Oops - BUG: 1406 [#1] PREEMPT SMP ARM
Modules linked in: rtl8192ee(+) btcoexist rtl_pci rtlwifi exfat(O) cpld(O) max6369(O) uio_pdrv_genirq cmem(O) ipv6
CPU: 0 PID: 961 Comm: modprobe Tainted: G           O   3.19.0-fdk-1.0.4-20201026.1453 #22
Hardware name: Xilinx Zynq Platform
task: 6e895a80 ti: 6e922000 task.ti: 6e922000
PC is at pci_read32_sync+0x10/0x14 [rtl_pci]
LR is at rtl92ee_read_eeprom_info+0x30/0x378 [rtl8192ee]
pc : [<3f0a103c>]    lr : [<3f0c4104>]    psr: 600d0013
sp : 6e923d18  ip : 000008b0  fp : 6f1e8400
r10: 000010ec  r9 : 6ead1768  r8 : 6eada0c0
r7 : 6ead03e0  r6 : 6eadb020  r5 : 0000102c  r4 : 6ead10c0
r3 : 80a28000  r2 : 3f0a102c  r1 : 80a280f0  r0 : 00000000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 18c5387d  Table: 2ea3404a  DAC: 00000015
Process modprobe (pid: 961, stack limit = 0x6e922238)
Stack: (0x6e923d18 to 0x6e924000)
3d00:                                                       6ead03e0 6ead10d8
3d20: 6f1ebc00 6ead10c0 6ead03e0 6eada0c0 6eada0c0 3f0a4ef8 000000d0 6f01eac0
3d40: 6f169564 402510b0 6f01eac8 00001dcb 00000000 6f1d8128 6ead10c0 6eadc0c0
3d60: 6eadb020 6f1ebc68 0000a1ff 40109274 001d8128 40109817 6f1e01a5 6f1ebccc
3d80: 00000000 60030013 3f0d33b0 6f1ebc68 3f0d33e4 6f1ebc00 00000000 3f0d33b0
3da0: 3f0d342c 00000001 6f169564 4027bcc0 4027bc58 6f1ebc68 408c621c 3f0d33e4
3dc0: 3f0d33e4 00000003 6f169540 402fd1cc 6f1ebc68 6f1ebc9c 3f0d33e4 40852e28
3de0: 40843760 402fd3b8 00000000 3f0d33e4 402fd350 402fbaf0 6f0a255c 6f3aabb4
3e00: 3f0d33e4 00000000 6f07b380 402fca90 3f0d21d1 3f0d21d2 00000000 3f0d33e4
3e20: 3f0d9000 00000000 40843760 402fd8bc 3f0d3424 6f169440 3f0d9000 400088e0
3e40: 6fd5b300 6fd5b320 00000001 00000000 00000001 40088608 6fd5b300 00000000
3e60: 00000001 6f778000 3f0d5338 00000000 00000000 4008a0bc 6fd5b300 00000000
3e80: 00000023 6f243080 00000023 6f243080 00000001 6e923f58 6f243080 3f0d52f0
3ea0: 3f0d52fc 3f0d5338 6f169540 400704a0 3f0d52fc 00007fff 4006dbc4 00000022
3ec0: 00000000 00000028 4006dd98 0000024b 40597318 6f243080 80a1f138 000ac798
3ee0: 00000023 000002d2 6f1cea00 00000010 000aba50 00000000 00000000 00000000
3f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3f20: 00000000 00000000 00000000 00000000 000000d2 36d70008 00022310 000ac798
3f40: 00000080 4000de24 6e922000 00000000 000aba50 40070b00 80a03000 00022310
3f60: 80a1eb48 80a1e9a2 80a238a8 0001a450 0001b6c0 00000000 00000000 00000000
3f80: 00000026 00000027 0000001b 0000001f 00000015 00000000 00022310 000ac718
3fa0: 000ac798 4000dca0 00022310 000ac718 36d70008 00022310 000ac798 000ac768
3fc0: 00022310 000ac718 000ac798 00000080 00000009 000ac738 00000001 000aba50
3fe0: 3ed60a58 3ed60a48 0001831c 36e5d2a0 20030010 36d70008 2ff7e821 2ff7ec21
[<3f0a103c>] (pci_read32_sync [rtl_pci]) from [<3f0c4104>] (rtl92ee_read_eeprom_info+0x30/0x378 [rtl8192ee])
[<3f0c4104>] (rtl92ee_read_eeprom_info [rtl8192ee]) from [<3f0a4ef8>] (rtl_pci_probe+0xd9c/0x1b1c [rtl_pci])
[<3f0a4ef8>] (rtl_pci_probe [rtl_pci]) from [<4027bcc0>] (pci_device_probe+0x68/0xb8)
[<4027bcc0>] (pci_device_probe) from [<402fd1cc>] (driver_probe_device+0x8c/0x1cc)
[<402fd1cc>] (driver_probe_device) from [<402fd3b8>] (__driver_attach+0x68/0x8c)
[<402fd3b8>] (__driver_attach) from [<402fbaf0>] (bus_for_each_dev+0x6c/0x90)
[<402fbaf0>] (bus_for_each_dev) from [<402fca90>] (bus_add_driver+0xdc/0x1c4)
[<402fca90>] (bus_add_driver) from [<402fd8bc>] (driver_register+0x8c/0xd0)
[<402fd8bc>] (driver_register) from [<400088e0>] (do_one_initcall+0x100/0x180)
[<400088e0>] (do_one_initcall) from [<400704a0>] (load_module+0x15fc/0x1b98)
[<400704a0>] (load_module) from [<40070b00>] (SyS_init_module+0xc4/0xcc)
[<40070b00>] (SyS_init_module) from [<4000dca0>] (ret_fast_syscall+0x0/0x34)
Code: e59037bc e0811003 e5910000 f57ff04f (e12fff1e) 
---[ end trace 764a3da68131617d ]---

配置工具

  • libnl静态编译
  • openssl静态编译
  • wpa_supplicant
  • hostapd
# Makefile
ifeq ($(CC),cc)
	CC := $(CROSS_COMPILE)gcc
endif
LIBS += $(EXTRA_LIBS)
# .config
# Add support for new DBus control interface
# (fi.w1.hostap.wpa_supplicant1)
# CONFIG_CTRL_IFACE_DBUS_NEW=y

# Add introspection support for new DBus control interface
# CONFIG_CTRL_IFACE_DBUS_INTRO=y

编译,

$ readelf -d package/wpa_supplicant-2.9/wpa_supplicant/wpa_supplicant

Dynamic section at offset 0x35056c contains 28 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000c (INIT)                       0xd164
 0x0000000d (FINI)                       0x28e6dc
 0x00000019 (INIT_ARRAY)                 0x348000
 0x0000001b (INIT_ARRAYSZ)               20 (bytes)
 0x0000001a (FINI_ARRAY)                 0x348014
 0x0000001c (FINI_ARRAYSZ)               8 (bytes)
 0x00000004 (HASH)                       0x8168
 0x00000005 (STRTAB)                     0xab5c
 0x00000006 (SYMTAB)                     0x8d1c
 0x0000000a (STRSZ)                      7135 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x358674
 0x00000002 (PLTRELSZ)                   1384 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0xcbfc
 0x00000011 (REL)                        0xcbc4
 0x00000012 (RELSZ)                      56 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0xcb04
 0x6fffffff (VERNEEDNUM)                 5
 0x6ffffff0 (VERSYM)                     0xc73c
 0x00000000 (NULL)                       0x0

问题

Direct firmware load for rtlwifi/rtl8188eufw.bin failed with error -2

驱动编译进内核,但是固件放到根文件系统里,所以加载驱动的时候文件系统并没有加载,导致找不到固件,想了一天,想通了,老哥我想通了

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Zhu_Zhu_2009/article/details/109251318

智能推荐

oracle 12c 集群安装后的检查_12c查看crs状态-程序员宅基地

文章浏览阅读1.6k次。安装配置gi、安装数据库软件、dbca建库见下:http://blog.csdn.net/kadwf123/article/details/784299611、检查集群节点及状态:[root@rac2 ~]# olsnodes -srac1 Activerac2 Activerac3 Activerac4 Active[root@rac2 ~]_12c查看crs状态

解决jupyter notebook无法找到虚拟环境的问题_jupyter没有pytorch环境-程序员宅基地

文章浏览阅读1.3w次,点赞45次,收藏99次。我个人用的是anaconda3的一个python集成环境,自带jupyter notebook,但在我打开jupyter notebook界面后,却找不到对应的虚拟环境,原来是jupyter notebook只是通用于下载anaconda时自带的环境,其他环境要想使用必须手动下载一些库:1.首先进入到自己创建的虚拟环境(pytorch是虚拟环境的名字)activate pytorch2.在该环境下下载这个库conda install ipykernelconda install nb__jupyter没有pytorch环境

国内安装scoop的保姆教程_scoop-cn-程序员宅基地

文章浏览阅读5.2k次,点赞19次,收藏28次。选择scoop纯属意外,也是无奈,因为电脑用户被锁了管理员权限,所有exe安装程序都无法安装,只可以用绿色软件,最后被我发现scoop,省去了到处下载XXX绿色版的烦恼,当然scoop里需要管理员权限的软件也跟我无缘了(譬如everything)。推荐添加dorado这个bucket镜像,里面很多中文软件,但是部分国外的软件下载地址在github,可能无法下载。以上两个是官方bucket的国内镜像,所有软件建议优先从这里下载。上面可以看到很多bucket以及软件数。如果官网登陆不了可以试一下以下方式。_scoop-cn

Element ui colorpicker在Vue中的使用_vue el-color-picker-程序员宅基地

文章浏览阅读4.5k次,点赞2次,收藏3次。首先要有一个color-picker组件 <el-color-picker v-model="headcolor"></el-color-picker>在data里面data() { return {headcolor: ’ #278add ’ //这里可以选择一个默认的颜色} }然后在你想要改变颜色的地方用v-bind绑定就好了,例如:这里的:sty..._vue el-color-picker

迅为iTOP-4412精英版之烧写内核移植后的镜像_exynos 4412 刷机-程序员宅基地

文章浏览阅读640次。基于芯片日益增长的问题,所以内核开发者们引入了新的方法,就是在内核中只保留函数,而数据则不包含,由用户(应用程序员)自己把数据按照规定的格式编写,并放在约定的地方,为了不占用过多的内存,还要求数据以根精简的方式编写。boot启动时,传参给内核,告诉内核设备树文件和kernel的位置,内核启动时根据地址去找到设备树文件,再利用专用的编译器去反编译dtb文件,将dtb还原成数据结构,以供驱动的函数去调用。firmware是三星的一个固件的设备信息,因为找不到固件,所以内核启动不成功。_exynos 4412 刷机

Linux系统配置jdk_linux配置jdk-程序员宅基地

文章浏览阅读2w次,点赞24次,收藏42次。Linux系统配置jdkLinux学习教程,Linux入门教程(超详细)_linux配置jdk

随便推点

matlab(4):特殊符号的输入_matlab微米怎么输入-程序员宅基地

文章浏览阅读3.3k次,点赞5次,收藏19次。xlabel('\delta');ylabel('AUC');具体符号的对照表参照下图:_matlab微米怎么输入

C语言程序设计-文件(打开与关闭、顺序、二进制读写)-程序员宅基地

文章浏览阅读119次。顺序读写指的是按照文件中数据的顺序进行读取或写入。对于文本文件,可以使用fgets、fputs、fscanf、fprintf等函数进行顺序读写。在C语言中,对文件的操作通常涉及文件的打开、读写以及关闭。文件的打开使用fopen函数,而关闭则使用fclose函数。在C语言中,可以使用fread和fwrite函数进行二进制读写。‍ Biaoge 于2024-03-09 23:51发布 阅读量:7 ️文章类型:【 C语言程序设计 】在C语言中,用于打开文件的函数是____,用于关闭文件的函数是____。

Touchdesigner自学笔记之三_touchdesigner怎么让一个模型跟着鼠标移动-程序员宅基地

文章浏览阅读3.4k次,点赞2次,收藏13次。跟随鼠标移动的粒子以grid(SOP)为partical(SOP)的资源模板,调整后连接【Geo组合+point spirit(MAT)】,在连接【feedback组合】适当调整。影响粒子动态的节点【metaball(SOP)+force(SOP)】添加mouse in(CHOP)鼠标位置到metaball的坐标,实现鼠标影响。..._touchdesigner怎么让一个模型跟着鼠标移动

【附源码】基于java的校园停车场管理系统的设计与实现61m0e9计算机毕设SSM_基于java技术的停车场管理系统实现与设计-程序员宅基地

文章浏览阅读178次。项目运行环境配置:Jdk1.8 + Tomcat7.0 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。项目技术:Springboot + mybatis + Maven +mysql5.7或8.0+html+css+js等等组成,B/S模式 + Maven管理等等。环境需要1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。_基于java技术的停车场管理系统实现与设计

Android系统播放器MediaPlayer源码分析_android多媒体播放源码分析 时序图-程序员宅基地

文章浏览阅读3.5k次。前言对于MediaPlayer播放器的源码分析内容相对来说比较多,会从Java-&amp;amp;gt;Jni-&amp;amp;gt;C/C++慢慢分析,后面会慢慢更新。另外,博客只作为自己学习记录的一种方式,对于其他的不过多的评论。MediaPlayerDemopublic class MainActivity extends AppCompatActivity implements SurfaceHolder.Cal..._android多媒体播放源码分析 时序图

java 数据结构与算法 ——快速排序法-程序员宅基地

文章浏览阅读2.4k次,点赞41次,收藏13次。java 数据结构与算法 ——快速排序法_快速排序法