# What is the additional phy0 or PHY in general?

## Yamakuzure

I have the following problem:

My dmesg fills with the following line:

```
ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
```

It means that wifi tries to scan but can't.

The reason for this line is this:

```
 $ sudo rfkill list

0: dell-wifi: Wireless LAN

        Soft blocked: no

        Hard blocked: yes

1: dell-bluetooth: Bluetooth

        Soft blocked: no

        Hard blocked: yes

5: phy0: Wireless LAN

        Soft blocked: no

        Hard blocked: no
```

I have no idea what "phy0" is. I am on cabled LAN and have switched off my wifi.

If I search for phy0 I find this:

```
 $ sudo find /sys/ -type d -name 'phy0'

/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/ieee80211/phy0

/sys/kernel/debug/ieee80211/phy0
```

And here is the riddle that I can not solve:

PCI 0000:00:1c.2 is one of the PCI Express root ports. And connected to it is the (offending?) PCI 0000:03:00.0:

```
 $ sudo lspci -k -s 0000:03:00.0

03:00.0 Network controller: Broadcom Corporation BCM4352 802.11ac Wireless Network Adapter (rev 03)

        Subsystem: Dell Device 0017

        Kernel driver in use: wl

        Kernel modules: wl
```

So this actually is my wifi card, which I turned off using the rfkill switch. So what is the phy0 (or PHY in general?) and why does it not respond to the switch?

I am using net-wireless/broadcom-sta-6.30.223.248-r3, and start up the whole thing using these kernel parameters:

```
 ~ $ grep -P "^module_" /etc/conf.d/modules 

module_rfkill="master_switch_mode=2 default_state=1"

module_dell_laptop="force_rfkill=1"

module_cfg80211="cfg80211_disable_40mhz_24ghz=0"

module_wl="intf_name='wlan1'" # nompc=0 piomode=0"
```

This worked for ages, but since a few kernel iterations, this wretched phy0 no longer responds to rfkill.

So to have my dmesg not get flooded, I have to manually block that entry.

Has anyone an idea what this actually is? Google didn't get me anywhere on that one.

edit: My current kernel configuration, kernel 3.19.8:

```
  # grep -P "PHY[_=]" /usr/src/linux/.config

CONFIG_NETWORK_PHY_TIMESTAMPING=y

CONFIG_BROADCOM_PHY=m

CONFIG_BCM7XXX_PHY=m

CONFIG_BCM87XX_PHY=m

CONFIG_FIXED_PHY=y

CONFIG_GENERIC_PHY=y
```

If I deactivate PHY, my wifi card no longer works, of course. And the BCM/BROADCOM modules never get loaded and if I load them manually, nothing changes.

----------

## charles17

 *Yamakuzure wrote:*   

> The reason for this line is this:
> 
> ```
>  $ sudo rfkill list
> 
> ...

 

Here, "phy0" is the only thing availble to rfkill *Quote:*   

>  $ /usr/sbin/rfkill list
> 
> 0: phy0: Wireless LAN
> 
>         Soft blocked: no
> ...

 Are you having the LAN cable plugged?  On some laptops this could also kill the rf.

----------

## Yamakuzure

Yes, I have. But that is not the reason, the hard block does not autoenable itself when the cable is plugged. I turned wifi off with the switch, but phy0 does not react to it.

----------

## charles17

 *Yamakuzure wrote:*   

> Yes, I have. But that is not the reason, the hard block does not autoenable itself when the cable is plugged. I turned wifi off with the switch, but phy0 does not react to it.

 Something specific to Dell laptops? https://forums.opensuse.org/showthread.php/479169-dell-wifi-Wireless-LAN-Soft-and-Hard-Blocked-but-phy0-Wireless-Lan-is-not-Blocked

----------

## Yamakuzure

 *charles17 wrote:*   

>  *Yamakuzure wrote:*   Yes, I have. But that is not the reason, the hard block does not autoenable itself when the cable is plugged. I turned wifi off with the switch, but phy0 does not react to it. Something specific to Dell laptops? https://forums.opensuse.org/showthread.php/479169-dell-wifi-Wireless-LAN-Soft-and-Hard-Blocked-but-phy0-Wireless-Lan-is-not-Blocked

 No, they have a different wifi. And the end of the thread is to blacklist dell_wmi kernel module, which only makes all WMI events to disappear. phy0 is still there.

----------

## Yamakuzure

Something new:

After 6 days uptime with several suspend/resume cycles, and hardware rfkill switching on/off, the numbers of the devices changed:

```
 ~ $ sudo rfkill list

Passwort: 

7: dell-wifi: Wireless LAN

        Soft blocked: no

        Hard blocked: yes

8: dell-bluetooth: Bluetooth

        Soft blocked: no

        Hard blocked: yes

41: phy0: Wireless LAN

        Soft blocked: no

        Hard blocked: no
```

I've seen this the first time, dell-wifi and dell-bluetooth were always devices 0 and 1, but now?

Has anybody experienced this phenomenon on their machines, too?

...I am completely at sea here...

----------

## charles17

You could try 

```
# find / -iname phy0
```

And check dmesg about the number changes.

----------

## Yamakuzure

 *charles17 wrote:*   

> You could try 
> 
> ```
> # find / -iname phy0
> ```
> ...

 I'd like to. But whenever that change happened, dmesg fills with one line per second like this:

```
ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
```

And that means the information is lost after some time...  :Sad: 

----------

## Yamakuzure

Okay, I got one step closer.

The renumbering was caused by a file in /etc/pm/sleep.d/ that removed the wl module on suspend and reinserted it on resume.

When I installed this laptop in spring 2014 this was necessary, but is no longer.

So this question remains:

When I switch wireless on, a new item "hci0: bluetooth" appears, and it disappears when I switch wireless off. As far as I understand this, it should be like that.

So why does "phy0: Wireless LAN" appear no matter what the rfkill switch status is? I reckon it should appear/dissapear like hci0 does, right?

----------

