A20 + AR9271 wifi problem

320 views
Skip to first unread message

wherei...@gmail.com

unread,
Jul 17, 2014, 8:29:56 AM7/17/14
to linux...@googlegroups.com
Hello all,

Coming here to try to get some help with my wifi alpha card. It just can't scan / connect. It can dump me data in monitor mode though.


Here are some outputs :

root@a20-OLinuXino:~# uname -a
Linux a20-OLinuXino 3.4.67+ #6 SMP PREEMPT Fri Nov 1 17:32:40 EET 2013 armv7l GNU/Linux


root@a20-OLinuXino:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"


root@a20-OLinuXino:~# lsusb
Bus 002 Device 002: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


root@a20-OLinuXino:~# lsmod
Module Size Used by
ath9k_htc 53734 0
ath9k_common 3206 1 ath9k_htc
ath9k_hw 359727 2 ath9k_common,ath9k_htc
ath 17007 3 ath9k_common,ath9k_htc,ath9k_hw
mac80211 249857 1 ath9k_htc
cpufreq_powersave 1207 0
cpufreq_conservative 6042 0
cpufreq_stats 3699 0
cpufreq_userspace 3318 0
sunxi_cedar_mod 9704 0
8192cu 454131 0
ump 50981 0
hdmi 31627 0

lcd 4711 0


If I manually scan for APs, takes a while before telling me device is busy :

root@a20-OLinuXino:~# ifconfig wlan9 up
root@a20-OLinuXino:~# ifconfig
eth0 Link encap:Ethernet HWaddr 02:4c:0a:81:82:21
inet addr:192.168.9.20 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::4c:aff:fe81:8221/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1388 errors:0 dropped:0 overruns:0 frame:0
TX packets:1824 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:117466 (114.7 KiB) TX bytes:1034501 (1010.2 KiB)
Interrupt:87 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan9 Link encap:Ethernet HWaddr 00:c0:ca:75:d9:af
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@a20-OLinuXino:~# iwlist wlan9 scanning
wlan9 Failed to read scan data : Resource temporarily unavailable


When network-manager is launched, any network command hangs, can't even make new ssh connection to the board, and syslog says :

Jun 2 22:38:10 a20-OLinuXino kernel: [ 772.036840] ADDRCONF(NETDEV_UP): wlan9: link is not ready
Jun 2 22:38:15 a20-OLinuXino kernel: [ 777.654007] ehci_irq: port change detect
Jun 2 22:38:15 a20-OLinuXino kernel: [ 777.663522] hub 2-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Jun 2 22:38:15 a20-OLinuXino kernel: [ 777.674285] usb 2-1: USB disconnect, device number 2
Jun 2 22:38:17 a20-OLinuXino kernel: [ 779.543771] ath: phy0: Chip reset failed
Jun 2 22:38:17 a20-OLinuXino kernel: [ 779.553693] ath: phy0: Unable to reset channel (2412 Mhz) reset status -22
Jun 2 22:38:17 a20-OLinuXino kernel: [ 779.563917] ath: phy0: Unable to set channel
Jun 2 22:38:17 a20-OLinuXino kernel: [ 779.683414] ath: phy0: Chip reset failed
Jun 2 22:38:18 a20-OLinuXino kernel: [ 779.693858] ath: phy0: Unable to reset hardware; reset status -22 (freq 2432 MHz)
Jun 2 22:38:18 a20-OLinuXino kernel: [ 779.827946] ath: phy0: Failed to wakeup in 500us
Jun 2 22:38:18 a20-OLinuXino kernel: [ 779.846983] ath: phy0: Failed to wakeup in 500us
Jun 2 22:38:18 a20-OLinuXino kernel: [ 779.865898] ath: phy0: Failed to wakeup in 500us
Jun 2 22:38:18 a20-OLinuXino kernel: [ 780.147955] usb 2-1: ath9k_htc: USB layer deinitialized
Jun 2 22:38:18 a20-OLinuXino kernel: [ 780.438486] usb 2-1: new high-speed USB device number 3 using sw-ehci
Jun 2 22:38:18 a20-OLinuXino kernel: [ 780.624967] usb 2-1: ath9k_htc: Firmware htc_9271.fw requested
Jun 2 22:38:19 a20-OLinuXino kernel: [ 780.941956] usb 2-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.177285] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.395787] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.3
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.404327] ath: EEPROM regdomain: 0x833a
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.413543] ath: EEPROM indicates we should expect a country code
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.429253] ath: doing EEPROM country->regdmn map search
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.438365] ath: country maps to regdmn code: 0x37
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.446578] ath: Country alpha2 being used: GB
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.453454] ath: Regpair used: 0x37
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.469434] ieee80211 phy1: Atheros AR9271 Rev:1
Jun 2 22:38:19 a20-OLinuXino kernel: [ 781.480791] Registered led device: ath9k_htc-phy1


The card works fine on another ubuntu x64 computer.
I installed firmware-atheros version from wheezy-backports repo to end up discovering the firmware was actually the same. Maybe I need a kernel update?

I also tried compiling the very latest firmware (1.4) without any differences. Plugging into a self-powered usb hub neither.

Any suggestion greatly appreciated.

Steven

Tim Tisdall

unread,
Jul 19, 2014, 9:32:47 AM7/19/14
to linux...@googlegroups.com
I had issues with this hardware too... You may need to include cfg80211. (this is from memory). One of those modules lists that module as a requirement, but when adding that module as a kernel option it doesn't automatically add that "requirement". I had to add it manually.

Tim Tisdall

unread,
Jul 23, 2014, 11:14:58 AM7/23/14
to linux...@googlegroups.com
I just checked it again today...

menuconfig says: Depends on: NETDEVICES [=y] && WLAN [=y] && ATH_COMMON [=m] && USB [=y] && MAC80211

modinfo says: depends:        ath9k_hw,ath9k_common,mac80211,ath,cfg80211

You need to make sure CONFIG_CFG80211 is added in your kernel config.

wherei...@gmail.com

unread,
Jul 31, 2014, 6:47:06 AM7/31/14
to linux...@googlegroups.com
Hello Tim,

Thanks for your advice and sorry for delay. For now I'm trying to find out how do I know if kernel was compiled with this config.

All I can see is :

root@a20-OLinuXino:~# find / -iname "*cfg80211*"
/sys/module/cfg80211
/sys/module/cfg80211/parameters/cfg80211_disable_40mhz_24ghz

root@a20-OLinuXino:~# find / -iname "*ath9k*"
/sys/bus/usb/drivers/ath9k_htc
/sys/devices/platform/sw-ehci.1/usb2/2-1/2-1:1.0/leds/ath9k_htc-phy1
/sys/class/leds/ath9k_htc-phy1
/sys/module/ath/holders/ath9k_common
/sys/module/ath/holders/ath9k_htc
/sys/module/ath/holders/ath9k_hw
/sys/module/ath9k_common
/sys/module/ath9k_common/holders/ath9k_htc
/sys/module/mac80211/holders/ath9k_htc
/sys/module/ath9k_htc
/sys/module/ath9k_htc/drivers/usb:ath9k_htc
/sys/module/ath9k_hw
/sys/module/ath9k_hw/holders/ath9k_common
/sys/module/ath9k_hw/holders/ath9k_htc
/lib/modules/3.4.67+/kernel/drivers/net/wireless/ath/ath9k
/lib/modules/3.4.67+/kernel/drivers/net/wireless/ath/ath9k/ath9k_common.ko
/lib/modules/3.4.67+/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko
/lib/modules/3.4.67+/kernel/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
/lib/modules/3.4.67+/kernel/drivers/net/wireless/ath/ath9k/ath9k_hw.ko


So I guess cfg80211 is supposed to be present in my /lib/modules directory.

Julian Calaby

unread,
Jul 31, 2014, 8:28:25 AM7/31/14
to linux...@googlegroups.com
Hi Steven,
You wouldn't have the /sys/module cfg80211 entries if it wasn't
present - ath9k_htc simply won't work without it. I'm guessing it's
built in.

I suspect it's something else.

Do other devices work on that USB port? What happens if you plug it in
after it's booted?

Also, you should be using the iw command ("iw dev wlan9 scan") not
iwlist. Make sure you have the "iw" package installed.

Finally, scanning doesn't always work first time (i.e. the device is
busy doing something else) and it doesn't work before you configure it
up ("ifconfig wlan9 up") so try it a couple of times before calling it
completely broken.

Thanks,

--
Julian Calaby

Email: julian...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

Steven

unread,
Jul 31, 2014, 11:22:07 AM7/31/14
to linux...@googlegroups.com
Julian,
I use as well a RT5370 based wifi card and external USB HDD without any
issue.
I played around plugging and unplugging the device, but ifconfig ends up
freezing. I attached dmesg output with probably interesting information,
timeouts everywhere.

After a reboot, if I plug the device, it gets correctly detected, and I
can bring it up, then I tried :

root@a20-OLinuXino:~# iw dev wlan9 scan
command failed: Network is down (-100)
root@a20-OLinuXino:~# ifconfig wlan9 up
root@a20-OLinuXino:~# iw dev wlan9 scan
scan aborted!
root@a20-OLinuXino:~# ifconfig wlan9 up
root@a20-OLinuXino:~# iw dev wlan9 scan
^C
root@a20-OLinuXino:~# iw dev wlan9 scan
command failed: Device or resource busy (-16)
root@a20-OLinuXino:~# iw dev wlan9 scan
command failed: Device or resource busy (-16)
root@a20-OLinuXino:~# iw dev wlan9 scan
command failed: Device or resource busy (-16)


When "scan aborted!" appears, dmesg shows at the same time :

Jul 31 14:58:54 a20-OLinuXino kernel: [ 152.493643] ehci_irq: port
change detect
Jul 31 14:58:54 a20-OLinuXino kernel: [ 152.503192] hub 2-0:1.0: port 1
disabled by hub (EMI?), re-enabling...
Jul 31 14:58:54 a20-OLinuXino kernel: [ 152.513886] usb 2-1: USB
disconnect, device number 2
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.386911] ath: phy0: Chip
reset failed
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.396668] ath: phy0: Unable
to reset channel (2412 Mhz) reset status -22
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.412196] ath: phy0: Unable
to set channel
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.532207] ath: phy0: Chip
reset failed
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.542586] ath: phy0: Unable
to reset hardware; reset status -22 (freq 2422 MHz)
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.671860] ath: phy0: Failed
to wakeup in 500us
Jul 31 14:58:56 a20-OLinuXino kernel: [ 154.697274] ath: phy0: Failed
to wakeup in 500us
Jul 31 14:58:57 a20-OLinuXino kernel: [ 154.721561] ath: phy0: Failed
to wakeup in 500us
Jul 31 14:58:57 a20-OLinuXino kernel: [ 154.993220] usb 2-1: ath9k_htc:
USB layer deinitialized
Jul 31 14:58:57 a20-OLinuXino kernel: [ 155.278312] usb 2-1: new
high-speed USB device number 3 using sw-ehci
Jul 31 14:58:57 a20-OLinuXino kernel: [ 155.460699] usb 2-1: ath9k_htc:
Firmware htc_9271.fw requested
Jul 31 14:58:58 a20-OLinuXino kernel: [ 155.782216] usb 2-1: ath9k_htc:
Transferred FW: htc_9271.fw, size: 51008
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.032307] ath9k_htc 2-1:1.0:
ath9k_htc: HTC initialized with 33 credits
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.262060] ath9k_htc 2-1:1.0:
ath9k_htc: FW Version: 1.4
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.270467] ath: EEPROM
regdomain: 0x833a
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.279670] ath: EEPROM
indicates we should expect a country code
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.290086] ath: doing EEPROM
country->regdmn map search
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.299279] ath: country maps
to regdmn code: 0x37
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.307499] ath: Country alpha2
being used: GB
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.314466] ath: Regpair used: 0x37
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.337430] ieee80211 phy1:
Atheros AR9271 Rev:1
Jul 31 14:58:58 a20-OLinuXino kernel: [ 156.352292] Registered led
device: ath9k_htc-phy1
Jul 31 14:59:11 a20-OLinuXino kernel: [ 169.356075]
ADDRCONF(NETDEV_UP): wlan9: link is not ready


At this point all network commands are locked. Unplugging et replugging
won't change anything. Even rebooting seems to hang, unfortunately I
don't have a screen to follow what's going on.

Thanks for the advice about iwlist, indeed "iw dev" gave me a good scan,
once. Actually I didn't manage to make it work again.

Regards,
Steven
dmesg_crash

Julian Calaby

unread,
Jul 31, 2014, 8:13:55 PM7/31/14
to linux...@googlegroups.com, linux-wireless
Hi Steven,

I'm CCing Linux-wireless as they might be able to help and I'm running
out of ideas =)
This really looks like a hardware issue. Maybe your ath9k_htc device
is particularly sensitive to power supply noise or something like
that. Have you tried a different power supply or connecting it through
a powered hub?

I really wish I could help out more with this =)

I'd be surprised if it's a software issue, but if you're compiling
your own kernels, it might be worth checking out the Linux Backports
project:

https://backports.wiki.kernel.org/index.php/Main_Page

Which is essentially the latest kernel's WiFi drivers and stuff
repackaged so it can be compiled with older kernels.
dmesg_crash

Oleksij Rempel

unread,
Aug 1, 2014, 2:47:54 AM8/1/14
to Julian Calaby, linux...@googlegroups.com, linux-wireless
That can be an issue. After firmware is loaded power consumption goes
from 30mA to 100-200mA. If it won't get enough power, then it will get
strange issues. Second problem is noise on data or power lines. It
depend on circuit design, cable and so on. Some users reported similar
issues which was fixed after cable change.

> I really wish I could help out more with this =)
>
> I'd be surprised if it's a software issue, but if you're compiling
> your own kernels, it might be worth checking out the Linux Backports
> project:
>
> https://backports.wiki.kernel.org/index.php/Main_Page
>
> Which is essentially the latest kernel's WiFi drivers and stuff
> repackaged so it can be compiled with older kernels.

Yea... i will not continue this discussion untill you get updated driver.

--
Regards,
Oleksij

signature.asc

wherei...@gmail.com

unread,
Aug 1, 2014, 3:36:46 AM8/1/14
to linux...@googlegroups.com, julian...@gmail.com, linux-w...@vger.kernel.org, li...@rempel-privat.de
Hello all,
I already am on the latest firmware. But, we can stop all this. Self-powered hub did the trick! The funny thing is that I already tried with the hub and as far as I remember didn't change much.
Anyway, thank you very much for your time and your sharp eye Julian. Indeed this was hardware related.

Thank you all,
Steven
Reply all
Reply to author
Forward
0 new messages