# [Solved]: Wireless not working

## pankaj13

Hi,

I just did a fresh install of Gentoo on my laptop and wireless does not seem to work. There used to be a "wlp3s0" earlier that is not showing up now. Here are few more details:

```
localhost ~ # ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000

    link/ether a8:1e:84:36:14:d5 brd ff:ff:ff:ff:ff:ff

3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000

    link/sit 0.0.0.0 brd 0.0.0.0

```

```
lspci -v

03:00.0 Network controller: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter (rev 31)

   Subsystem: Lite-On Communications Inc QCA9377 802.11ac Wireless Network Adapter

   Flags: bus master, fast devsel, latency 0, IRQ 128

   Memory at b4200000 (64-bit, non-prefetchable) [size=2M]

   Capabilities: [40] Power Management version 3

   Capabilities: [50] MSI: Enable+ Count=1/8 Maskable+ 64bit-

   Capabilities: [70] Express Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [148] Virtual Channel

   Capabilities: [168] Device Serial Number 00-00-00-00-00-00-00-00

   Capabilities: [178] Latency Tolerance Reporting

   Capabilities: [180] L1 PM Substates

   Kernel driver in use: ath10k_pci

```

```
dmesg

[    1.428327] pcieport 0000:00:1d.2: PCIe Bus Error: severity=Corrected, type=Physical Layer, (Receiver ID)

[    1.428329] pcieport 0000:00:1d.2:   device [8086:9d1a] error status/mask=00000001/00002000

[    1.428332] pcieport 0000:00:1d.2:    [ 0] RxErr                  (First)

[    1.509503] ath10k_pci 0000:03:00.0: Failed to find firmware-N.bin (N between 2 and 6) from ath10k/QCA9377/hw1.0: -2

[    1.509505] ath10k_pci 0000:03:00.0: could not fetch firmware files (-2)

[    1.509506] ath10k_pci 0000:03:00.0: could not probe fw (-2)

```

As part of sys-kernel/linux-firmware I see that following files are installed on the machine.

```
localhost ~ # ls -al /lib/firmware/ath10k/QCA9377/hw1.0/

total 1132

drwxr-xr-x 2 root root   4096 Jan 19 08:13 .

drwxr-xr-x 3 root root   4096 Jan 18 15:53 ..

-rw-r--r-- 1 root root 304308 Jan 18 18:45 board-2.bin

-rw-r--r-- 1 root root   8124 Jan 18 18:45 board.bin

-rw-r--r-- 1 root root 783336 Jan 18 18:45 firmware-5.bin

-rw-r--r-- 1 root root  46143 Jan 18 18:45 notice_ath10k_firmware-5.txt

```

Any pointers on how to get wireless working again?

Thanks,

Pankaj

[Moderator edit: added [code] tags to preserve output layout. -Hu]Last edited by pankaj13 on Tue Jan 21, 2020 5:44 am; edited 1 time in total

----------

## Logicien

Maybe read /lib/firmware/ath10k/QCA9377/hw1.0/notice_ath10k_firmware-5.txt can give some hints. 

You have firmware-5.bin but ath10k say that it search for firmware-2.bin, firmware-3.bin, firmware-4.bin, firmware-5.bin, firmware-6.bin. You probably need more firmwares files to install. 

If it is working with a live media have a look of what's in the directory /lib/firmware/ath10k/QCA9377/hw1.0/ of this media. You will see if something is missing in your installation.

In Arch and Debian I have firmware-5.bin  and firmware-6.bin in this directory in plus of board-2.bin  and board.bin but no notice_ath10k_firmware-5.txt. One directory up give

```
ls /mnt/archx/lib/firmware/ath10k/

QCA4019  QCA6174  QCA9377  QCA9887  QCA9888  QCA988X  QCA9984  QCA99X0  WCN3990
```

----------

## Jaglover

Possibly the driver is built into kernel and the firmware is not.

----------

## pankaj13

So booted with the install USB and got some mixed results.

The install disk is able to see the wireless interface.

```
livecd ~ # ip link

<snip>

2: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000

    link/ether a8:1e:84:36:14:d5 brd ff:ff:ff:ff:ff:ff

3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DORMANT group default qlen 1000

    link/ether 58:00:e3:98:b8:eb brd ff:ff:ff:ff:ff:ff

```

So tried to activate it by following:

Created a wpa_supplicant.conf using wpa_passphrase from command line

```
livecd ~ # cat /etc/wpa_supplicant/wpa_supplicant.conf

network={

   ssid="sonali"

   #psk: shows the correct password so psk_key below should work

   psk=2586c51edc4aaaf8da0c4ea7d227951bb7915e526d7ed2032087efc179fe43c5

}

```

```
livecd ~ # wpa_supplicant -B -i wlp3s0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D nl80211

Successfully initialized wpa_supplicant

nl80211: Could not set interface 'p2p-dev-wlp3s0' UP

nl80211: deinit ifname=p2p-dev-wlp3s0 disabled_11b_rates=0

p2p-dev-wlp3s0: Failed to initialize driver interface

P2P: Failed to enable P2P Device interface

```

See following lines in dmesg related errors with wlp3s0:

```
[ 1147.224904] wlp3s0: authenticate with cc:40:d0:3f:d1:e7

[ 1147.271926] wlp3s0: send auth to cc:40:d0:3f:d1:e7 (try 1/3)

[ 1147.271947] wlp3s0: aborting authentication with cc:40:d0:3f:d1:e7 by local choice (Reason: 3=DEAUTH_LEAVING)

[ 1148.139659] pcieport 0000:00:1d.3: AER: Corrected error received: 0000:00:1d.3

[ 1148.139664] pcieport 0000:00:1d.3: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID)

[ 1148.139665] pcieport 0000:00:1d.3:   device [8086:9d1b] error status/mask=00001000/00002000

[ 1148.139667] pcieport 0000:00:1d.3:    [12] Timeout

```

Also noticed that the live USB has few more driver files (firmware-6.bin):

```
livecd # ls -l /lib/firmware/ath10k/QCA9377/hw1.0/

-rw-r--r-- 1 root root 304308 Dec 19 03:03 board-2.bin

-rw-r--r-- 1 root root   8124 Dec 19 03:03 board.bin

-rw-r--r-- 1 root root 783336 Dec 19 03:03 firmware-5.bin

-rw-r--r-- 1 root root 751436 Dec 19 03:03 firmware-6.bin

-rw-r--r-- 1 root root  46143 Dec 19 03:03 notice_ath10k_firmware-5.txt

-rw-r--r-- 1 root root  53425 Dec 19 03:03 notice_ath10k_firmware-6.txt

```

But since the wireless did not work with this driver, not sure if it is worth trying on the installation.

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## pankaj13

 *Jaglover wrote:*   

> Possibly the driver is built into kernel and the firmware is not.

 

This is the output from lspci -v:

```
03:00.0 Network controller: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter (rev 31)

   Subsystem: Lite-On Communications Inc QCA9377 802.11ac Wireless Network Adapter

   Flags: bus master, fast devsel, latency 0, IRQ 128

   Memory at b4200000 (64-bit, non-prefetchable) [size=2M]

   Capabilities: [40] Power Management version 3

   Capabilities: [50] MSI: Enable+ Count=1/8 Maskable+ 64bit-

   Capabilities: [70] Express Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [148] Virtual Channel

   Capabilities: [168] Device Serial Number 00-00-00-00-00-00-00-00

   Capabilities: [178] Latency Tolerance Reporting

   Capabilities: [180] L1 PM Substates

   Kernel driver in use: ath10k_pci

```

  :Rolling Eyes: 

The last line shows the driver,is there a way to confirm if this driver is loading from kernel or firmware?

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## Logicien

The  driver ath10k_pci is a Linux driver and it's the driver who load the firmware files and not firmware who load the ath10k_pci driver. 

The possibility Jaglover say is that the driver is compiled in the kernel image itself what need the good firmware files to be in the kernel image too for the driver be able to load the good firmware files when it probe the Atheros wireless network card.

If the ath10k_pci driver is compile as a Linux module than the driver probe the Atheros wireless network card only when the real root partition is mounted than, the firmware files can be loaded from the real root directory /lib/firmware/ath10k/QCA9377/hw1.0/.

To know how the ath10k_pci driver is compiled from the Linux sources you must look at the .config file of the Linux sources or do that after the boot is finished:

```
find /lib/modules -iname *ath10k*
```

You can try

```
wpa_supplicant -B -i wlp3s0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext
```

wext is an alternative to nl80211 as a wpa_supplicant driver.

----------

## pankaj13

So kinda solved this problem   :Smile: 

Checked the live USB for loaded modules:

```
livecd ~ # find /lib/modules -iname *ath10k*

/lib/modules/4.19.86-gentoo-x86_64/kernel/drivers/net/wireless/ath/ath10k

/lib/modules/4.19.86-gentoo-x86_64/kernel/drivers/net/wireless/ath/ath10k/ath10k_core.ko

/lib/modules/4.19.86-gentoo-x86_64/kernel/drivers/net/wireless/ath/ath10k/ath10k_pci.ko

```

Similar search on installed version showed nothing:

```
pLaptop ~ # find /lib/modules -iname *ath10k*
```

So reconfigured the kernel and added the Atheros options as modules:

```
Generic Driver Options  --->

    --- Network device support

   [*]   Wireless LAN  --->

      Atheros 802.11n wireless cards support

   [M]      Atheros ath9k PCI/PCIe bus support

      Atheros 802.11ac wireless cards support

   [M]      Atheros ath10k PCI support

```

After recompiling, the modules showed up correctly on the installed system:

```
pLaptop ~ # find /lib/modules -iname *ath10k*

/lib/modules/4.19.97-gentoo/kernel/drivers/net/wireless/ath/ath10k

/lib/modules/4.19.97-gentoo/kernel/drivers/net/wireless/ath/ath10k/ath10k_pci.ko

/lib/modules/4.19.97-gentoo/kernel/drivers/net/wireless/ath/ath10k/ath10k_core.ko

/lib/modules/4.19.97-gentoo/kernel/drivers/net/wireless/ath/ath10k/ath10k_usb.ko

```

Then disabled wpa_supplicant using systemctl command, after reboot the "wlp3s0" shows up as active interface and can be connected using the GNOME UI network settings.

However one confusion I have is that both the options that I reconfigured in the kernel earlier had "*" meaning that they were compiled into the kernel but I changed it to "M".

Is there an explanation why something compiled into kernel would not work but a module that can be loaded will work for simialr configuration?

And lastly thanks to Logicien & Jaglover for all the pointers/comments that really triggered my thinking too!!!!   :Very Happy:   :Idea:   :Idea:   :Idea: 

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## Hu

When the driver loads, it tries to load any needed firmware.  If the driver is built in, it loads before your root filesystem mounts, so it cannot access firmware stored on the filesystem.  If the driver is built in, then you must embed the firmware in the kernel.  When you use a module, the module is also on the root filesystem, so the kernel cannot load and initialize it until after the root filesystem is mounted.  At that point, the firmware is also available.

----------

## pankaj13

Thanks Hu, the explanation makes perfect sense!!

----------

