Bug 207537 - wireless does not associate properly - AR9565
Summary: wireless does not associate properly - AR9565
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 10.3-BETA2
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-wireless (Nobody)
Depends on:
Reported: 2016-02-27 04:36 UTC by Neil Tremble
Modified: 2016-08-08 08:11 UTC (History)
1 user (show)

See Also:

dmesg with AR9565 active and non-functional (49.82 KB, text/plain)
2016-02-27 04:36 UTC, Neil Tremble
no flags Details
ifconfig with AR9565 active and non-functional (1.29 KB, text/plain)
2016-02-27 04:37 UTC, Neil Tremble
no flags Details
rc.conf with AR9565 active and non-functional (544 bytes, text/plain)
2016-02-27 04:39 UTC, Neil Tremble
no flags Details
uname -a output (153 bytes, text/plain)
2016-02-27 04:40 UTC, Neil Tremble
no flags Details
GENERIC kernel configuration for 10.3_BETA3 as installed, no modifications (14.42 KB, text/plain)
2016-02-29 08:11 UTC, Neil Tremble
no flags Details
dmesg output with new kernel built with attached configuration (13.17 KB, text/plain)
2016-02-29 09:28 UTC, Neil Tremble
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Tremble 2016-02-27 04:36:17 UTC
Created attachment 167466 [details]
dmesg with AR9565 active and non-functional

Generic kernel, 10.3-BETA3 (same issue with 10.3-BETA2 and 10.2-RELEASE).
HP 15-d070TU laptop.

As of this morning I am running 10.3-BETA3, upgraded from 10.2-BETA2 using freebsd-update -r 10.3-BETA3 upgrade, but all comments below apply to 10.3-BETA3, 10.3-BETA2 and 10.2-RELEASE at least.

uname -a:
FreeBSD frog 10.3-BETA3 FreeBSD 10.3-BETA3 #0 r296074: Fri Feb 26 01:13:37 UTC 2016     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

When I enable the AR9565 Wi-Fi in my laptop the system makes all the right noises but cannot start dhclient. The ath0 interface shows as associated but wlan0 shows no carrier. The extract below shows this. Full logs and configuration files are attached.

The visible symptoms are that the system regularly emits messages such as:
"ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping" and the wireless interface is unable to route packets.

The wired ethernet goes to the same router and functions perfectly. This issue with the wireless was *not* present in 11.0-CURRENT when I last tried it a couple of months back, and the wireless in this same laptop worked perfectly with the same router and an unchanged configuration.

The closest match I can find is this one, which has similar symptoms but the requester did not respond to the last question: #188415. My response to that question is that I am running the generic kernel fresh from the freebsd-update process.

neilt@frog:~ % ifconfig
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether b8:ee:65:39:de:46
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng
        status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether b8:ee:65:39:de:46
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 11 (2462 MHz 11g ht/20)
        regdomain 106 indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF txpower 20 bmiss 7 scanvalid 60 protmode CTS
        ampdulimit 8k ampdudensity 8 shortgi wme burst roaming MANUAL
neilt@frog:~ % 


 ifconfig_wlan0="WPA SYNCDHCP"

 	ssid="my ssid"
 	psk="my psk"
Comment 1 Neil Tremble 2016-02-27 04:37:51 UTC
Created attachment 167467 [details]
ifconfig with AR9565 active and non-functional
Comment 2 Neil Tremble 2016-02-27 04:39:41 UTC
Created attachment 167468 [details]
rc.conf with AR9565 active and non-functional
Comment 3 Neil Tremble 2016-02-27 04:40:17 UTC
Created attachment 167469 [details]
uname -a output
Comment 4 Neil Tremble 2016-02-27 21:22:00 UTC
I subsequently commented out the wireless related lines in loader.conf and rc.conf, rebooting, then executing the commands manually:

 # kldload if_ath
 # ifconfig wlan0 create wlandev ath0
 # wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
 # dhclient wlan0

The kldload is not required as it says the module is already loaded or in the kernel. The ifconfig and wpa_supplicant commands appear to work properly. The dhclient command does not obtain an address. If I manually assign an address:

 # ifconfig wlan0 inet netmask

routing still fails. At one stage I noticed the association had gone, so I might need to do more there to get it to work at all.

I'll keep trying to get it going with a static IP because I would like to be able to say for sure whether the issue is in the interface setup or just a dhclient thing.

A static IP will do in the short term; if I can get that working at least my wireless will be usable. As it is my laptop is tied the the wired ethernet.
Comment 5 Adrian Chadd freebsd_committer 2016-02-28 08:35:39 UTC
You need to add ATH_ENABLE_11N to the kernel and recompile. sorry :(
Comment 6 Neil Tremble 2016-02-28 09:43:15 UTC
OK, thank you. I'll give that a go.
Comment 7 Neil Tremble 2016-02-29 08:11:06 UTC
Created attachment 167551 [details]
GENERIC kernel configuration for 10.3_BETA3 as installed, no modifications
Comment 8 Neil Tremble 2016-02-29 08:17:50 UTC
Adrian, the amd64 GENERIC kernel does have ATH_ENABLE_11N. Refer to the attached configuration file, fourth last line in file.

I imagine this explains why kldload complains if I try to load the if_ath module from the command line.
Comment 9 Neil Tremble 2016-02-29 09:27:10 UTC
Ok, so I rebuilt the kernel using the attached configuration file and the result is identical. It looks good at boot time up until dclient executes, but an IP is not obtained and the interface cannot route packets.

I will attach the dmesg from this new kernel.
Comment 10 Neil Tremble 2016-02-29 09:28:08 UTC
Created attachment 167554 [details]
dmesg output with new kernel built with attached configuration
Comment 11 Adrian Chadd freebsd_committer 2016-02-29 19:06:17 UTC

can you try -head at least? I just fired up the QCA9565 in a laptop over the weekend to debug bluetooth things and it worked fine for me. But yeah, I'm running -HEAD.
Comment 12 Neil Tremble 2016-03-01 02:57:23 UTC
Adrian, yes as previously mentioned it works fine on 11.0-CURRENT as of a couple of months back. I was running an 11-CURRENT snapshot and all was well, but I was having trouble building some of the ports so I dropped back to the 10 series. That resolved the port issues but replaced them with the Wi-Fi problem.

It's a pity but it seems that 10.3 will go to release with this issue still present. Oh, well, might have to go back to 11 to get working Wi-Fi.
Comment 13 Neil Tremble 2016-03-06 23:39:52 UTC

To prove the point as you requested I installed the 11.0-CURRENT snapshot I had been using previously and the Wi-Fi worked just fine as expected.

I then pulled the latest -HEAD source from the repo and did
 make buildworld
 make buildkernel
 make installkernel
 make delete-old
 make delete-old-libs

and after a power cycle the Wi-fi is still working. So when 11.0 hits release I'll be rather surprised if my Wi-Fi does not work.

My main concern was that 10.3 is about to go release and this issue is still present as of BETA3.

I'll leave the machine tracking HEAD now as I need the Wi-Fi to work on that unit.

For what it is worth I installed 10.1-RELEASE 32 bit on an old Thinkpad with AR9212 Wi-Fi and found that to work out of the box. It seems to be an issue with the AR/QCA9565 specifically, or at least post 9212.

Anyway, thanks for all the work you are doing. It is appreciated, even if sometimes it doesn't seem like it ;-)