I wanted to add WiFi ath9k driver (generally change the kernel config) using open embedded core.
First of all I have started with the tutorial to build image using open embedded (core). I did all the settings and finally used bitbake angstrom-lxde-image to build the image. The built image working well.
Now I want to add Wireless drivers to support PCIe atheros WiFi cards.
I used bitbake -c menueconfig virtual/kernel to change the config of the kernel. Then added the all device drivers I need. And then saved the config file and used bitbake virtual/kernel to build new kernel based on the new config. After that I used again bitbake angstrom-lxde-image to build new image.
But still new image doesn’t detect PCIe. Also, when I use ifconfig it doesn’t show any wlan0 interface (it just have eth0, lo and usb0).
Could you please help me with that?
Am I doing something wrong or missing some steps?
After flashing new image I used connmanctl enable wifi to activate wifi but it shows "net.conmanctl.Technology" doesn't exist.. Even in ifconfig output I can not see Wlan0.
Should I add something, more in kernel more than ath9k driver to activate WiFi?
After flashing the module should I install anything else to activate WiFi? Because in config file I can put <M> for config of ath9k driver and I can not put <*> fir that.
You’re taking the right steps by using the commands recommended by @sanchayan.maity.
Make sure you also include the firmware in your image. Add IMAGE_INSTALL_append = " linux-firmware-ath9k" to the conf/local.conf file.
When you boot the image, check for the relevant ath9k configs in the running kernel by typing:
zcat /proc/config.gz | grep CONFIG_ATH
Also check the currently loaded kernel configs by entering lsmod - see if the ath9k driver is listed. You may also try searching for the kernel modules in /lib/modules:
find /lib/modules -name "*ath*.ko"
If the module is in “/lib/modules”, but isn’t listed in “lsmod”, then try entering:
depmod -a
modprobe ath9k
Also, verify that the firmware was installed in the correct location. Check /lib/firmware; for example, try checking for any of the following:
I added driver for Atheros AR9382 mini-PCIe module to Apalis i.MX6 v2.3 Linux (Linux 3.10) via recompiling Linux kernel instead of bitbake. Below items were what I added to Linux configuration.
[user@host linux-toradex]:~#make menuconfig
[*] Networking support --->
-*- Wireless --->
<*> cfg80211 - wireless configuration API
<*> Generic IEEE 802.11 Networking Stack (mac80211)
Device Drivers --->
[*] Network device support --->
[*] Wireless LAN --->
<*> Atheros Wireless Cards --->
<*> Atheros 802.11n wireless cards support
[*] Atheros ath9k PCI/PCIe bus support
After compile and reflashing kernel image to Apalis i.MX6, AR9382 worked well.
Thanks for the information.
Could you please show me the output of this command in your system ?
find /lib/firmware -name "*ar9*"
I was wondering if your system has the firmware module for this specific Atheros AR9382 module? Something like : /lib/firmware/ar9382.fw. In my system after flashing new image I have all ath9k drivers and I checked the same setting in menuconfig but I don’t know why in find /lib/firmware I just see one atheros module: ar9271.fw
In addition to that what is difference between building kernel from the source or building using bitbake?
This is also the output of dmesg | grep ath:
[ 7.415773] Modules linked in: ath9k(+) ath9k_common ath9k_hw ath mac80211 max9526_tvin v4l2_int_device cfg80211 libcomposite configfs
[ 7.428349] [<8065b2f8>] (dump_stack) from [<8002e464>] (warn_slowpath_common+0x74/0x90)
[ 7.428364] [<8002e3f0>] (warn_slowpath_common) from [<8002e524>] (warn_slowpath_null+0x24/0x2c)
[ 7.428389] [<8002e500>] (warn_slowpath_null) from [<80070744>] (request_threaded_irq+0x104/0x12c)
[ 7.428492] [<80070640>] (request_threaded_irq) from [<7f1470d4>] (ath_pci_probe+0x1a0/0x2dc [ath9k])
[ 7.428573] [<7f146f34>] (ath_pci_probe [ath9k]) from [<802d46b8>] (pci_device_probe+0x7c/0xd0)
[ 7.428783] [<802d415c>] (__pci_register_driver) from [<7f147348>] (ath_pci_init+0x28/0x2c [ath9k])
[ 7.428843] [<7f147320>] (ath_pci_init [ath9k]) from [<7f156010>] (ath9k_init+0x10/0x4c [ath9k])
[ 7.428875] [<7f156000>] (ath9k_init [ath9k]) from [<80008874>] (do_one_initcall+0x100/0x15c)
[ 7.428968] ath9k 0000:01:00.0: request_irq failed
[ 7.429084] ath9k: probe of 0000:01:00.0 failed with error -22
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
# CONFIG_CFG80211_INTERNAL_REGDB is not set
# CONFIG_CFG80211_WEXT is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_HAS_RC=y
# CONFIG_MAC80211_RC_PID is not set
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
# CONFIG_MAC80211_MESH is not set
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_MAC80211_HWSIM is not set
You should be able to do this in Yocto by modifying the device tree of the kernel source in the work-shared directory and then force recompile using bitbake -f -c compile virtual/kernel.
I am trying to do a similar procedure for a Altera SoC where in I want to interface TP-Link TL-WN722N wifi dongle. The option (Atheros/Qualcomm)is enabled in make menuconfig .
When I plug in the device in the Altera SoC, I am able to see the device ID and name with the dmesg command. Howeer, I observe the following errors as well:
[ 2.223039] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271
[ 2.229735] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 2.237129] usb 1-1: Product: USB2.0 WLAN
[ 2.241124] usb 1-1: Manufacturer: ATHEROS
[ 2.245215] usb 1-1: SerialNumber: 12345
[ 5.351145] EXT4-fs (mmcblk0p2): recovery complete
[ 5.359958] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 5.368058] VFS: Mounted root (ext3 filesystem) on device 179:2.
[ 5.375560] devtmpfs: mounted
[ 5.379310] Freeing unused kernel memory: 1024K (c0900000 - c0a00000)
**[ 5.670820] systemd[1]: Failed to insert module 'autofs4': No such file or directory**
[ 5.722709] systemd[1]: systemd 226 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD +IDN)
[ 5.741016] systemd[1]: Detected architecture arm.
[ 5.773409] systemd[1]: Set hostname to <cyclone5>.
It states the error : Failed to insert module ‘autofs4’ .
Have you faced such a situation ? what could be the possible reasons?
Also when I see the path /lib/modules/.../kernel/drivers/net I observe only 2 modules ethernet and mdio.ko
can anyone please explain me the steps to add the driver. I am trying to interface the wifi dongle with cyclone v processor and unfortunately the drivers are not present in /lib/modules/../kernel/drivers/net/.
I have also enabled the appropriate ath9k_htc option in the make menuconfig option.
The firmware is present in the folder /lib/firmware . However when I plug in, I observe the following error:
[ 2.309362] usb 1-1: ath9k_htc: Firmware htc_9271-1.4.0.fw requested
[ 2.317158] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 2.325761] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[ 2.331607] usb 1-1: Direct firmware load for htc_9271.fw failed with error -2
[ 2.338817] usb 1-1: no suitable firmware found!
[ 2.343428] usb 1-1: ath9k_htc: Failed to get firmware htc_9271.fw
[ 2.349896] usb 1-1: ath9k_htc: USB layer deinitialized
Can anyone guide me with this issue?
Update: So I could locate the drivers now in the filesystem. /sys/bus/usb/drivers/ath9k/
SO the issue currently is with the firmware. The USB dongle somehow does not seem to find the firmware. There was no folder named firmware in /lib/so I created manually a new folder named firmware and placed the firmware fileshtc_7010.fwandhtc_9271.fwin there. But the usb tried to search forath9k_htc/htc_9271-1.4.0.fwin the first try and thenhtc_9271.fw. My question is now that is the path/lib/firmware` correct for placing the firmware files there for the Angstrom, or should they b placed at some other path?
can anyone please explain me the steps to add the driver. I am trying to interface the wifi dongle with cyclone v processor and unfortunately the drivers are not present in /lib/modules/../kernel/net/.
I have also enabled the appropriate ath9k_htc option in the make menuconfig option. The firmware is present in the folder lib/firmware . However when I plug in, I observe the following error:
[ 2.309362] usb 1-1: ath9k_htc: Firmware htc_9271-1.4.0.fw requested
[ 2.317158] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 2.325761] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[ 2.331607] usb 1-1: Direct firmware load for htc_9271.fw failed with error -2
[ 2.338817] usb 1-1: no suitable firmware found!
[ 2.343428] usb 1-1: ath9k_htc: Failed to get firmware htc_9271.fw
[ 2.349896] usb 1-1: ath9k_htc: USB layer deinitialized