Atheros AR9271 ================================ .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Atheros Wi-Fi driver image ` * :ref:`Atheros AR9271 features ` * :ref:`Version Info ` * :ref:`Steps to load atheros wifi driver ` * :ref:`STEP 1: Check wifi chipset ` * :ref:`STEP 2: Check dmesg output ` * :ref:`STEP 3: Stop existing Wireless Modules ` * :ref:`STEP 4: Compile Linux ` * :ref:`STEP 5: Compile Wireless Modules ` * :ref:`STEP 6: Check for ".ko" files ` * :ref:`STEP 7: Check for ".zst" file, if present remove that file ` * :ref:`STEP 8: Restart your system ` * :ref:`STEP 9: Change directory to compiled kernel path ` * :ref:`STEP 10: Clear old kernel logs ` * :ref:`STEP 11: Insert the modules ` * :ref:`STEP 12: Check the loaded modules ` * :ref:`STEP 13: Check the interface name ` * :ref:`STEP 14: Let us do Wireless driver development ! ` * :ref:`STEP 14.1: Init path debugging ` * :ref:`Add prints in module init, module exit ` * :ref:`STEP 14.2: Control path debugging ` * :ref:`Add prints in nl80211_small_ops ` * :ref:`Add prints in mac80211_config_ops ` * :ref:`Add prints in ath9k_htc_ops ` * :ref:`STEP 14.3: Data path debugging ` * :ref:`Add prints in ieee80211_dataif_ops ` .. _barelinux_x86-64_wi-fi_atheros_AR9271_1: .. tab-set:: .. tab-item:: Wi-Fi Atheros Driver * In this section, you are going to learn .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow * How to load atheros wifi linux driver for Atheros AR9271 802.11n USB Wi-Fi Adapter .. _barelinux_x86-64_wi-fi_atheros_AR9271_2: .. tab-set:: .. tab-item:: Atheros AR9271 802.11n USB Wi-Fi Adapter .. image:: atheros_AR9271_image.jpg :alt: Diagram :width: 300 :height: 350 .. _barelinux_x86-64_wi-fi_atheros_AR9271_3: .. tab-set:: .. tab-item:: Atheros AR9271 802.11n USB Wi-Fi Adapter features =============================== ======================================= Features =============================== ======================================= Hardware Interface USB 2.0 Compatible Devices Laptop, Desktop Data Link Protocol USB Data Transfer Rate 150 Megabits Per Second Item Weight 0.03 Kilograms =============================== ======================================= .. _barelinux_x86-64_wi-fi_atheros_AR9271_4: .. tab-set:: .. tab-item:: Version Info =============================== ======================================= # Version =============================== ======================================= Ubuntu Ubuntu 22.04 64 bit Linux Kernel 6.9.0 Wifi chip Atheros Chipset version Atheros AR9271 =============================== ======================================= .. _barelinux_x86-64_wi-fi_atheros_AR9271_5: .. tab-set:: .. tab-item:: Steps to load Atheros wifi driver .. _barelinux_x86-64_wi-fi_atheros_AR9271_6: .. tab-set:: .. tab-item:: STEP 1: Check wifi chipset * Insert the wifi usb adapter to the usb port: * Check the wifi chipset by running the below command .. code-block:: shell :emphasize-lines: 4 test:~$ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 413c:301a Dell Computer Corp. Dell MS116 Optical Mouse Bus 001 Device 004: ID 0cf3:9271 Qualcomm Atheros Communications AR9271 802.11n Bus 001 Device 002: ID 0461:0010 Primax Electronics, Ltd HP PR1101U / Primax PMX-KPR1101U Keyboard Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub .. _barelinux_x86-64_wi-fi_atheros_AR9271_7: .. tab-set:: .. tab-item:: STEP 2: Check dmesg output * Check the dmesg output by running the below command: .. code-block:: shell test:~$ sudo dmesg [15075.422501] usb 1-5: new high-speed USB device number 7 using xhci_hcd [15075.587285] usb 1-5: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08 [15075.587298] usb 1-5: New USB device strings: Mfr=16, Product=32, SerialNumber=48 [15075.587303] usb 1-5: Product: UB93 [15075.587308] usb 1-5: Manufacturer: ATHEROS [15075.587311] usb 1-5: SerialNumber: 12345 .. _barelinux_x86-64_wi-fi_atheros_AR9271_8: .. tab-set:: .. tab-item:: STEP 3: Stop existing Wireless Modules * Stop applications by running the commands below: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ pwd /home/test/linux-6.9 test:~/linux-6.9$ sudo systemctl stop NetworkManager.service test:~/linux-6.9$ sudo killall wpa_supplicant hostapd test:~/linux-6.9$ ps -N | grep -i wpa_supplicant test:~/linux-6.9$ ps -N | grep -i hostapd * Run lsmod commands: .. code-block:: shell test:~/linux-6.9$ lsmod | grep -i mac80211 mac80211 1712128 1 ath9k_htc libarc4 12288 3 lib80211_crypt_tkip,lib80211_crypt_wep,mac80211 cfg80211 1376256 4 ath9k_htc,ath9k_common,ath,mac80211 test:~/linux-6.9$ lsmod | grep -i lib80211 lib80211_crypt_tkip 24576 0 lib80211_crypt_ccmp 16384 0 lib80211_crypt_wep 12288 0 libarc4 12288 3 lib80211_crypt_tkip,lib80211_crypt_wep,mac80211 lib80211 16384 3 lib80211_crypt_tkip,lib80211_crypt_wep,lib80211_crypt_ccmp test:~/linux-6.9$ lsmod | grep -i ath ath9k_htc 114688 0 ath9k_common 49152 1 ath9k_htc ath9k_hw 659456 2 ath9k_htc,ath9k_common ath 36864 3 ath9k_htc,ath9k_common,ath9k_hw mac80211 1712128 1 ath9k_htc cfg80211 1376256 4 ath9k_htc,ath9k_common,ath,mac80211 * Now, remove drivers by executing rmmod command as shown below: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ sudo rmmod ath9k_htc test@test-V520-15IKL:~/linux-6.9$ sudo rmmod ath9k_common test@test-V520-15IKL:~/linux-6.9$ sudo rmmod ath9k_hw test@test-V520-15IKL:~/linux-6.9$ sudo rmmod ath test@test-V520-15IKL:~/linux-6.9$ sudo rmmod mac80211 test@test-V520-15IKL:~/linux-6.9$ sudo rmmod lib80211_crypt_tkip test@test-V520-15IKL:~/linux-6.9$ sudo rmmod lib80211_crypt_ccmp test@test-V520-15IKL:~/linux-6.9$ sudo rmmod lib80211_crypt_wep test@test-V520-15IKL:~/linux-6.9$ sudo rmmod libarc4 test@test-V520-15IKL:~/linux-6.9$ sudo rmmod lib80211 test@test-V520-15IKL:~/linux-6.9$ sudo rmmod cfg80211 .. _barelinux_x86-64_wi-fi_atheros_AR9271_9: .. tab-set:: .. tab-item:: STEP 4: Compile Linux * Follow steps from the link : * Move to compiled Linux folder as shown below: .. code-block:: c $ cd /home/test/linux-6.9 .. _barelinux_x86-64_wi-fi_atheros_AR9271_10: .. tab-set:: .. tab-item:: STEP 5: Compile Wireless Modules * Check current directory: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ pwd /home/test/linux-6.9 * Start compilation for wireless folder: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ sudo make -C . M=net/wireless/ make: Entering directory "/home/test/linux-6.9" CC [M] net/wireless/core.o LD [M] net/wireless/cfg80211.o CC [M] net/wireless/lib80211.o CC [M] net/wireless/lib80211_crypt_wep.o CC [M] net/wireless/lib80211_crypt_ccmp.o CC [M] net/wireless/lib80211_crypt_tkip.o MODPOST net/wireless/Module.symvers LD [M] net/wireless/cfg80211.ko LD [M] net/wireless/lib80211.ko LD [M] net/wireless/lib80211_crypt_wep.ko LD [M] net/wireless/lib80211_crypt_ccmp.ko LD [M] net/wireless/lib80211_crypt_tkip.ko make: Leaving directory "/home/test/linux-6.9" * Run make command for mac80211 folder: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ sudo make -C . M=net/mac80211 make: Entering directory "/home/test/linux-6.9" CC [M] net/mac80211/main.o LD [M] net/mac80211/mac80211.o MODPOST net/mac80211/Module.symvers LD [M] net/mac80211/mac80211.ko make: Leaving directory "/home/test/linux-6.9" * Run make command for ath folder: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ sudo make -C . M=drivers/net/wireless/ath/ make: Entering directory "/home/test/linux-6.9" MODPOST drivers/net/wireless/ath/Module.symvers CC [M] drivers/net/wireless/ath/ath5k/ath5k.mod.o LD [M] drivers/net/wireless/ath/ath5k/ath5k.ko CC [M] drivers/net/wireless/ath/ath9k/ath9k.mod.o LD [M] drivers/net/wireless/ath/ath9k/ath9k.ko CC [M] drivers/net/wireless/ath/ath9k/ath9k_hw.mod.o LD [M] drivers/net/wireless/ath/ath9k/ath9k_hw.ko CC [M] drivers/net/wireless/ath/ath9k/ath9k_common.mod.o LD [M] drivers/net/wireless/ath/ath9k/ath9k_common.ko CC [M] drivers/net/wireless/ath/ath9k/ath9k_htc.mod.o LD [M] drivers/net/wireless/ath/ath9k/ath9k_htc.ko CC [M] drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.mod.o LD [M] drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.ko CC [M] drivers/net/wireless/ath/carl9170/carl9170.mod.o LD [M] drivers/net/wireless/ath/carl9170/carl9170.ko CC [M] drivers/net/wireless/ath/ath6kl/ath6kl_core.mod.o LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_core.ko CC [M] drivers/net/wireless/ath/ath6kl/ath6kl_sdio.mod.o LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko CC [M] drivers/net/wireless/ath/ath6kl/ath6kl_usb.mod.o LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko CC [M] drivers/net/wireless/ath/ar5523/ar5523.mod.o LD [M] drivers/net/wireless/ath/ar5523/ar5523.ko CC [M] drivers/net/wireless/ath/wil6210/wil6210.mod.o LD [M] drivers/net/wireless/ath/wil6210/wil6210.ko CC [M] drivers/net/wireless/ath/ath10k/ath10k_core.mod.o LD [M] drivers/net/wireless/ath/ath10k/ath10k_core.ko CC [M] drivers/net/wireless/ath/ath10k/ath10k_pci.mod.o LD [M] drivers/net/wireless/ath/ath10k/ath10k_pci.ko CC [M] drivers/net/wireless/ath/ath10k/ath10k_sdio.mod.o LD [M] drivers/net/wireless/ath/ath10k/ath10k_sdio.ko CC [M] drivers/net/wireless/ath/ath10k/ath10k_usb.mod.o LD [M] drivers/net/wireless/ath/ath10k/ath10k_usb.ko CC [M] drivers/net/wireless/ath/wcn36xx/wcn36xx.mod.o LD [M] drivers/net/wireless/ath/wcn36xx/wcn36xx.ko CC [M] drivers/net/wireless/ath/ath11k/ath11k.mod.o LD [M] drivers/net/wireless/ath/ath11k/ath11k.ko CC [M] drivers/net/wireless/ath/ath11k/ath11k_ahb.mod.o LD [M] drivers/net/wireless/ath/ath11k/ath11k_ahb.ko CC [M] drivers/net/wireless/ath/ath11k/ath11k_pci.mod.o LD [M] drivers/net/wireless/ath/ath11k/ath11k_pci.ko CC [M] drivers/net/wireless/ath/ath12k/ath12k.mod.o LD [M] drivers/net/wireless/ath/ath12k/ath12k.ko CC [M] drivers/net/wireless/ath/ath.mod.o LD [M] drivers/net/wireless/ath/ath.ko make: Leaving directory "/home/test/linux-6.9" .. _barelinux_x86-64_wi-fi_atheros_AR9271_11: .. tab-set:: .. tab-item:: STEP 6: Check for ".ko" files * Run find command to search for ".ko" files in ./net/wireless directory: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ find ./net/wireless/ -iname "*.ko" -print ./net/wireless/lib80211_crypt_wep.ko ./net/wireless/cfg80211.ko ./net/wireless/lib80211_crypt_ccmp.ko ./net/wireless/lib80211.ko ./net/wireless/lib80211_crypt_tkip.ko * Run find command to search for ".ko" files in ./net/mac80211 directory: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ find ./net/mac80211/ -iname "*.ko" -print ./net/mac80211/mac80211.ko * Run find command to search for ".ko" files in ./drivers/net/wireless/ath directory: .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ find ./drivers/net/wireless/ath/ -iname "*.ko" -print ./drivers/net/wireless/ath/ath10k/ath10k_pci.ko ./drivers/net/wireless/ath/ath10k/ath10k_core.ko ./drivers/net/wireless/ath/ath10k/ath10k_sdio.ko ./drivers/net/wireless/ath/ath10k/ath10k_usb.ko ./drivers/net/wireless/ath/ath12k/ath12k.ko ./drivers/net/wireless/ath/wil6210/wil6210.ko ./drivers/net/wireless/ath/ath11k/ath11k.ko ./drivers/net/wireless/ath/ath11k/ath11k_ahb.ko ./drivers/net/wireless/ath/ath11k/ath11k_pci.ko ./drivers/net/wireless/ath/wcn36xx/wcn36xx.ko ./drivers/net/wireless/ath/ath9k/ath9k_hw.ko ./drivers/net/wireless/ath/ath9k/ath9k_htc.ko ./drivers/net/wireless/ath/ath9k/ath9k.ko ./drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.ko ./drivers/net/wireless/ath/ath9k/ath9k_common.ko ./drivers/net/wireless/ath/ar5523/ar5523.ko ./drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko ./drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko ./drivers/net/wireless/ath/ath6kl/ath6kl_core.ko ./drivers/net/wireless/ath/ath.ko ./drivers/net/wireless/ath/ath5k/ath5k.ko ./drivers/net/wireless/ath/carl9170/carl9170.ko .. _barelinux_x86-64_wi-fi_atheros_AR9271_12: .. tab-set:: .. tab-item:: STEP 7: Check for ".zst" file, if present remove that file * Remove the following .zst files .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ find /lib/modules/6.9.0/kernel/net/wireless/ -iname "*.ko.zst*" -print /lib/modules/6.9.0/kernel/net/wireless/lib80211_crypt_wep.ko.zst /lib/modules/6.9.0/kernel/net/wireless/lib80211_crypt_ccmp.ko.zst /lib/modules/6.9.0/kernel/net/wireless/lib80211.ko.zst /lib/modules/6.9.0/kernel/net/wireless/cfg80211.ko.zst /lib/modules/6.9.0/kernel/net/wireless/lib80211_crypt_tkip.ko.zst test@test-V520-15IKL:~/linux-6.9$ find /lib/modules/6.9.0/kernel/net/mac80211/ -iname "*.ko.zst*" -print /lib/modules/6.9.0/kernel/net/mac80211/mac80211.ko.zst test@test-V520-15IKL:~/linux-6.9$ find /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ -iname "*.ko.zst*" -print /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath10k/ath10k_core.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath10k/ath10k_usb.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath10k/ath10k_sdio.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath10k/ath10k_pci.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath12k/ath12k.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/wil6210/wil6210.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath11k/ath11k.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath11k/ath11k_ahb.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath11k/ath11k_pci.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/wcn36xx/wcn36xx.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath9k/ath9k_hw.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath9k/ath9k_common.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath9k/ath9k_htc.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ar5523/ar5523.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath5k/ath5k.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/carl9170/carl9170.ko.zst /lib/modules/6.9.0/kernel/drivers/net/wireless/ath/ath.ko.zst .. _barelinux_x86-64_wi-fi_atheros_AR9271_13: .. tab-set:: .. tab-item:: STEP 8: Restart your system * You may restart your system using the command below: .. code-block:: c $ reboot .. _barelinux_x86-64_wi-fi_atheros_AR9271_14: .. tab-set:: .. tab-item:: STEP 9: Change directory to compiled kernel path * Repeat Step 3 .. code-block:: c $ cd /home/test/linux-6.9 * Repeat Step 5 .. _barelinux_x86-64_wi-fi_atheros_AR9271_15: .. tab-set:: .. tab-item:: STEP 10: Clear old kernel logs .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ sudo dmesg -c .. _barelinux_x86-64_wi-fi_atheros_AR9271_16: .. tab-set:: .. tab-item:: STEP 11: Insert the modules .. code-block:: c sudo insmod ./net/wireless/cfg80211.ko sudo insmod ./net/wireless/lib80211.ko sudo insmod ./lib/crypto/libarc4.ko sudo insmod ./net/wireless/lib80211_crypt_wep.ko sudo insmod ./net/wireless/lib80211_crypt_ccmp.ko sudo insmod ./net/wireless/lib80211_crypt_tkip.ko sudo insmod ./net/mac80211/mac80211.ko sudo insmod ./drivers/net/wireless/ath/ath.ko sudo insmod ./drivers/net/wireless/ath/ath9k/ath9k_hw.ko sudo insmod ./drivers/net/wireless/ath/ath9k/ath9k_common.ko sudo insmod ./drivers/net/wireless/ath/ath9k/ath9k_htc.ko .. _barelinux_x86-64_wi-fi_atheros_AR9271_17: .. tab-set:: .. tab-item:: STEP 12: Check the loaded modules .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ lsmod Module Size Used by ath9k_htc 114688 0 ath9k_common 49152 1 ath9k_htc ath9k_hw 659456 2 ath9k_htc,ath9k_common ath 36864 3 ath9k_htc,ath9k_common,ath9k_hw mac80211 1712128 1 ath9k_htc lib80211_crypt_tkip 24576 0 lib80211_crypt_ccmp 16384 0 lib80211_crypt_wep 12288 0 libarc4 12288 3 lib80211_crypt_tkip,lib80211_crypt_wep,mac80211 lib80211 16384 3 lib80211_crypt_tkip,lib80211_crypt_wep,lib80211_crypt_ccmp cfg80211 1376256 4 ath9k_htc,ath9k_common,ath,mac80211 .. _barelinux_x86-64_wi-fi_atheros_AR9271_18: .. tab-set:: .. tab-item:: STEP 13: Check for Wi-Fi interface name .. code-block:: shell test@test-V520-15IKL:~/linux-6.9$ iwconfig lo no wireless extensions. enp1s0 no wireless extensions. wlxc01c3031bc56 IEEE 802.11 ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=off Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off .. _barelinux_x86-64_wi-fi_atheros_AR9271_19: .. tab-set:: .. tab-item:: STEP 14: Let us do Wireless driver development ! .. _barelinux_x86-64_wi-fi_atheros_AR9271_20: .. tab-set:: .. tab-item:: STEP 14.1: Init path debugging .. _barelinux_x86-64_wi-fi_atheros_AR9271_21: .. tab-set:: .. tab-item:: Add prints in "module_init" and "module_exit" functions in files mentioned below * Open below files with vim and add prints in module_init and module_exit fucntions: .. code-block:: c test:linux-6.9$ pwd /home/test/linux-6.9 ./net/wireless/lib80211_crypt_wep.c ./net/wireless/lib80211.c ./net/wireless/lib80211_crypt_tkip.c ./net/wireless/lib80211_crypt_ccmp.c ./net/wireless/core.c ./net/mac80211/main.c ./drivers/net/wireless/ath/ath9k/htc_drv_init.c ./drivers/net/wireless/ath/ath9k/common.c .. _barelinux_x86-64_wi-fi_atheros_AR9271_22: .. tab-set:: .. tab-item:: STEP 14.2: Control path debugging .. _barelinux_x86-64_wi-fi_atheros_AR9271_23: .. tab-set:: .. tab-item:: Add prints in nl80211_small_ops * Open nl80211.c file with vim, add prints in all .doit functions in nl80211_small_ops .. code-block:: c test:linux-6.9/net/wireless$ vi nl80211.c static const struct genl_small_ops nl80211_small_ops[] = { { .cmd = NL80211_CMD_SET_WIPHY, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = nl80211_set_wiphy, .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = NL80211_CMD_GET_INTERFACE, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = nl80211_get_interface, .dumpit = nl80211_dump_interface, /* can be retrieved by unprivileged users */ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV), }, { .cmd = NL80211_CMD_SET_INTERFACE, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = nl80211_set_interface, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV | NL80211_FLAG_NEED_RTNL), }, .. _barelinux_x86-64_wi-fi_atheros_AR9271_24: .. tab-set:: .. tab-item:: Add prints in mac80211_config_ops * Open cfg.c file with vim, add prints in all functions in mac80211_config_ops .. code-block:: c test:linux-6.9/net/mac80211$ vi cfg.c const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, .change_virtual_intf = ieee80211_change_iface, .start_p2p_device = ieee80211_start_p2p_device, .stop_p2p_device = ieee80211_stop_p2p_device, .. _barelinux_x86-64_wi-fi_atheros_AR9271_25: .. tab-set:: .. tab-item:: Add prints in ath9k_htc_ops * Open htc_drv_main.c file with vim, add prints in all functions in ath9k_htc_ops .. code-block:: c test:linux-6.9/drivers/net/wireless/net/wireless/ath/ath9k$ vi htc_drv_main.c struct ieee80211_ops ath9k_htc_ops = { .add_chanctx = ieee80211_emulate_add_chanctx, .remove_chanctx = ieee80211_emulate_remove_chanctx, .change_chanctx = ieee80211_emulate_change_chanctx, .switch_vif_chanctx = ieee80211_emulate_switch_vif_chanctx, .tx = ath9k_htc_tx, .wake_tx_queue = ieee80211_handle_wake_tx_queue, .start = ath9k_htc_start, .stop = ath9k_htc_stop, .add_interface = ath9k_htc_add_interface, .remove_interface = ath9k_htc_remove_interface, .. _barelinux_x86-64_wi-fi_atheros_AR9271_26: .. tab-set:: .. tab-item:: STEP 14.3: Data path debugging .. _barelinux_x86-64_wi-fi_atheros_AR9271_27: .. tab-set:: .. tab-item:: Add prints in ieee80211_dataif_ops * Open iface.c file with vim, add prints in all functions in ieee80211_dataif_ops .. code-block:: c test:linux-6.9/net/mac80211$ vi ./iface.c static const struct net_device_ops ieee80211_dataif_ops = { .ndo_open = ieee80211_open, .ndo_stop = ieee80211_stop, .ndo_uninit = ieee80211_uninit, .ndo_start_xmit = ieee80211_subif_start_xmit, .ndo_set_rx_mode = ieee80211_set_multicast_list, .ndo_set_mac_address = ieee80211_change_mac, .ndo_get_stats64 = ieee80211_get_stats64, .ndo_setup_tc = ieee80211_netdev_setup_tc, };