Bug 207537

Summary: wireless does not associate properly - AR9565
Product: Base System Reporter: Neil Tremble <ntremble>
Component: wirelessAssignee: freebsd-wireless mailing list <wireless>
Status: New ---    
Severity: Affects Some People CC: adrian
Priority: ---    
Version: 10.3-BETA2   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
dmesg with AR9565 active and non-functional
none
ifconfig with AR9565 active and non-functional
none
rc.conf with AR9565 active and non-functional
none
uname -a output
none
GENERIC kernel configuration for 10.3_BETA3 as installed, no modifications
none
dmesg output with new kernel built with attached configuration none

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
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        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:~ % 

loader.conf:
 kern.vty=vt
 if_ath_load="YES"
 fuse_load="YES"
 vboxdrv_load="YES"

rc.conf:
 hostname="frog"
 ifconfig_re0="DHCP"
 wlans_ath0="wlan0"
 ifconfig_wlan0="WPA SYNCDHCP"
 sshd_enable="YES"
 powerd_enable="YES"
 dumpdev="AUTO"
 fusefs_enable="YES"
 devfs_system_ruleset="localrules"
 dbus_enable="YES"
 hald_enable="YES"
 #kdm4_enable="YES"
 lpd_enable="YES"
 vboxnet_enable="YES"
 devfs_system_ruleset="system"

wpa_supplicant.conf:
 network={
 	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 10.0.0.80 netmask 255.255.255.0

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
hi,

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
Adrian,

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 ;-)

Neil