1.单独编译 wlan 的驱动:
EULA=1 && source ./sources/meta-qti-connectivity/scripts/set_imx8_env.sh
bitbake -fc compile qcacld-ll-genoa
bitbake -fc compile wlan-cnss-core
driver编译完在这个目录
build\tmp\work\imx8mqevk-poky-linux\qcacld-ll-genoa\3.0-r0\qcacld-3.0
cnss在这个目录
build\tmp\work\imx8mqevk-poky-linux\wlan-cnss-core\git-r0\wlan-opensource\wlan-cnss-core
2.格式化sd卡
sudo fdisk -l //查看分区
Sudo gparted /dev/sdb //格式化sd
3.Interface 超过数量
修改 qcom_cfg.ini中gNumVdevs=4可以虚拟出4个interface
p2p可以通过在conf中添加p2p_no_group_interface=1,就不会虚拟出p2p-p2p0-0了。
4.Work queue
/*创建工作队列struct workqueue_struct,该函数会为cpu创建内核线程*/
test_wq = create_singlethread_workqueue("test_wq");
/*初始化工作struct work_struct,指定工作函数*/
INIT_WORK(&work1, work_func1);
INIT_WORK(&work2, work_func2);
INIT_WORK(&work3, work_func3);
/*将工作加入到工作队列中,最终唤醒内核线程*/
queue_work(test_wq, &work1);
queue_work(test_wq, &work2);
queue_work(test_wq, &work3);
//不同的work对应不同的工作队列func。可以工作在 同一个工作队列中test_wq。
5.crash生成
#echo related > /sys/bus/msm_subsys/devices/subsys0/restart_level
#subsystem_ramdump &
在Ini里面加上gEnableForceTargetAssert=1
然后load driver 运行iwpriv wlan0 crash_inject 1 0
6.FTM 模式下 wlan log没有输出的问题,找到了。是FTM模式把log输出关了
FTM wlan log的控制在 hdd_context_create()函数中,hdd_set_wlan_logging(hdd_ctx);
7.Cnss_diag 抓log
cnss_diag -s -c > drv.log &
Change the .ini file
Add this item "private_wext_control=2" to your .ini file to make the command setwlandbg valid.
Load wlan module and up the wlan0 interface.
start wpa_supplicant or hostapd
start cnss_diag, you can print the logs to the console by "cnss_diag -c"
Use setwlandbg to change module log level
iwpriv wlan0 setwlandbg <ID> <LEVEL> <1/0>
去除打印 echo 0 > /proc/sys/kernel/printk