# WiFi freezes without error every 3 minutes. No recovery until Wifi Service restart



## FrostKiwi (Jun 9, 2021)

At random ~3-10 minute intervals, my Wifi card is freezing, though Signal strength and connection speed are excellent. These disconnects are not related to bad reception, but happen periodically regardless of what is happening with the machine.
I'm on FreeBSD 13 with an Atheros AR5BXB112 AR9380 mPCIe card and its 3 antenna connected. The driver is ath. It's pciconf info is:


Spoiler: pciconf output for the wifi card





```
ath0@pci0:2:0:0:    class=0x028000 rev=0x01 hdr=0x00 vendor=0x168c device=0x0030 subvendor=0x106b subdevice=0x009a
    vendor     = 'Qualcomm Atheros'
    device     = 'AR93xx Wireless Network Adapter'
    class      = network
```



It is being invoked with this rc.conf:


Spoiler: How the Wifi Card is started





```
wlans_ath0="wlan0"
ifconfig_wlan0="NOAUTO WPA DHCP powersave"
create_args_wlan0="country DE regdomain ETSI"
```
The NOAUTO is there to remove the boot delay due to wifi, accordance to this.
Whether NOAUTO or powersave is used or not,  the result is the same.


and for good measure, ifconfig with the SSIDs censored:


Spoiler: ifconfig output





```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 10:9a:dd:a0:a7:ae
    inet 192.168.1.15 netmask 0xffffff00 broadcast 192.168.1.255
    groups: wlan
    ssid XXXXXXXXXXXXXX channel 9 (2452 MHz 11g ht/20) bssid XX:XX:XX:XX:XX:XX
    regdomain ETSI country DE indoor ecm authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit powersavemode CAM powersavesleep 100
    txpower 30 bmiss 7 scanvalid 60 protmode CTS ampdulimit 32k
    ampdudensity 16 shortgi -uapsd wme burst roaming MANUAL
    parent interface: ath0
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```



At random intervals this happens:

Suddenly all communication stops. No error in /var/log/messages, no disconnects, just silence.
PINGs do not error out, no HOST DOWN, no error, they just remain in limbo.
Even after minutes of waiting, everything remains dead, downloads stuck, with the ETA climbing up and up, no errors
I am forced to "sudo service netif restart wlan0"
the wifi card restarts and connection is re-established
rinse and repeat
Hitting the card with heavy traffic, periodically generates the following response:

```
Jun  9 20:12:05 stripes kernel: ath0: ath_intr: TSFOOR
Jun  9 20:12:05 stripes syslogd: last message repeated 1 times
Jun  9 20:12:35 stripes syslogd: last message repeated 2 times
Jun  9 20:22:35 stripes syslogd: last message repeated 4 times
```
Often times simple crashes of the card happen, with this cycle repeating:


Spoiler: The /var/log/message cycle, with SSID censored





```
Jun  9 19:42:30 stripes kernel: wlan0: link state changed to DOWN
Jun  9 19:42:30 stripes wpa_supplicant[2043]: wlan0: CTRL-EVENT-DISCONNECTED bssid=XX:XX:XX:XX:XX:XX reason=0
Jun  9 19:42:37 stripes wpa_supplicant[2043]: wlan0: Trying to associate with XX:XX:XX:XX:XX:XX (SSID='XXXXXXXXXXXXXXXX' freq=2452 MHz)
Jun  9 19:42:37 stripes wpa_supplicant[2043]: Failed to add supported operating classes IE
Jun  9 19:42:37 stripes wpa_supplicant[2043]: wlan0: Associated with XX:XX:XX:XX:XX:XX
Jun  9 19:42:37 stripes kernel: wlan0: link state changed to UP
Jun  9 19:42:37 stripes dhclient[2090]: send_packet: No buffer space available
Jun  9 19:42:38 stripes wpa_supplicant[2043]: wlan0: WPA: Key negotiation completed with XX:XX:XX:XX:XX:XX [PTK=CCMP GTK=CCMP]
Jun  9 19:42:38 stripes wpa_supplicant[2043]: wlan0: CTRL-EVENT-CONNECTED - Connection to XX:XX:XX:XX:XX:XX completed [id=0 id_str=]
Jun  9 19:42:45 stripes dhclient[2734]: New IP Address (wlan0): 192.168.1.15
Jun  9 19:42:45 stripes dhclient[2738]: New Subnet Mask (wlan0): 255.255.255.0
Jun  9 19:42:45 stripes dhclient[2742]: New Broadcast Address (wlan0): 192.168.1.255
Jun  9 19:42:45 stripes dhclient[2746]: New Routers (wlan0): 192.168.1.1
Jun  9 19:42:46 stripes wpa_supplicant[2043]: wlan0: CTRL-EVENT-DISCONNECTED bssid=XX:XX:XX:XX:XX:XX reason=0
Jun  9 19:42:46 stripes kernel: wlan0: link state changed to DOWN
Jun  9 19:42:53 stripes wpa_supplicant[2043]: wlan0: Trying to associate with XX:XX:XX:XX:XX:XX (SSID='XXXXXXXXXXXXXXXX' freq=2452 MHz)
Jun  9 19:42:53 stripes wpa_supplicant[2043]: Failed to add supported operating classes IE
Jun  9 19:42:53 stripes wpa_supplicant[2043]: wlan0: Associated with XX:XX:XX:XX:XX:XX
Jun  9 19:42:53 stripes kernel: wlan0: link state changed to UP
Jun  9 19:42:53 stripes dhclient[2090]: send_packet: No buffer space available
Jun  9 19:42:54 stripes wpa_supplicant[2043]: wlan0: WPA: Key negotiation completed with XX:XX:XX:XX:XX:XX [PTK=CCMP GTK=CCMP]
Jun  9 19:42:54 stripes wpa_supplicant[2043]: wlan0: CTRL-EVENT-CONNECTED - Connection to XX:XX:XX:XX:XX:XX completed [id=0 id_str=]
Jun  9 19:43:00 stripes dhclient[2770]: New IP Address (wlan0): 192.168.1.15
Jun  9 19:43:00 stripes dhclient[2774]: New Subnet Mask (wlan0): 255.255.255.0
Jun  9 19:43:00 stripes dhclient[2778]: New Broadcast Address (wlan0): 192.168.1.255
Jun  9 19:43:01 stripes dhclient[2782]: New Routers (wlan0): 192.168.1.1
```



And sometimes a full on freeze without error or automatic restart happens, prompting a force Wifi service restart, with this output:
manual Wifi service restart @20:26:00


Spoiler: The /var/log/message cycle, with SSID censored





```
Jun  9 20:12:05 stripes kernel: ath0: ath_intr: TSFOOR
Jun  9 20:12:05 stripes syslogd: last message repeated 1 times
Jun  9 20:12:35 stripes syslogd: last message repeated 2 times
Jun  9 20:22:35 stripes syslogd: last message repeated 4 times
Jun  9 20:26:05 stripes syslogd: last message repeated 1 times
Jun  9 20:26:47 stripes wpa_supplicant[3134]: wlan0: WPA: Group rekeying completed with XX:XX:XX:XX:XX:XX [GTK=CCMP]
Jun  9 20:26:49 stripes syslogd: last message repeated 2 times
Jun  9 20:26:49 stripes kernel: ath0: ath_intr: TSFOOR
Jun  9 20:26:50 stripes wpa_supplicant[3134]: wlan0: WPA: Group rekeying completed with XX:XX:XX:XX:XX:XX [GTK=CCMP]
Jun  9 20:29:14 stripes dhclient[3181]: My address (192.168.1.15) was deleted, dhclient exiting
Jun  9 20:29:14 stripes wpa_supplicant[3134]: wlan0: CTRL-EVENT-DISCONNECTED bssid=XX:XX:XX:XX:XX:XX reason=3 locally_generated=1
Jun  9 20:29:14 stripes kernel: wlan0: link state changed to DOWN
Jun  9 20:29:14 stripes wpa_supplicant[3134]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Can't assign requested address
Jun  9 20:29:14 stripes wpa_supplicant[3134]: wlan0: CTRL-EVENT-TERMINATING
Jun  9 20:29:14 stripes dhclient[3181]: connection closed
Jun  9 20:29:14 stripes dhclient[3181]: exiting.
Jun  9 20:29:15 stripes kernel: wlan0: Ethernet address: 10:9a:dd:a0:a7:ae
Jun  9 20:29:15 stripes wpa_supplicant[3448]: Successfully initialized wpa_supplicant
Jun  9 20:29:15 stripes wpa_supplicant[3448]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
Jun  9 20:29:15 stripes syslogd: last message repeated 1 times
Jun  9 20:29:21 stripes wpa_supplicant[3449]: wlan0: Trying to associate with XX:XX:XX:XX:XX:XX (SSID='XXXXXXXXXXXXXXXX' freq=2452 MHz)
Jun  9 20:29:21 stripes wpa_supplicant[3449]: Failed to add supported operating classes IE
Jun  9 20:29:21 stripes wpa_supplicant[3449]: wlan0: Associated with XX:XX:XX:XX:XX:XX
Jun  9 20:29:21 stripes kernel: wlan0: link state changed to UP
Jun  9 20:29:21 stripes dhclient[3496]: send_packet: No buffer space available
Jun  9 20:29:23 stripes wpa_supplicant[3449]: wlan0: WPA: Key negotiation completed with XX:XX:XX:XX:XX:XX [PTK=CCMP GTK=CCMP]
Jun  9 20:29:23 stripes wpa_supplicant[3449]: wlan0: CTRL-EVENT-CONNECTED - Connection to XX:XX:XX:XX:XX:XX completed [id=0 id_str=]
Jun  9 20:29:25 stripes dhclient[3506]: New IP Address (wlan0): 192.168.1.15
Jun  9 20:29:25 stripes dhclient[3510]: New Subnet Mask (wlan0): 255.255.255.0
Jun  9 20:29:25 stripes dhclient[3514]: New Broadcast Address (wlan0): 192.168.1.255
Jun  9 20:29:25 stripes dhclient[3518]: New Routers (wlan0): 192.168.1.1
```



Especially the combo "kernel: ath0: ath_intr: TSFOOR -> wpa_supplicant[3134]: wlan0: WPA: Group rekeying completed -> Freeze" is suspect

With Linux, there are no problems and the connection is stable. So it's not hardware related.
Anyone seen similar symptoms?


----------



## FrostKiwi (Jun 10, 2021)

For testing I exchanged my AR5BXB112 for an Intel Wifi Link 5300.
There are no problems with that card and its driver iwn(4).
Curiously, iwn(4) properly lights up the Laptop's Wifi LED and honors the hardware RF switch, whilst ath(4) ignored the RF hardware switch (it runs even with RF off) and is not able to light up the WiFi LED.
Unfortunately iwn(4) is not FreeSoftware and requires both the signing of a license and inclusion of non-free firmware in the kernel. So I would like to get ath(4) properly up and running.
Anyone with a similar card maybe?


----------

