# Wi-Fi not working after suspend/resume



## WhiteBlackGoose (Oct 29, 2022)

Wireless card: BCM43225
FreeBSD version: 13.1-RELEASE
Kernel built with BWN_GPL_PHY option

Hello, so basically after I suspend/resume, it can't connect to wifi. Here's what I tried:
1. Networkmgr's GUI. It has button "Enable wifi", which doesn't do anything (and prints "service netif status not supported" in stdout)
2. wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf. It hangs there but doesn't do anything
3. Restarted netif (when restarting netif, it would first start wpa_supplicant, which is fine, and then dhclient which returns "wlan0: no link.... giving up")

I also tried unloading if_bwn kernel module, but it crashed the whole system.

I attach dmesg right before suspension, right after it, and their diff (for convenience).

Any idea? Thanks.


----------



## chrbr (Oct 29, 2022)

`service netif restart` should work. But the maybe routing has to be restarted as well. Please try `ifconfig wlan0 down` followed by `ifconfig wlan0 up`. This has been working on an old laptop in the recent past. Unfortunately it is broken now.


----------



## Alain De Vos (Oct 29, 2022)

Don't paste files as attachments. It's annoying. Put them in a CODE block.


----------



## WhiteBlackGoose (Oct 30, 2022)

Alain De Vos, the first two are very long. Here's the diff, though.

```
uhub0: at usbus2, port 1, addr 1 (disconnected)
ugen2.2: <vendor 0x8087 product 0x0024> at usbus2 (disconnected)
uhub4: at uhub0, port 1, addr 2 (disconnected)
uhub4: detached
uhub0: detached
uhub2: at usbus1, port 1, addr 1 (disconnected)
uhub2: detached
uhub1: at usbus0, port 1, addr 1 (disconnected)
ugen0.2: <vendor 0x8087 product 0x0024> at usbus0 (disconnected)
uhub3: at uhub1, port 1, addr 2 (disconnected)
ugen0.3: <123 WebCam SC-13HDL11431N> at usbus0 (disconnected)
uhub3: detached
uhub1: detached
vgapci1: child drmn1 requested pci_set_powerstate
acpi0: cleared fixed power button status
vgapci1: child drmn1 requested pci_set_powerstate
vgapci1: child drmn1 requested pci_enable_io
vgapci1: child drmn1 requested pci_enable_io
bwn0: ucode fw: ucode16_mimo
bwn0: firmware version (rev 666 patch 2 date 0xb217 time 0x9e7)
uhub0 on usbus1
uhub0: <(0x1b21) XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
wlan0: link state changed to DOWN
uhub1 on usbus2
uhub1: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
uhub2 on usbus0
uhub2: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 4 ports with 4 removable, self powered
uhub2: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
ugen0.2: <vendor 0x8087 product 0x0024> at usbus0
uhub3 on uhub2
uhub3: <vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr 2> on usbus0
ugen2.2: <vendor 0x8087 product 0x0024> at usbus2
uhub4 on uhub1
uhub4: <vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr 2> on usbus2
uhub4: 6 ports with 6 removable, self powered
uhub3: 6 ports with 6 removable, self powered
usb_alloc_device: set address 3 failed (USB_ERR_STALLED, ignored)
ugen0.3: <123 WebCam SC-13HDL11431N> at usbus0
usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_STALLED, ignored
```


----------



## WhiteBlackGoose (Oct 30, 2022)

chrbr, doesn't help.

```
ifconfig wlan0 down
ifconfig wlan0 up
service netif restart
```
Then it says that it recreated wlan0, started wpa_supplicant, then dhclient, and "wlan0: no link ...... giving up"


----------



## chrbr (Oct 30, 2022)

I am running out of ideas. But you could try to assign a static IP address. If this works the issue is most likely in the DHCP configuration.


----------



## cmoerz (Oct 30, 2022)

Have you tried `devctl reset bwn0`? This works for my Intel based wireless chip, whenever I have issues once in a while.


----------



## WhiteBlackGoose (Oct 30, 2022)

cmoerz:

```
devctl: Failed to reset bwn0: Device not configured
```


----------

