# [resolved] Dell XPS 15 issue with BRCFMAC wifi card

## archenroot

Hi guys,

I know this is probably to report as bug to resolve, but I would like to confirm first what is the issue really. My wifi doesn't work for few months already in my DELL XPS 15 9550. I tried on multiple kernels:

```
  [1]   linux-4.4.39-gentoo

  [2]   linux-4.8.6-gentoo

  [3]   linux-4.9.0-gentoo

  [4]   linux-4.9.4-gentoo

  [5]   linux-4.9.6-gentoo-r1

  [6]   linux-4.10.0-gentoo *

```

I think I was able to get it working once, but only on network without security enabled.

Dmesg report from latest kernel (same as previous) is:

```
ares ~ # dmesg |grep brcmfmac

[    5.318417] bus: 'platform': add driver brcmfmac

[    5.318426] bus: 'platform': remove driver brcmfmac

[    5.318428] driver: 'brcmfmac': driver_release

[    5.318431] bus: 'sdio': add driver brcmfmac

[    5.318434] bus: 'usb': add driver brcmfmac

[    5.318443] usbcore: registered new interface driver brcmfmac

[    5.318444] bus: 'pci': add driver brcmfmac

[    5.318447] bus: 'pci': driver_probe_device: matched device 0000:02:00.0 with driver brcmfmac

[    5.318448] bus: 'pci': really_probe: probing driver brcmfmac with device 0000:02:00.0

[    5.318449] brcmfmac 0000:02:00.0: no default pinctrl state

[    5.318477] brcmfmac 0000:02:00.0: enabling device (0000 -> 0002)

[    5.424629] driver: 'brcmfmac': driver_bound: bound to device '0000:02:00.0'

[    5.424632] bus: 'pci': really_probe: bound device 0000:02:00.0 to driver brcmfmac

[    5.424650] __allocate_fw_buf: fw-brcm/brcmfmac43602-pcie.bin buf=ffffa22308550900

[    5.424658] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin failed with error -2

[    5.424660] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/brcm/brcmfmac43602-pcie.bin failed with error -2

[    5.424662] brcmfmac 0000:02:00.0: loading /lib/firmware/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin failed with error -2

[    5.424775] brcmfmac 0000:02:00.0: direct-loading brcm/brcmfmac43602-pcie.bin

[    5.424777] fw_set_page_data: fw-brcm/brcmfmac43602-pcie.bin buf=ffffa22308550900 data=ffffb01f46001000 size=635449

[    5.424780] __allocate_fw_buf: fw-brcm/brcmfmac43602-pcie.txt buf=ffffa223085509c0

[    5.424782] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.txt failed with error -2

[    5.424784] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/brcm/brcmfmac43602-pcie.txt failed with error -2

[    5.424786] brcmfmac 0000:02:00.0: loading /lib/firmware/4.10.0-gentoo/brcm/brcmfmac43602-pcie.txt failed with error -2

[    5.424789] brcmfmac 0000:02:00.0: loading /lib/firmware/brcm/brcmfmac43602-pcie.txt failed with error -2

[    5.424789] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2

[    5.424790] __fw_free_buf: fw-brcm/brcmfmac43602-pcie.txt buf=ffffa223085509c0 data=          (null) size=0

[    5.517574] __fw_free_buf: fw-brcm/brcmfmac43602-pcie.bin buf=ffffa22308550900 data=ffffb01f46001000 size=635449

[    5.936481] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Nov 10 2015 06:38:10 version 7.35.177.61 (r598657) FWID 01-ea662a8c

[    5.976927] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

[    9.111443] brcmfmac 0000:02:00.0 wlp2s0: renamed from wlan0

[   10.290098] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

[   10.980278] brcmfmac: brcmf_cfg80211_add_iface: iface validation failed: err=-16

```

I am not sure if to report to kernel or gentoo this bug as soon as the file which it tries to load doesn't exists. 

1. Issue

The directory which is used to search for firmware file/lib/firmware/updates/brcm doesn't exist. But I found directory /lib/firmware/brcm/, so I took it and created manually the non-existing one(/update).

2. Issue

The required file is missing and not available in installed firmware.

```
ares ~ # ls -la /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin

ls: cannot access '/lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin': No such file or directory

```

So it is looking for file which is not installed anyway (not part of package linux-firmware)

The firmware I used to install is:

```
ares update # equery uses linux-firmware

[ Legend : U - final flag setting for installation]

[        : I - package is installed with flag     ]

[ Colors : set, unset                             ]

 * Found these USE flags for sys-kernel/linux-firmware-99999999:

 U I

 - - savedconfig : Allows individual selection of firmware files
```

So I checked the files which arrived with this firmware package and here we are:

```
ares brcm # ls

bcm4329-fullmac-4.bin     brcmfmac43241b4-sdio.bin  brcmfmac4335-sdio.bin    brcmfmac4354-sdio.bin      brcmfmac43602-pcie.bin

bcm43xx-0.fw              brcmfmac43241b5-sdio.bin  brcmfmac43362-sdio.bin   brcmfmac43569.bin          brcmfmac4366b-pcie.bin

bcm43xx_hdr-0.fw          brcmfmac43242a.bin        brcmfmac4339-sdio.bin    brcmfmac4356-pcie.bin      brcmfmac4371-pcie.bin

brcmfmac43143.bin         brcmfmac4329-sdio.bin     brcmfmac43430-sdio.bin   brcmfmac4356-sdio.bin

brcmfmac43143-sdio.bin    brcmfmac4330-sdio.bin     brcmfmac43455-sdio.bin   brcmfmac43570-pcie.bin

brcmfmac43236b.bin        brcmfmac43340-sdio.bin    brcmfmac4350c2-pcie.bin  brcmfmac4358-pcie.bin

brcmfmac43241b0-sdio.bin  brcmfmac4334-sdio.bin     brcmfmac4350-pcie.bin    brcmfmac43602-pcie.ap.bin
```

3. Issue

So I see similar file exists brcmfmac43602-pcie.ap.bin, but the kernel tries to load brcmfmac43602-pcie.bin, does the ap stands for Access Point or? If yes, then the client firmware is missing?

Thanks for suggestions.

----------

## fedeliallalinea

You can post output of command  grep FIRMWARE /usr/src/linux/.config?

I use sys-kernel/linux-firmware-20161205 and firmware brcmfmac43602-pcie.bin exists

```
$ ls /lib/firmware/brcm/brcmfmac43602-pcie.bin                                                                                                                         

/lib/firmware/brcm/brcmfmac43602-pcie.bin 
```

----------

## NeddySeagoon

archenroot,

Its failing for 

```
[    5.424658] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin failed with error -2 
```

Does the file /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin exist? 

That's an odd path to look in, as it appears to be kernel specific.

You will need to find brcmfmac43602-pcie.bin on the web and add it to your collection of firmware.

Please pastetbin your entire kernel kernel .config file and your entire dmesg.

What goes where and when depends on how the brcmfmac driver is configured.

Its not a kernel bug yet.

----------

## archenroot

Hi,

thanks for reply! 

DMESG output.

Kernel 4.10.0 .config file.

 *Quote:*   

> I use sys-kernel/linux-firmware-20161205 and firmware brcmfmac43602-pcie.bin exists 
> 
> Code:
> 
> $ ls /lib/firmware/brcm/brcmfmac43602-pcie.bin                                                                                                                          
> ...

 

I installed =sys-kernel/linux-firmware-20161205 and now the file exists:

```
ares / # ls -la /lib/firmware/brcm/brcmfmac43602-pcie.bin

-rw-r--r-- 1 root root 635449 Feb 28 10:39 /lib/firmware/brcm/brcmfmac43602-pcie.bin
```

There is also version =sys-kernel/linux-firmware-20170113:0, when I install this version, the file also exists. 

I finally tried again install the package =sys-kernel/linux-firmware-99999999, and the file now exists  :Smile:   :Sad: , so it was some kind of my mistake or the file was not temporarily available when I installed the firmware, not sure here.

Ok, so I have file:

```
ares / # ls -la /lib/firmware/brcm/brcmfmac43602-pcie.bin

-rw-r--r-- 1 root root 635449 Feb 28 10:44 /lib/firmware/brcm/brcmfmac43602-pcie.bin
```

Now why the kernel is looking in different folder(/lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.bin) instead of the installed location? But first I will try to reboot the system, maybe the update folder is used(created) by kernel on load.

----------

## archenroot

Actually there is message:

```
brcmfmac 0000:02:00.0: direct-loading brcm/brcmfmac43602-pcie.bin
```

So the other messages are just probably reporting error while trying to load firmware file from other default location, if yes, then it is boring to get error even file is loaded... don't you think?

Still there remains issue with:

```
[    5.785479] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Nov 10 2015 06:38:10 version 7.35.177.61 (r598657) FWID 01-ea662a8c

[    5.826084] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

[    9.067001] brcmfmac 0000:02:00.0 wlp2s0: renamed from wlan0

[   10.718935] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

[   10.833194] brcmfmac: brcmf_cfg80211_add_iface: iface validation failed: err=-16
```

Which I think is actually some kind of bug, because when I try to connect, I get:

```
[  649.459811] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)

[  649.459812] brcmfmac: brcmf_cfg80211_scan: scan error (-11)

[  650.460985] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)

[  650.460986] brcmfmac: brcmf_cfg80211_scan: scan error (-11)

[  650.854268] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready

[  650.861587] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)
```

So this i actually probably the bug I was hunting down...

FIRMWARE Analysis

I actually found following site https://wikidevi.com/wiki/Brcmfmac, where are 3 reported variants for this chip:

```
Broadcom BCM943602BAED   NGFF   QDS-BRCM1088      14e4   aa52   BCM43602   abgn+ac   3x3:3      2015-07-02

Broadcom BCM943602CDP   PCIe (non-standard connector)   QDS-BRCM1089      14e4   43ba   BCM43602   abgn+ac   3x3:3      2015-05-30

Broadcom BCM943602CS   PCIe (non-standard connector)   QDS-BRCM1080      14e4   43ba   BCM43602   abgn+ac   3x3:3   00:10:18   2014-08-01
```

Here some more details about my device: https://wikidevi.com/wiki/Broadcom_BCM943602CDP

I examinded my chip by:

```
ares ~ # lspci -nn | grep Broadcom

02:00.0 Network controller [0280]: Broadcom Corporation BCM43602 802.11ac Wireless LAN SoC [14e4:43ba] (rev 01)

```

Fallback

I found also some bugs still active with this device and as it is really blocking me from proper daily usage (I am using mobile phone as Wifi client and go with USB thetering), I am ready to reinstall the wifi device with some other one:

http://www.windowscentral.com/upgrade-wifi-dell-xps-15

The question is for me what is good Wifi (not problematic) wireless chip I should go with in Linux?

----------

## NeddySeagoon

archenroot,

Heres the important bits of dmesg.

```
[    0.844715] Trying to unpack rootfs image as initramfs...

[    4.798772] Freeing initrd memory: 42464K
```

That's the initrd doing its thing.

```
[    5.198431] i915 0000:00:02.0: loading /lib/firmware/updates/4.10.0-gentoo/i915/skl_dmc_ver1_26.bin failed with error -2
```

Eww. Thats for your video card.

```
[    5.424782] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.txt failed with error -2
```

```
[    8.146577] EXT4-fs (sda6): couldn't mount as ext3 due to feature incompatibilities

[    8.148282] EXT4-fs (sda6): couldn't mount as ext2 due to feature incompatibilities

[    8.150444] EXT4-fs (sda6): INFO: recovery required on readonly filesystem

[    8.150444] EXT4-fs (sda6): write access will be enabled during recovery

[    8.169456] EXT4-fs (sda6): recovery complete

[    8.172363] EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
```

This tells that you have an intramd but none of your firmware is loaded from it.

Looking at your kernel we see. 

```
CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_FW_LOADER=y

CONFIG_FIRMWARE_IN_KERNEL=y

CONFIG_EXTRA_FIRMWARE=""

CONFIG_DRM_I915=y

CONFIG_BRCMFMAC=y
```

Both your i915 and wifi driver are built into the kernel but the firmware isn't, that's the CONFIG_EXTRA_FIRMWARE=""

What happens is that the kernel loads and initialises itself and built in drivers. Part of the initialisation process is to load the required firmware.

Built in drivers must have the firmware built into the kernel.  Root isn't mounted when the firmware is loaded, so /lib/firmware cannot be read.

Conversely, drivers configured as modules are loaded from /lib/modules/'uname -r'/... which is on the root filesystem, so /lib/firmware can be read.

When you are finding out (by trial and error) which firmware you need, modules are faster, since you can modprobe -r modules.

Oh, not the video driver, as its always in use.

Once you know what you want you can move back to built in, including the firmware.

```
                         [*] Prevent firmware from being built                                                            │ │  

  │ │                          -*- Userspace firmware loading support                                                           │ │  

  │ │                          [ ]   Include in-kernel firmware blobs in kernel binary                                          │ │  

  │ │                          (space separated list of firmware to build in ) External firmware blobs to build into the kernel │ │  

  │ │                          (/path/to/firmware/dir) Firmware blobs root directory                                            │ │
```

----------

## fedeliallalinea

 *NeddySeagoon wrote:*   

> 
> 
> ```
> [    5.424782] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.txt failed with error -2
> ```
> ...

 

You can ignore this message, or at least that's what I did (I've same notebook), the kernel complains this firmware but not exists (only .bin exists) and my wireless work.

----------

## archenroot

Ok, now I learned something! Great thanks for this explanation. I will give this a try(EXTRA path) and will report back.

It is also clear now how could be useful using modules as otherwise I go usually as everything builtin the kernel.

Regards,

Ladislav

----------

## NeddySeagoon

archenroot,

Both ways work.  Some drivers are in two or more pieces.

You must ensure that all the pieces are in the same place.

----------

## archenroot

Hi guys,

I updated and recompiled kernel with new .config which includes following:

```
ares ~ # cat /usr/src/linux/.config |grep FIRMWARE

CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_FIRMWARE_IN_KERNEL=y

CONFIG_EXTRA_FIRMWARE="brcm/brcmfmac43602-pcie.bin"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

# CONFIG_CYPRESS_FIRMWARE is not set

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

CONFIG_FIRMWARE_EDID=y

CONFIG_FIRMWARE_MEMMAP=y

# CONFIG_GOOGLE_FIRMWARE is not set

CONFIG_TEST_FIRMWARE=y
```

The firmware is loaded this time correctly, here is dmesg directly after system start.

So this fragment is saying it loaded the firmware:

```
[   10.745649] brcmfmac 0000:02:00.0: using built-in brcm/brcmfmac43602-pcie.bin
```

There still remains following reported issues, but not sure if those are causing or not some issue:

```
[   16.898230] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

[   18.189725] brcmfmac: brcmf_cfg80211_add_iface: iface validation failed: err=-16
```

But here are issues when connecting to some WPA2 secured wifi from /var/log/messages

And here repeated on multiple tries to connect some segment from dmesg:

```
[  314.692251] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready

[  322.891180] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)

[  322.891181] brcmfmac: brcmf_cfg80211_scan: scan error (-11)

[  323.892674] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)

[  323.892692] brcmfmac: brcmf_cfg80211_scan: scan error (-11)

[  324.277451] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready

[  324.287271] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

[  331.816367] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)

[  331.816368] brcmfmac: brcmf_cfg80211_scan: scan error (-11)

[  332.170666] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)
```

So I have firmware loaded, but still cannot connect, cannot be something wrong with WPA-supplicant? I am using:

```
net-wireless/wpa_supplicant

      Latest version available: 2.6

      Latest version installed: 2.6

      Size of files: 2,689 KiB

      Homepage:      http://hostap.epitest.fi/wpa_supplicant/

      Description:   IEEE 802.1X/WPA supplicant for secure wireless transfers

      License:       || ( GPL-2 BSD )
```

```
ares ~ # equery uses net-wireless/wpa_supplicant

[ Legend : U - final flag setting for installation]

[        : I - package is installed with flag     ]

[ Colors : set, unset                             ]

 * Found these USE flags for net-wireless/wpa_supplicant-2.6:

 U I

 + + ap                 : Add support for access point mode

 + + dbus               : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc)

 + + eap-sim            : Add support for EAP-SIM authentication algorithm

 - - fasteap            : Add support for FAST-EAP authentication algorithm

 + + gnutls             : Add support for net-libs/gnutls (TLS 1.0 and SSL 3.0 support)

 + + hs2-0              : Add support for 802.11u and Passpoint for HotSpot 2.0

 + + p2p                : Add support for Wi-Fi Direct mode

 - - qt4                : Add support for the Qt GUI/Application Toolkit version 4.x

 + + qt5                : Add support for the Qt 5 application and UI framework

 + + readline           : Enable support for libreadline, a GNU line-editing library that almost everyone wants

 - - smartcard          : Add support for smartcards

 + + ssl                : Add support for Secure Socket Layer connections

 + + tdls               : Add support for Tunneled Direct Link Setup (802.11z)

 - - uncommon-eap-types : Add support for GPSK, SAKE, GPSK_SHA256, IKEV2 and EKE

 - - wps                : Add support for Wi-Fi Protected Setup
```

I am using dual boot without any grub or lilo, but by utilizing refind UEFI capabilities to directly boot kernel, and under Windows system the wifi works fine (just to confirm it is not really damaged somehow).

----------

## archenroot

Ok, i am adding here some useful link which I found:

https://ubuntuforums.org/showthread.php?t=2276504&page=4&s=a47f3a32bb300a42d4197f8fdc662744

Guy reported there he faced same error (on different hardware):

```
brcmf_cfg80211_scan: scan error (-11)
```

Another link suggest looking here:

https://bugzilla.kernel.org/show_bug.cgi?id=88061

I will need to read whole 4 pages, but one of last statements to this resolved issue there is:

Fixed the packet loss issue by disabling ipv6. Who needs it anyway?!

I will also try to enable debugging it not already in place...

Once this works I will put all details to my page related to Dell XPS 15 9550   :Smile:  https://wiki.gentoo.org/wiki/Dell_XPS_15_9550

----------

## NeddySeagoon

archenroot,

It still wants that txt file.

```
[   10.745659] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/brcmfmac43602-pcie.txt failed with error -2

[   10.745661] brcmfmac 0000:02:00.0: loading /lib/firmware/updates/brcm/brcmfmac43602-pcie.txt failed with error -2

[   10.745684] brcmfmac 0000:02:00.0: loading /lib/firmware/4.10.0-gentoo/brcm/brcmfmac43602-pcie.txt failed with error -2

[   10.745686] brcmfmac 0000:02:00.0: loading /lib/firmware/brcm/brcmfmac43602-pcie.txt failed with error -2

[   10.745687] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2
```

The Raspberry Pi 3 uses the the same brcmfmac wifi driver.  Its a different chipset.

It also has a .txt file that it won't work without.

Add it to you kernel.

-- edit --

It looks like your bluetooth has similar issues.

```
[   12.007201] bluetooth hci0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/BCM-0a5c-6410.hcd failed with error -2

[   12.007202] bluetooth hci0: loading /lib/firmware/updates/brcm/BCM-0a5c-6410.hcd failed with error -2

[   12.007204] bluetooth hci0: loading /lib/firmware/4.10.0-gentoo/brcm/BCM-0a5c-6410.hcd failed with error -2

[   12.007206] bluetooth hci0: loading /lib/firmware/brcm/BCM-0a5c-6410.hcd failed with error -2

[   12.007206] bluetooth hci0: Direct firmware load for brcm/BCM-0a5c-6410.hcd failed with error -2
```

May as well add that at the same time if you want your bluetooth to work.

----------

## fedeliallalinea

 *NeddySeagoon wrote:*   

> It looks like your bluetooth has similar issues.
> 
> ```
> [   12.007201] bluetooth hci0: loading /lib/firmware/updates/4.10.0-gentoo/brcm/BCM-0a5c-6410.hcd failed with error -2
> 
> ...

 

For this you need to download this and copy in /lib/firmware/brcm/ (not present in linux-firmware)

----------

## archenroot

Bluetooth

Regarding bluetooth I downloaded file and put it into the /lib/firmware/brcm, I will add it into kernel .config file.

Thanks for the file!

Should I file a bug/feature request to include the file in firmware package?

In general it looks like Bluetooth works, under Configuration (right-click in KDE-Plasma) I see Adapters, where is "BlueZ 5.43 {48:..etc. MAC} - hci0", and in Devices I see constantly changing visible MAC addresses, still I configured the kernel and going to reboot now.

Wifi

Well, the file brcmfmac43602-pcie.txt doesn't exists, actually there is not .txt file under that brcm folder. When searching on the internet I cannot find it, I tried following repos:

https://github.com/OpenELEC/wlan-firmware/tree/master/firmware/brcm where is only bin and AP bin files listed.

```
ares efivars # locate brcmfmac43602-pcie.txt

ares efivars # 

```

Some additional info probably not related to this, but Network Manager is continuously changing MAC address.

```
ar  2 16:45:14 ares dhcpcd[4572]: wlp2s0: new hardware address: 32:59:c2:eb:47:19

Mar  2 16:45:14 ares NetworkManager[4363]: <info>  [1488469514.5530] device (wlp2s0): set-hw-addr: set MAC address to 32:59:C2:EB:47:19 (scanning)

Mar  2 16:45:14 ares kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready

Mar  2 16:50:30 ares dhcpcd[4572]: wlp2s0: new hardware address: c6:dd:6e:d3:43:06

Mar  2 16:50:30 ares NetworkManager[4363]: <info>  [1488469830.5521] device (wlp2s0): set-hw-addr: set MAC address to C6:DD:6E:D3:43:06 (scanning)

Mar  2 16:50:30 ares kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready

Mar  2 16:50:30 ares NetworkManager[4363]: <info>  [1488469830.5688] device (wlp2s0): supplicant interface state: inactive -> disconnected

Mar  2 16:50:30 ares NetworkManager[4363]: <info>  [1488469830.5691] device (wlp2s0): supplicant interface state: disconnected -> inactive

Mar  2 16:55:46 ares dhcpcd[4572]: wlp2s0: new hardware address: 22:1f:c1:c6:5c:88

Mar  2 16:55:46 ares NetworkManager[4363]: <info>  [1488470146.5528] device (wlp2s0): set-hw-addr: set MAC address to 22:1F:C1:C6:5C:88 (scanning)

Mar  2 16:55:46 ares kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
```

I temporarily also disabled the IPv6 stack:

```
ares efivars # sysctl -p

net.ipv4.ip_forward = 0

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

net.ipv6.conf.lo.disable_ipv6 = 1
```

ISO related messages

I found here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1575321 information saying:

 *Quote:*   

> And for "not a ISO3166 code (0x30 0x30)" error. Turns out driver only recognizes 3 zones US,TW,FR 

 

You can test this by running $ iw reg set "SI" for example.

Finally I am also going to switch the driver into kernel module  :Smile: 

----------

## archenroot

Bluetooth

So by customizing the kernel .config as following:

```
ares ~ # grep -Hrn "FIRMWARE" /usr/src/linux/.config

/usr/src/linux/.config:1541:CONFIG_PREVENT_FIRMWARE_BUILD=y

/usr/src/linux/.config:1543:CONFIG_FIRMWARE_IN_KERNEL=y

/usr/src/linux/.config:1544:CONFIG_EXTRA_FIRMWARE="brcm/brcmfmac43602-pcie.bin brcm/BCM-0a5c-6410.hcd"

/usr/src/linux/.config:1545:CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

/usr/src/linux/.config:3222:# CONFIG_CYPRESS_FIRMWARE is not set

/usr/src/linux/.config:3372:# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

/usr/src/linux/.config:3428:CONFIG_FIRMWARE_EDID=y

/usr/src/linux/.config:5000:CONFIG_FIRMWARE_MEMMAP=y

/usr/src/linux/.config:5009:# CONFIG_GOOGLE_FIRMWARE is not set

/usr/src/linux/.config:5408:CONFIG_TEST_FIRMWARE=y
```

I am now receiving in dmesg:

```
ares ~ # dmesg |grep bluetooth

[    0.740260] device class 'bluetooth': registering

[    6.832477] bluetooth hci0: using built-in brcm/BCM-0a5c-6410.hcd
```

So this is resolved as well, thank you again guys.

Wifi

The wifi still remained, but I started to be suspicious about the network applications I use. In general I am using NetworkManager with wpa_supplicant and dhcpcd daemon. I also installed now from polly-c overlay latest net-misc/networkmanager-1.6.2_pre::poly-c. Still the same result (var/log/messages):

```
Mar  2 20:10:02 ares dhcpcd[5909]: wlp2s0: IAID 44:f5:13:05

Mar  2 20:10:02 ares dhcpcd[5909]: control command: /sbin/dhcpcd -B -K -L -A -G -c /usr/libexec/nm-dhcp-helper -4 wlp2s0

Mar  2 20:10:02 ares NetworkManager[9367]: <info>  [1488481802.0686] device (wlp2s0): state change: failed -> disconnected (reason 'none') [120 30 0]

Mar  2 20:10:02 ares dhcpcd[5909]: wlp2s0: carrier lost

Mar  2 20:10:02 ares kernel: brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

Mar  2 20:10:02 ares dhcpcd[5909]: wlp2s0: new hardware address: 0e:3b:dc:79:65:65

Mar  2 20:10:02 ares NetworkManager[9367]: <info>  [1488481802.5825] device (wlp2s0): set-hw-addr: set MAC address to 0E:3B:DC:79:65:65 (scanning)

Mar  2 20:10:02 ares kernel: IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready

Mar  2 20:10:02 ares NetworkManager[9367]: <warn>  [1488481802.5885] sup-iface[0x8dc630,wlp2s0]: connection disconnected (reason -3)

Mar  2 20:10:02 ares NetworkManager[9367]: <info>  [1488481802.5886] device (wlp2s0): supplicant interface state: completed -> disconnected
```

So I did some test by stopping the DHCPCD daemon (/etc/init.d/dhcpcd stop) and via NetworkManager I aksed for connection to the network again:

```
Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3756] device (wlp2s0): state change: config -> need-auth (reason 'none') [50 60 0]

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3786] device (wlp2s0): state change: need-auth -> prepare (reason 'none') [60 40 0]

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3789] device (wlp2s0): state change: prepare -> config (reason 'none') [40 50 0]

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3791] device (wlp2s0): Activation: (wifi) connection 'Coreso - Guest' has security, and secrets exist.  No new secrets needed.

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3791] Config: added 'ssid' value 'Coreso - Guest'

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3791] Config: added 'scan_ssid' value '1'

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3791] Config: added 'key_mgmt' value 'WPA-PSK'

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3791] Config: added 'psk' value '<hidden>'

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.3811] sup-iface[0x8dc630,wlp2s0]: config: set interface ap_scan to 1

Mar  2 20:10:46 ares NetworkManager[9367]: <info>  [1488481846.4296] device (wlp2s0): supplicant interface state: disconnected -> scanning

Mar  2 20:10:49 ares NetworkManager[9367]: <info>  [1488481849.6289] device (wlp2s0): supplicant interface state: scanning -> associating

Mar  2 20:10:52 ares kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready

Mar  2 20:10:52 ares NetworkManager[9367]: <info>  [1488481852.8508] device (wlp2s0): supplicant interface state: associating -> completed

Mar  2 20:10:52 ares NetworkManager[9367]: <info>  [1488481852.8508] device (wlp2s0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network 'Coreso - Guest'.

Mar  2 20:10:52 ares NetworkManager[9367]: <info>  [1488481852.8513] device (wlp2s0): state change: config -> ip-config (reason 'none') [50 70 0]

Mar  2 20:10:52 ares NetworkManager[9367]: <info>  [1488481852.8516] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)

Mar  2 20:10:52 ares NetworkManager[9367]: <info>  [1488481852.8525] dhcp4 (wlp2s0): dhcpcd started with pid 9680

Mar  2 20:10:52 ares dhcpcd[9680]: DUID 00:01:00:01:1f:b1:3f:69:48:e2:44:f5:13:05

Mar  2 20:10:52 ares dhcpcd[9680]: wlp2s0: IAID 44:f5:13:05

Mar  2 20:10:53 ares dhcpcd[9680]: wlp2s0: soliciting a DHCP lease

Mar  2 20:10:53 ares dhcpcd[9680]: wlp2s0: offered 172.17.42.79 from 172.17.42.254

Mar  2 20:10:53 ares dhcpcd[9680]: wlp2s0: leased 172.17.42.79 for 86400 seconds

Mar  2 20:10:53 ares kernel: brcmfmac: brcmf_inetaddr_changed: fail to get arp ip table err:-23

Mar  2 20:10:53 ares dhcpcd[9680]: wlp2s0: adding route to 172.17.42.0/24

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6015] dhcp4 (wlp2s0):   address 172.17.42.79

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6015] dhcp4 (wlp2s0):   plen 24 (255.255.255.0)

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6016] dhcp4 (wlp2s0):   gateway 172.17.42.254

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6016] dhcp4 (wlp2s0):   server identifier 172.17.42.254

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6016] dhcp4 (wlp2s0):   lease time 86400

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6016] dhcp4 (wlp2s0):   nameserver '8.8.8.8'

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6016] dhcp4 (wlp2s0):   nameserver '8.8.4.4'

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6016] dhcp4 (wlp2s0): state changed unknown -> bound

Mar  2 20:10:53 ares dhcpcd[9680]: wlp2s0: deleted route to 172.17.42.0/24

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6033] device (wlp2s0): state change: ip-config -> ip-check (reason 'none') [70 80 0]

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6040] device (wlp2s0): state change: ip-check -> secondaries (reason 'none') [80 90 0]

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6043] device (wlp2s0): state change: secondaries -> activated (reason 'none') [90 100 0]

Mar  2 20:10:53 ares NetworkManager[9367]: <info>  [1488481853.6292] device (wlp2s0): Activation: successful, device activated.

Mar  2 20:10:53 ares dbus[5425]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)

Mar  2 20:10:53 ares dbus[5425]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'

Mar  2 20:10:53 ares nm-dispatcher[9691]: req:1 'up' [wlp2s0]: new request (1 scripts)

Mar  2 20:10:53 ares nm-dispatcher[9691]: req:1 'up' [wlp2s0]: start running ordered scripts...
```

So NetworkManager also started the dhcpcd back, but now I was able to connect to the WIFI network  :Smile:   :Sad: , confused about this:

```
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 172.17.42.79  netmask 255.255.255.0  broadcast 172.17.42.255

        ether 48:e2:44:f5:13:05  txqueuelen 1000  (Ethernet)

        RX packets 11  bytes 1610 (1.5 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 29  bytes 4022 (3.9 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
```

I again reconnected and it worked for second time and third time as well. So good thing is I am loading the firmware, thanks again for explanation here. Some useful links bellow:

https://wiki.tizen.org/wiki/Usage_and_Mechanism_of_kernel_function_%22request_firmware()%22

http://cateee.net/lkddb/web-lkddb/EXTRA_FIRMWARE_DIR.html

https://forums.gentoo.org/viewtopic-t-916540-start-0.html

But I also have issue with NetworkManager and dhcpcd daemon. After stopping the DHCPCD daemon it started working. Here is rc-update:

```
ares ~ # rc-update

       NetworkManager |      default

       dhcpcd |      default
```

I will look into this later. Thanks guys a lot for your hints and instructions.

Ladislav

----------

## NeddySeagoon

archenroot,

You may have no more than one tool to manage your network connections.

They all depend on wpa_supplicant for wifi.

Heres what happens.

When no tools are started in the default runlevel, you need to start networking yourself.

This is always save and a good place to be, since if ifconfig -a shows your interfaces but no IP addresses, you know where you are.

When exactly one tool is started, it mostly works as long as you can see the interfaces listed in ifconfig -a 

With more than one tool, the driver gets in a mess because wpa_supplicant tries to execute commands for all the tools.

All the tools try to do the scan/authenticate/associate loop independently and the interface can only really follow one chain of commands.

----------

## archenroot

Hi NeddySeagoon,

wpa_supplicant is initiated in sysinit phase. 

Then I have NetworkManager as central network tool and DHCP client package:

```
net-misc/networkmanager-1.6.2_pre

net-misc/dhcpcd-6.11.3

```

Both these were registered via rc-update in default phase, and I wasn't able to connect to wifi. So I removed dhcpcd from auto start (rc-update del dhcpcd) and all works. 

By looking into the logs this morning, the NetworkManager itself starts the dhcpcd app for obtaining ip addresses for interfaces. I see process binded to wifi interface(wlp2s0 in my case):

```
root      6149  5672  0 10:07 ?        00:00:00 /sbin/dhcpcd -B -K -L -A -G -c /usr/libexec/nm-dhcp-helper -4 wlp2s0
```

Here it is in the log visible, so NetworkManager manages DHCP client(dhcpcd) itself and doesn't like it to be running independently, so here is how NetworkManager manages dhcpd:

```
Mar  3 10:07:51 ares NetworkManager[5672]: <info>  [1488532071.9490] dhcp-init: Using DHCP client 'dhcpcd'

Mar  3 10:07:51 ares NetworkManager[5672]: <info>  [1488532071.9494] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)

Mar  3 10:07:51 ares NetworkManager[5672]: <info>  [1488532071.9523] dhcp4 (wlp2s0): dhcpcd started with pid 6149

Mar  3 10:07:51 ares dhcpcd[6149]: DUID 00:01:00:01:1f:b1:3f:69:48:e2:44:f5:13:05

Mar  3 10:07:51 ares dhcpcd[6149]: wlp2s0: IAID 44:f5:13:05

Mar  3 10:07:52 ares dhcpcd[6149]: wlp2s0: rebinding lease of 172.17.42.79

Mar  3 10:07:52 ares dhcpcd[6149]: wlp2s0: leased 172.17.42.79 for 86400 seconds

Mar  3 10:07:52 ares dhcpcd[6149]: wlp2s0: adding route to 172.17.42.0/24

Mar  3 10:07:52 ares kernel: brcmfmac: brcmf_inetaddr_changed: fail to get arp ip table err:-23

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   address 172.17.42.79

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   plen 24 (255.255.255.0)

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   gateway 172.17.42.254

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   server identifier 172.17.42.254

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   lease time 86400

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   nameserver '8.8.8.8'

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0):   nameserver '8.8.4.4'

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4277] dhcp4 (wlp2s0): state changed unknown -> bound

Mar  3 10:07:52 ares NetworkManager[5672]: <info>  [1488532072.4286] device (wlp2s0): state change: ip-config -> ip-check (reason 'none') [70 80 0]

```

Still the error from previous post(after firmware was correctly loaded) is hard to understand/decrypt to fact that it is something with networkmanager and dhcpcd running at the same time independently, but rather looks like driver or firmware issues.

----------

## archenroot

Just some small update. The driver or firmware is anyway somehow buggy.

I realized that on some kind of WPA2 wifi networks I still get Kernel Panic, but I found that this only occurs when my wife is sitting next to me and is connected to same network with her phone  :Smile:  LOL

I did this test with here for about 5x times, when she is not connected, it is stable without issues, once she connected, my kernel gets panic in few minutes  :Smile: )))

Ok, so fun, but this is already related to channel switching, and overall low-level management which this driver doesn't do well probably.

----------

## archenroot

Well after some time of testing on multiple networks I realized, that these failures are not only happening when my wife uses here phone (even it looked as is originally)  :Very Happy:  . 

I can certainly say that on some WPA2 networks driver fails in few minutes (in most cases laptop gets completely unresponsive and capslock remain blinking -> kernel panic) and on some WPA2 I am fine for few days without any issue. On non-secured networks I didn't experience any failure so far. In case of failure I usually try multiple times reboot, then failover to boot Windows, which doesn't suffer.

I put here latest dmesg where are visible 2 failures of driver in kernel: https://pastebin.com/SVmFUDnW

In most cases(90%) the laptop gets completely frozen, in the rest computer remain responding, but driver unusable and cannot connect to wifi anymore.

I am on 4.10.3-gentoo in the moment.

I travel a lot and and I experience this behavior on about 15% of WPA2 secured networks, I usually try reboot multiple times, but the kernel panics in few minutes, on others it is stable whole day/days. 

I am in middle of decision really replacing this broadcom "shit" with other "chip".

Any hints appreciated.

----------

## archenroot

There is still issue with random kernel panic I reaised issue on kernel.org:

https://bugzilla.kernel.org/show_bug.cgi?id=195427

I also found some valuable external sources on this issue although not with same chip in all cases (I experienced similar simptomps as well):

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=138312

I will probably change the chip in my laptop, going to look for some quality replacement.

Ladislav

----------

