Bug 49201

Summary: 168c:0032 Wifi connection unstable -- Atheros AR9485 ath9k
Product: Drivers Reporter: gfmichaud
Component: network-wirelessAssignee: drivers_network-wireless (drivers_network-wireless)
Status: CLOSED CODE_FIX    
Severity: normal CC: anthony.wong, emailadhoc, eugene.shatokhin, gfmichaud, harroxelas, hatsch, ilyabe, jelmer, jesuinovieira_, jkp, linville, mstomich, shafi.wireless, sick_soul, sujith, tomwys
Priority: P1    
Hardware: All   
OS: Linux   
URL: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/971809
Kernel Version: 3.7 and previous Subsystem:
Regression: No Bisected commit-id:
Attachments: /var/log/syslog when I move closer to the wifi access point
/var/log/syslog when I move away from the wifi access point
DMESG_1.txt
DMESG_2.txt
DMESG_3.txt
DMESG_4.txt
DMESG_CUSTOM_1.txt
DMESG_CUSTOM_2.txt
DMESG_CUSTOM_3.txt
Syslog at the same time as DMESG_CUSTOM_3.txt
DMESG_ALL_1.txt
DMESG_ALL_2.txt
DMESG_ALL_3.txt
Syslog at the same time as DMESG_ALL_3.txt
PATCHING_PROBLEM.txt
kernel messages from two AP connections
base_eeprom_1.txt
base_eeprom_new.txt
make_errors.txt
disable comb patch
Syslog - 2013-06-10 7h19
Syslog - 2013-06-10 7h39

Description gfmichaud 2012-10-21 16:29:11 UTC
Wifi connection with an Atheros AR9485 card is very unstable (bad quality, and very bad range).
At the beginning connection quality stays where it reasonably should be, but after few seconds it drops to poor values :

:~$ sudo iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"Pluff"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 94:0C:6D:C5:8B:B4   
          Bit Rate=54 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=46/70  Signal level=-64 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:4   Missed beacon:0
......
:~$ sudo iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"Pluff"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 94:0C:6D:C5:8B:B4   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Bit Rate=54 Mb/s   Tx-Power=15 dBm   
          Link Quality=28/70  Signal level=-82 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:4   Missed beacon:0


--- --- --- --- --- --- --- --- --- 


This was tested on (cat /proc/version) :
- Linux version 3.5.0-17-generic (buildd@allspice) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012
which is the standard Ubuntu 12.10 kernel and
- Linux version 3.7.0-999-generic (apw@gomeisa) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201210210405 SMP Sun Oct 21 08:05:46 UTC 2012
which is the latest upstream kernel

The exact name of the network card is (lspci) :
02:00.0 Network controller: Atheros Communications Inc. AR9485 Wireless Network Adapter (rev 01)


--- --- --- --- --- --- --- --- --- 


This bug is related to Ubuntu Launchpad bug n°971809.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/971809
Comment 1 emailadhoc 2012-12-05 02:16:49 UTC
I have an Atheros Communications Inc. AR9485 (revision 1) and I'm experiencing the same problems under kernel 3.6.7 (fedora 18). 

The speed is very low when I walk some meters away from the access point, any network around me appears to have a very low signal level. Sometimes, even if the bit rate is set at 1mbps, the connection just drops and I can't re-associate since the network appears to be out-of-range. I usually have to restart the adapter. I initially thought that someone was jamming me, since I use a 14dbi directional antenna (and my ap is set at 23-26 dBm)
Comment 2 gfmichaud 2012-12-14 17:48:08 UTC
The problem is still here in 3.7 final.
Comment 3 Sujith 2012-12-28 11:02:28 UTC
A few patches updating AR9485 support have been posted. Once compat-drivers is updated to the latest linux-next snapshot, they can be used.

Regarding the signal issue, I can reproduce it. It drops as soon as ANI kicks in, right after this message:

ath: phy5: Starting IQ Cal and Correction for Chain 0
ath: phy5: Original: Chn 0 iq_corr_meas = 0x002ba228
ath: phy5: Chn 0 pwr_meas_i = 0x07e86ffe
ath: phy5: Chn 0 pwr_meas_q = 0x079f1692
ath: phy5: iqCorrNeg is 0x00000000
ath: phy5: Chn 0 iCoff = 0x00000005
ath: phy5: Chn 0 qCoff = 0x00000002
ath: phy5: Chn 0 : iCoff = 0x7b  qCoff = 0x2
ath: phy5: Register offset (0x98dc) before update = 0x20000000
ath: phy5: Register offset (0x98dc) QI COFF (bitfields 0x00003f80) after update = 0x20003d82
ath: phy5: Register offset (0x98dc) QQ COFF (bitfields 0x0000007f) after update = 0x20003d82
ath: phy5: IQ Cal and Correction done for Chain 0
ath: phy5: IQ Cal and Correction (offset 0x98dc) enabled (bit position 0x00004000). New Value 0x20007d82

I'll take a look at this issue.
Comment 4 gfmichaud 2013-01-04 15:58:44 UTC
@Sujith

I don't know what ANI is, but I saw there
https://wiki.archlinux.org/index.php/ASUS_Zenbook_UX31E
that
- fixing the wireless connection's BSSID
- disabling the ath9k driver ani feature with "echo 1 > /sys/kernel/debug/ieee80211/phy0/ath9k/disable_ani" 
could help, but it did not really solved the problem for me.

Maybe it helps ?
Comment 5 Tomasz Wysocki 2013-04-20 16:12:31 UTC
Related:
https://bugzilla.kernel.org/show_bug.cgi?id=55901
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1160188

I have same issue on Asus S500CA.

02:00.0 Network controller: Atheros Communications Inc. AR9485 Wireless Network Adapter (rev 01)

Linux tomwys-laptop 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Comment 6 gfmichaud 2013-05-23 05:59:58 UTC
Still here in 3.10.0-031000rc2-generic.
Comment 7 gfmichaud 2013-05-31 10:00:11 UTC
(In reply to comment #6)
> Still here in 3.10.0-031000rc2-generic.

If I move away (~5m) from the hotspot, the connection works perfectly fine for a while ; then it suddenly & inexplicably drops down, and never comes back.

If I move again closer to the hotspot, /var/log shows what is written in CLOSER.txt.

If I move again farther, after a random amount of time I am disconnected and /var/log shows what is written in FARTHER.txt.

I insist on saying that until this sudden disconnection, the connection works perfectly fine (good bandwith & no lag).
This is a Linux-related problem since in the same location everything works perfectly fine with Windows 7.
Comment 8 gfmichaud 2013-05-31 10:01:10 UTC
Created attachment 103071 [details]
/var/log/syslog when I move closer to the wifi access point
Comment 9 gfmichaud 2013-05-31 10:01:36 UTC
Created attachment 103081 [details]
/var/log/syslog when I move away from the wifi access point
Comment 10 Sujith 2013-06-03 01:56:32 UTC
Can you disable PowerSave and see if things improve ?
("iw dev wlan0 set power_save off).
Comment 11 gfmichaud 2013-06-03 05:43:55 UTC
Since last week I've tested a few things that do seem to improve connection quality and range :
- switching to WPA2 (TKIP) instead of WPA
- switching to a channel with a greater number (from 4 to 11)
- disabling ANI
- disabling power management

I've added in /etc/pm/power.d/wireless :
echo 1 > /sys/kernel/debug/ieee80211/phy0/ath9k/disable_ani
/sbin/iwconfig wlan0 power off

So yes it helps.
However it is not perfect : 50% of the time network is not detected at boot, or the connection drops down after a moment. But 50% of the time it works just fine (particularly on mornings, I don't know why...? Guess it has something to do with the neighbours ?).
Comment 12 hatsch 2013-06-03 09:50:24 UTC
i am on ubuntu and as mentioned in this post:
http://ubuntuforums.org/showthread.php?t=1865577&page=191&p=12634850#post12634850

the wifi with ath9k is stable using kernel 3.6.11,
only later kernels have the problem.

i am using it now for some hours, and i had no disconnect yet.
Comment 13 gfmichaud 2013-06-03 09:58:32 UTC
That's curious because I had the problem with both 3.5.0 (current Ubuntu kernel when I filed the bug) and 3.7.0 (latest upstream kernel when I filed the bug).

But it used to work better between december 2012 and april 2013 (when I upgraded to Ubuntu 13.04 and kernel 3.8).
So maybe a few 3.6.* versions are free from this problem.
Comment 14 Sujith 2013-06-03 10:08:12 UTC
> the wifi with ath9k is stable using kernel 3.6.11,
> only later kernels have the problem.
> 
> i am using it now for some hours, and i had no disconnect yet.

Which kernel are you using right now ? Also, please report if the connection is stable with powersave disabled.
Comment 15 hatsch 2013-06-03 10:20:09 UTC
i am on kernel 3.6.11 (amd64) from the ubuntu mainline ppa
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6.11-raring/

i am on battery for the last hour and powermanagement is on.

no disconnects yet! sitting in a cafe the access point is ~5 meters away and i have 5 other laptop users around me. with kernel 3.8.x on the same place with no other users around i had reglular disconnects after a couple of minutes.
Comment 16 hatsch 2013-06-03 10:22:18 UTC
also i have not set nohwcrypt=1 and didn't limit the connection to b/g
as i have tried as a workaround with other kernel versions (with limited success).
Comment 17 gfmichaud 2013-06-03 12:21:49 UTC
I have set nowhcrypt=1 as well, last week.
It has improved significantly my connection.
Comment 18 Sujith 2013-06-04 01:53:21 UTC
Ok, we are losing track of things a bit. :)

Can you guys please test the latest backports release, with powersave disabled ? Or maybe the wireless-testing tree maintained by John Linville, which contains the latest version of the driver. (Please leave all the other options like ANI, HWCRYPTO to their default values).
Comment 19 gfmichaud 2013-06-04 05:51:29 UTC
2 weeks ago I tested the latest upstream kernel built for Ubuntu :
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10-rc2-saucy/
I had everything set to default (fresh Ubuntu install) and can confirm the bug was there.

I've been testing the latestet build today :
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10-rc4-saucy/

I have disabled all the workarounds I had previously set
- re-enabling ANI
- re-enabling power management
- re-enabling hwcrypt
- BSSID not set manually in Network Manager

I can confirm that the bug exists (tested this morning)
- in the standard Ubuntu kernel (3.8.0-23-generic)
- in the latest upstream kernel (3.10.0-031000rc4-generic #201306020443 SMP Sun Jun 2 08:43:56 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux)

With 3.10, when disabling power management (without touching to hwcrypt, BSSID or ANI) enables me to get the connectiion working at boot, but I get disconnected afterwards.

Disabling both power management and ANI helps me get the connection working at boot and keep it alive afterwards.

I've not disabled hwcrypt again as it seems to work, or added back a fixed BSSID in Network Manager, but I can do further testing if need be.

AP information
- from iwconfig
wlan0     IEEE 802.11bgn  ESSID:"XXXX"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: XX:XX:XX:XX:XX:XX   
          Bit Rate=19.5 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=33/70  Signal level=-77 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:21  Invalid misc:98   Missed beacon:0

- from iwlist
wlan0     Scan completed :
          Cell 01 - Address: XX:XX:XX:XX:XX:XX
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=56/70  Signal level=-54 dBm  
                    Encryption key:on
                    ESSID:"XXXX"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=00000045352652cc
                    Extra: Last beacon: 160ms ago
                    IE: Unknown: 0004434E474D
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 03010B
                    IE: Unknown: 2A0104
                    IE: Unknown: 32043048606C
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 2D1A6C0003FFFFFF0001000000000000000100000000000000000000
                    IE: Unknown: 3D160B000700000000000000000000000000000000000000
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
Comment 20 gfmichaud 2013-06-04 06:00:47 UTC
One last bit about 3.10 : disabling ANI without disabling power management doesn't help.
Comment 21 Sujith 2013-06-04 06:44:05 UTC
> I can confirm that the bug exists (tested this morning)
> - in the standard Ubuntu kernel (3.8.0-23-generic)
> - in the latest upstream kernel (3.10.0-031000rc4-generic #201306020443 SMP 
> 
> With 3.10, when disabling power management (without touching to hwcrypt,
> BSSID
> or ANI) enables me to get the connectiion working at boot, but I get
> disconnected afterwards.
> 
> Disabling both power management and ANI helps me get the connection working
> at
> boot and keep it alive afterwards.

Thanks.

Using the latest upstream kernel, can you please load the driver with debug=0x8f49 and post the kernel log when the disconnect happens ?

(With PowerSave disabled but ANI enabled).
Comment 22 Sujith 2013-06-04 06:44:46 UTC
Also, iwconfig and friends have been deprecated for years, so please use "iw" instead.
Comment 23 gfmichaud 2013-06-04 07:07:28 UTC
By "kernel log" do you mean /var/log/syslog or some other file ?

To load the driver with debug=0x8f49, is the right method to put
options ath9k debug=0x8f49
in /etc/modprobe.d/ath9k.conf ?
Comment 24 Sujith 2013-06-04 07:14:27 UTC
(In reply to comment #23)
> By "kernel log" do you mean /var/log/syslog or some other file ?

"dmesg" or /var/log/kernel.log - but this depends on the distribution.

> To load the driver with debug=0x8f49, is the right method to put
> options ath9k debug=0x8f49
> in /etc/modprobe.d/ath9k.conf ?

That seems correct.
Comment 26 gfmichaud 2013-06-04 11:42:57 UTC
I will test with 3.10 and debug=0x8f49 in a few hours when I'm back home.

I'll be glad to test your patches too when they are available for testing.
Comment 27 gfmichaud 2013-06-04 14:39:35 UTC
So here are the logs :
- kernel 3.10
- debug=0x8f49
- ANI on & power_save off

Booting away (place A) from the access point, no network
> DMESG_1.txt
Getting closer (place B) from the access point, connection is established
> DMESG_2.txt
Getting away (back to place A) from the access point, network drops down
> DMESG_3.txt
Getting closer (place B) from the access point, connection is re-established
> DMESG_4.txt
Comment 28 gfmichaud 2013-06-04 14:40:08 UTC
Created attachment 103351 [details]
DMESG_1.txt
Comment 29 gfmichaud 2013-06-04 14:40:27 UTC
Created attachment 103361 [details]
DMESG_2.txt
Comment 30 gfmichaud 2013-06-04 14:40:44 UTC
Created attachment 103371 [details]
DMESG_3.txt
Comment 31 gfmichaud 2013-06-04 14:41:05 UTC
Created attachment 103381 [details]
DMESG_4.txt
Comment 32 Sujith 2013-06-04 15:27:35 UTC
The debug information aren't present in the logs. Check if these options are present in the kernel config:

CONFIG_ATH_DEBUG=y
CONFIG_ATH9K_DEBUGFS=y

Also, in your distribution, /var/log/syslog appears to contain both kernel and NM messages. That would be useful to have.

ath9k messages would look like this: http://pastebin.com/gzcdX8mV
Comment 33 gfmichaud 2013-06-04 16:15:51 UTC
I don't know, for kernel configuration. I didn't build it myself. :-(

Here is the syslog for the period covered by the DMESG :  syslog.txt
Comment 34 gfmichaud 2013-06-04 18:15:32 UTC
So I've built my own custom kernel with the source from kernel.org and enabled debugging... :-)

gfmichaud@dragonfly:~$ uname -a
Linux dragonfly 3.10.0-rc4 #1 SMP Tue Jun 4 19:25:23 CEST 2013 x86_64 x86_64 x86_64 GNU/Linux

Booting close (place B) to the access point : network up
> DMESG_CUSTOM_1.txt
Getting away (place A) from the access point : network down
> DMESG_CUSTOM_2.txt
Getting close (back to place B) to the access point : network up again
> DMESG_CUSTOM_3.txt
Comment 35 gfmichaud 2013-06-04 18:16:10 UTC
Created attachment 103391 [details]
DMESG_CUSTOM_1.txt
Comment 36 gfmichaud 2013-06-04 18:16:33 UTC
Created attachment 103401 [details]
DMESG_CUSTOM_2.txt
Comment 37 gfmichaud 2013-06-04 18:16:58 UTC
Created attachment 103411 [details]
DMESG_CUSTOM_3.txt
Comment 38 gfmichaud 2013-06-04 18:24:37 UTC
Created attachment 103421 [details]
Syslog at the same time as DMESG_CUSTOM_3.txt
Comment 39 Sujith 2013-06-05 02:19:48 UTC
Thanks for the logs. There was one suspicious line from the syslog:

Jun  4 20:11:33 dragonfly wpa_supplicant[1023]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:24:d4:69:f4:14 reason=4

Reason 4 is "WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY" - the AP kicked out the associated station.

But, right before the disconnect, we see this:

Jun  4 20:11:25 dragonfly kernel: [  224.978454] ath: phy0: tx hung, resetting the chip

Another weird line:

Jun  4 20:07:46 dragonfly kernel: [    4.423684] ath: phy0: UNDEFINED -> AWAKE
Jun  4 20:07:46 dragonfly kernel: [    4.423754] ath: phy0: serialize_regmode is 0
Jun  4 20:07:46 dragonfly kernel: [    4.425939] ath: phy0: timeout (1000 us) on reg 0x15f18: 0x00000000 & 0x00000007 != 0x00000004

Since you mentioned that things work with ANI disabled, I'll prepare some test patches for ANI against mainline.
Comment 40 Sujith 2013-06-05 03:25:53 UTC
Can you try these patches ? http://msujith.org/patches/test/Jun-05-2013/
They apply on top of Linus' tree.

(leave ANI enabled, but PS disabled).
Comment 41 gfmichaud 2013-06-05 05:16:50 UTC
It works *better* but not *perfectly*, with all the workarounds I said :
- ANI disabled
- power management disabled
- hwcrypt disabled
- BSSID set manually in Network Manager
I still get random disconnection, but *less*. I will try to provide logs.

For the patches, I'll try the (just have to learn how to patch the kernel first !).
Comment 42 gfmichaud 2013-06-05 05:34:50 UTC
So I have enabled
- full debugging in /etc/modprobe.d/ath9k.conf whith options ath9k debug=0xffff
- and kept all my workarounds (ANI, PM, hwcrypt disabled, BSSID set manually)

1) Booted and got network up
> DMESG_ALL_1.txt

2) Took the computer away from the AP and left for some time ; when I came back network was down
> DMESG_ALL_2.txt

3) Took the computer back closer to the AP and got network up again
> DMESG_ALL_3.txt

(As far as I am concerned, it used to work better with 3.8 and those workarounds than this custom 3.10 with the same workarounds.)

I hope the logfiles help understand what's happening.
Comment 43 gfmichaud 2013-06-05 05:35:25 UTC
Created attachment 103491 [details]
DMESG_ALL_1.txt
Comment 44 gfmichaud 2013-06-05 05:35:40 UTC
Created attachment 103501 [details]
DMESG_ALL_2.txt
Comment 45 gfmichaud 2013-06-05 05:36:19 UTC
Created attachment 103511 [details]
DMESG_ALL_3.txt
Comment 46 gfmichaud 2013-06-05 05:42:23 UTC
Created attachment 103521 [details]
Syslog at the same time as DMESG_ALL_3.txt
Comment 47 gfmichaud 2013-06-05 06:05:28 UTC
I tried to apply your 6 patches on the kernel but there were problems with 2 of them. Details in PATCHING_PROBLEM.txt
Comment 48 gfmichaud 2013-06-05 06:05:54 UTC
Created attachment 103541 [details]
PATCHING_PROBLEM.txt
Comment 49 Sujith 2013-06-05 07:18:40 UTC
Hm, please apply only the patches here: http://msujith.org/patches/test/Jun-05-2013/. The ones in patchwork are for wireless-testing and not for Linus' tree.

Also, do not enable any workarounds - that makes it impossible to diagnose the issue. The only thing that needs to be done is to disable powersave. The syslog appears to contain everything, so dmesg contents are not needed.
Comment 50 gfmichaud 2013-06-05 08:16:09 UTC
OK I'll try in a few hours and post the results here : kernel patched, no workaround (but power management disabled), syslog with full debug.
Comment 51 Sujith 2013-06-05 10:21:34 UTC
Can you post the output of lsusb ? I'd like to see if Bluetooth is Atheros-based.
Comment 52 gfmichaud 2013-06-05 10:32:27 UTC
I usually have bluetooth disabled in the BIOS.
I will re-enabled it for the test.
Kernel is compiling right now, patches are OK, so I'll post all the results within the hour.
Comment 53 gfmichaud 2013-06-05 11:15:28 UTC
Si here are the results :
- I booted as usual, close to the AP (syslog1.txt)
- Then I took the computer away, and after a while network disconnected (syslog2.txt)
- When I took back the computer close to the AP, Network Manager tried to re-establish the connection twice and failed twice (syslog3.txt)
- Then it failed a third time (syslog4.txt)
- But when I rebooted, without moving, the connection got up juste fine (syslog5.txt)

Logs (and lsusb) can be found here (too big to fit in here) :
http://ubuntuone.com/34brDrhFa0eCabk94wCVva

However, it seems better with the patch than without.
To do the test, I close the door of my office, which does not prevent the connection to work on Windows but does on Linux. Without my previous "workarounds", I experienced disconnections even with the door open with standard unpatched kernels. I don't, with this custom patched kernel.
Comment 54 Sujith 2013-06-05 11:29:03 UTC
Thanks.

AR9485 is a 1x1 chip, which requires that proper RX diversity support is required in the driver. Incorrect/incomplete antenna diversity logic in the driver will adversely affect RX sensitivity. I'll take a look.
Comment 55 gfmichaud 2013-06-05 11:56:51 UTC
OK.
Tell me if there is further testing to be done.
I'll use the patched kernel for a few days and provide in-depth feedback too.
Comment 56 Sujith 2013-06-06 04:52:19 UTC
As a quick test, can you check if using minstrel makes a difference ? Just disable the CONFIG_ATH9K_RATE_CONTROL option in the kernel config and syslog would show:

ieee80211 phy28: Selected rate control algorithm 'minstrel_ht'

The switch has been made recently:
http://marc.info/?l=linux-wireless&m=137048839031184&w=2
Comment 57 gfmichaud 2013-06-06 05:46:19 UTC
I set CONFIG_ATH9K_RATE_CONTROL=n in .config before building but there's no "minstrel" mentioned in syslog when I boot afterwards.
Comment 58 gfmichaud 2013-06-06 06:07:03 UTC
I did the same tests as usual (near/far/near) and had the same results.
Logs can be found here : http://ubuntuone.com/1NS4KrlDHNtoXrGSvqXwis
But I don't know why "minstrel" doesn't show up in the logs.

gfmichaud@dragonfly:~/Documents/linux-3.10-rc4$ grep 'ATH' .config
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_BT_ATH3K=m
CONFIG_UEVENT_HELPER_PATH=""
# CONFIG_MD_MULTIPATH is not set
# CONFIG_DM_MULTIPATH is not set
CONFIG_NET_VENDOR_ATHEROS=y
CONFIG_ATH_COMMON=m
CONFIG_ATH_CARDS=m
CONFIG_ATH_DEBUG=y
# CONFIG_ATH5K is not set
CONFIG_ATH5K_PCI=y
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=m
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_MAC_DEBUG is not set
CONFIG_ATH9K_RATE_CONTROL=n
# CONFIG_ATH9K_HTC is not set
# CONFIG_ATH6KL is not set
CONFIG_SECURITY_PATH=y
Comment 59 Sujith 2013-06-06 06:11:56 UTC
Try using this: ./scripts/config --file .config -d ATH9K_RATE_CONTROL
Comment 60 jkp 2013-06-06 13:50:34 UTC
Don't know if this is of any help, but my experience with kernel 3.10-rc4 & the patches from power management off and patches from http://msujith.org/patches/test/Jun-05-2013/ is that the signal strength & data rate go down very much after ca. 30 seconds. Both with and without disable_ani. Distance between computer and AP ca. 30 cm.

When I connect to the wlan AP from nm-applet, data rate 72,2Mbps

          Link Quality=58/70  Signal level=-52 dBm  
          Link Quality=60/70  Signal level=-50 dBm  

Then after ca. 30 seconds, data rate drops to 1Mbps:

          Link Quality=49/70  Signal level=-61 dBm  
          Link Quality=47/70  Signal level=-63 dBm  
          Link Quality=48/70  Signal level=-62 dBm  
          Link Quality=54/70  Signal level=-56 dBm  
          Link Quality=46/70  Signal level=-64 dBm  
          Link Quality=40/70  Signal level=-70 dBm  

The values fluctuate somewhat, but the drop of ca. 10 dBm after ca. 30 seconds appears to be quite systematic.

Not sure what to look for in the logs or which parts to post.

Hardware: asus transformer book tx300 (4005)

lspci -v:

01:00.0 Network controller: Atheros Communications Inc. AR9485 Wireless Network Adapter (rev 01)
	Subsystem: AzureWave Device 2126
	Flags: bus master, fast devsel, latency 0, IRQ 16
	Memory at f7c00000 (64-bit, non-prefetchable) [size=512K]
	Expansion ROM at f7c80000 [disabled] [size=64K]
	Capabilities: [40] Power Management version 2
	Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Virtual Channel
	Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
	Kernel driver in use: ath9k

Wlan AP: Sierra 4G/wlan router
Comment 61 jkp 2013-06-06 14:06:33 UTC
Sorry for garbled text, meant to say that patches from http://msujith.org/patches/test/Jun-05-2013/ , then power management off, and with and without disable_ani, no other workarounds.
Comment 62 jkp 2013-06-06 14:46:24 UTC
Created attachment 103651 [details]
kernel messages from two AP connections

Log with patches http://msujith.org/patches/test/Jun-05-2013/ , first connect with ca. -60 dBm signal, then -50dBm switching to -60dBm in ca. 30 secs.
Comment 63 jkp 2013-06-06 17:13:04 UTC
Two more observations: 

1) With this distance & AP, the connection drops to 1 Mbps soon only when power management is off. When power management is on, the connections stays at 72,2 Mbps.

2) At start after connect, the iwconfig "Invalid misc" field grows to ca. 30, stops growing after a while.

Both reardless of ANI being on or off.
Comment 64 gfmichaud 2013-06-06 20:35:14 UTC
@Sujith :

I tried ./scripts/config --file .config -d ATH9K_RATE_CONTROL :

Now :
root@dragonfly:~/Documents/linux-3.10-rc4# grep 'ATH' .config
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_BT_ATH3K=m
CONFIG_UEVENT_HELPER_PATH=""
# CONFIG_MD_MULTIPATH is not set
# CONFIG_DM_MULTIPATH is not set
CONFIG_NET_VENDOR_ATHEROS=y
CONFIG_ATH_COMMON=m
CONFIG_ATH_CARDS=m
CONFIG_ATH_DEBUG=y
# CONFIG_ATH5K is not set
CONFIG_ATH5K_PCI=y
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=m
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_MAC_DEBUG is not set
# CONFIG_ATH9K_RATE_CONTROL is not set
# CONFIG_ATH9K_HTC is not set
# CONFIG_ATH6KL is not set
CONFIG_SECURITY_PATH=y

But I dont find any mention of minstrel in my syslog :
root@dragonfly:~/Documents/linux-3.10-rc4# grep -i 'minstrel' /var/log/syslog
root@dragonfly:~/Documents/linux-3.10-rc4# dmesg | grep -i 'minstrel'
Comment 65 gfmichaud 2013-06-06 20:39:58 UTC
gfmichaud@dragonfly:~/Documents/linux-3.10-rc4$ grep -i 'minstrel' .config
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
Comment 66 gfmichaud 2013-06-06 21:08:15 UTC
However I thing minstrel is activated.
I have activated mac80211 debug in the kernel before compiling and now there is :

root@dragonfly:/sys/kernel/debug/ieee80211/phy0/netdev:wlan0/stations/00:24:d4:69:f4:14# ls
agg_status         current_tx_rate  ht_capa          last_rx_rate   node_stat          rx_bytes       rx_fragments  tx_filtered   tx_retry_count   wep_weak_iv_count
beacon_loss_count  dev              inactive_ms      last_seq_ctrl  num_ps_buf_frames  rx_dropped     rx_packets    tx_fragments  tx_retry_failed
connected_time     flags            last_ack_signal  last_signal    rc_stats           rx_duplicates  tx_bytes      tx_packets    vht_capa

looks like what's in http://wireless.kernel.org/en/developers/Documentation/mac80211/RateControl/minstrel

But I can't remember if it was like that before enabling mac80211 debug in the kernel.
Comment 67 gfmichaud 2013-06-06 22:10:42 UTC
I have tried this configuration both on the patched and unpatched kernel (with power management off).
I think minstrel is activated because /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/00\:24\:d4\:69\:f4\:14/rc_stats don't look at all with my standard 3.8 kernel and this custom 3.10 :

gfmichaud@dragonfly:~$ cat rc_stats_3.10
type         rate     throughput  ewma prob   this prob  retry   this succ/attempt   success    attempts
CCK/LP        1.0M           0.4       50.4       100.0      0              0(  0)         5          22
CCK/LP        2.0M           0.0        0.0         0.0      0              0(  0)         0           0
CCK/LP        5.5M           0.0        0.0         0.0      0              0(  0)         0           0
CCK/LP       11.0M           0.0        0.0         0.0      0              0(  0)         0           0
HT20/LGI  t  MCS0            4.8       79.8        50.0      3              0(  0)       318         495
HT20/LGI     MCS1            3.3       28.7         7.6      4              0(  0)       439         879
HT20/LGI T P MCS2           14.6       88.5       100.0      5              3(  3)       757        1825
HT20/LGI     MCS3            0.0        0.0         0.0      0              0(  0)         0           4
HT20/LGI     MCS4            0.0        0.0         0.0      0              0(  0)         0           4
HT20/LGI     MCS5            0.0        0.0         0.0      0              0(  0)         0           5
HT20/LGI     MCS6            0.0        0.0         0.0      0              0(  0)         0           4
HT20/LGI     MCS7            0.0        0.0         0.0      0              0(  0)         0           4
HT20/SGI     MCS0            4.7       68.2       100.0      3              0(  0)        22          38
HT20/SGI     MCS1            3.6       29.2         0.0      4              0(  0)         2          12
HT20/SGI     MCS2            5.9       33.1        25.0      5              0(  0)        38         110
HT20/SGI     MCS3            0.0        0.0         0.0      0              0(  0)         0           4
HT20/SGI     MCS4            0.0        0.0         0.0      0              0(  0)         0           4
HT20/SGI     MCS5            0.0        0.0         0.0      0              0(  0)         0           5
HT20/SGI     MCS6            0.0        0.0         0.0      0              0(  0)         0           4
HT20/SGI     MCS7            0.0        0.0         0.0      0              0(  0)         0           3

Total packet count::    ideal 1505      lookaround 77
Average A-MPDU length: 1.0

gfmichaud@dragonfly:~$ cat rc_stats_3.8 
    HT    MCS   Rate    Success    Retries   XRetries        PER
                1.0:          2          0          0          0
                2.0:          0          0          0          0
                5.5:          0          0          0          0
               11.0:          0          0          0          0
  HT20      1  13.0:          0          0          0          0
  HT20      2  19.5:          0          0          0          0
  HT20      3  26.0:          0          0          0          0
  HT20      4  39.0:          0          0          0          0
  HT20      5  52.0:          3         14          2         30
  HT20      6  58.5:          2          8          2         30
  HT20      7  65.0:          9          9          2         30
  HT20      7  72.2:        380         86         14          5
gfmichaud@dragonfly:~$


I've had, however, no convincing results with this.
Curiously, the connection looks like it's up (Network Manager shows 2 bars) but when I try to using (with Chrome or simply "host www.google.com") everything times out, and I get disconnected at long last.

I'll keep on testing the custom 3.10 (patch + minstrel) for a while.
Comment 68 Sujith 2013-06-07 00:28:05 UTC
Yes, that is minstrel. I've dropped the ANI patches since they don't seem to improve things.
Comment 69 Sujith 2013-06-07 01:30:13 UTC
Can you apply this patch http://msujith.org/patches/ar9485/div-ctrl.patch and post the output of /sys/kernel/debug/ieee80211/phy#/ath9k/base_eeprom ?
Comment 70 gfmichaud 2013-06-07 05:01:12 UTC
Applied the patch on a 3.10-RC4 kernel without any other modification (except enabling ATH9K debuggung).
Here comes the log : base_eeprom_1.txt
Comment 71 gfmichaud 2013-06-07 05:02:57 UTC
Created attachment 103721 [details]
base_eeprom_1.txt
Comment 72 Sujith 2013-06-07 05:19:50 UTC
Hm, I think you forgot to load the new module. ;)
With that patch, this would be displayed:

ANT Div. Control :          6
Comment 73 gfmichaud 2013-06-07 05:21:31 UTC
You mean with CONFIG_ATH9K_RATE_CONTROL disabled ?
Comment 74 Sujith 2013-06-07 05:25:41 UTC
No, this is not related to rate control. That 1-line patch dumps the "ANT Div. Control" field in the base_eeprom debugfs file. I think you just have to reload the newly compiled module.
Comment 75 gfmichaud 2013-06-07 05:29:26 UTC
Yep there's :
    ANT Div. Control :        201

> base_eeprom_new.txt
Comment 76 gfmichaud 2013-06-07 05:29:53 UTC
Created attachment 103731 [details]
base_eeprom_new.txt
Comment 77 Sujith 2013-06-07 05:44:19 UTC
Thanks.

It looks like RX antenna diversity is enabled on the chip in your card. This will most likely not work, but can you try this patch, see if any change is seen in connectivity and post the syslog (with the usual debug=0x8f49) ?

http://msujith.org/patches/ar9485/disable-comb.patch

I don't have such a chip with me, unfortunately.
Comment 78 gfmichaud 2013-06-07 07:43:32 UTC
Created attachment 103741 [details]
make_errors.txt
Comment 79 gfmichaud 2013-06-07 07:44:33 UTC
I have applied both of your patches (div-ctrl.patch & disable-comb.patch) but now the kernel & modules won't compile.
I put the errors I see in make_errors.txt
Comment 80 Sujith 2013-06-07 07:50:22 UTC
Hm, not sure. But, you can just comment out the line that enables diversity combining, that is sufficient. I've attached a patch.
Comment 81 Sujith 2013-06-07 07:51:00 UTC
Created attachment 103751 [details]
disable comb patch
Comment 82 jkp 2013-06-07 08:01:37 UTC
Appeared to be a missing } in the disable-comb.patch
Comment 83 jkp 2013-06-07 08:21:55 UTC
Also here:

    ANT Div. Control :        201

However the code snippet in the disable-comb patch appears to not be in execution path, this message does not show up in the log:

"Diversity combining enabled in EEPROM\n"
Comment 84 gfmichaud 2013-06-07 08:24:28 UTC
The new version of the patch works but /sys/kernel/debug/ieee80211/phy0/ath9k/base_eeprom still shows :
      EEPROM Version :          2
          RegDomain1 :         96
          RegDomain2 :         31
             TX Mask :          1
             RX Mask :          1
          Allow 5GHz :          0
          Allow 2GHz :          1
   Disable 2GHz HT20 :          0
   Disable 2GHz HT40 :          0
   Disable 5Ghz HT20 :          0
   Disable 5Ghz HT40 :          0
          Big Endian :          0
           RF Silent :         29
           BT option :          0
          Device Cap :          0
         Device Type :          5
  Power Table Offset :          0
        Tuning Caps1 :          0
        Tuning Caps2 :          0
 Enable Tx Temp Comp :          1
 Enable Tx Volt Comp :          0
   Enable fast clock :          1
     Enable doubling :          1
  Internal regulator :          1
        Enable Paprd :          1
     Driver Strength :          0
          Quick Drop :          0
   Chain mask Reduce :          0
   Write enable Gpio :          3
   WLAN Disable Gpio :          0
       WLAN LED Gpio :          8
 Rx Band Select Gpio :        255
             Tx Gain :          6
             Rx Gain :          0
              SW Reg :          0
    ANT Div. Control :        201
          MacAddress : 00:08:ca:87:8f:fc
Comment 85 Sujith 2013-06-07 08:29:43 UTC
The eeprom contents will not be modified, they are read-only. But, with diversity combining commented out, is there any difference in link stability ?
Comment 86 gfmichaud 2013-06-07 08:32:44 UTC
Can't tell right now, I'm not home and won't have wifi connection (except tethering) until tonight. :-(
Comment 87 Sujith 2013-06-07 14:48:48 UTC
(In reply to comment #83)
> Also here:
> 
>     ANT Div. Control :        201
> 
> However the code snippet in the disable-comb patch appears to not be in
> execution path, this message does not show up in the log:
> 
> "Diversity combining enabled in EEPROM\n"

Have you loaded the driver with debug=0x8f49 ? Also, can you post the full output of the base_eeprom file ?
Comment 88 jkp 2013-06-07 19:35:27 UTC
base_eeprom without mac address (only difference to ghmuchaud's file is WLAN LED Gpio)

      EEPROM Version :          2
          RegDomain1 :         96
          RegDomain2 :         31
             TX Mask :          1
             RX Mask :          1
          Allow 5GHz :          0
          Allow 2GHz :          1
   Disable 2GHz HT20 :          0
   Disable 2GHz HT40 :          0
   Disable 5Ghz HT20 :          0
   Disable 5Ghz HT40 :          0
          Big Endian :          0
           RF Silent :         29
           BT option :          0
          Device Cap :          0
         Device Type :          5
  Power Table Offset :          0
        Tuning Caps1 :          0
        Tuning Caps2 :          0
 Enable Tx Temp Comp :          1
 Enable Tx Volt Comp :          0
   Enable fast clock :          1
     Enable doubling :          1
  Internal regulator :          1
        Enable Paprd :          1
     Driver Strength :          0
          Quick Drop :          0
   Chain mask Reduce :          0
   Write enable Gpio :          3
   WLAN Disable Gpio :          0
       WLAN LED Gpio :          6
 Rx Band Select Gpio :        255
             Tx Gain :          6
             Rx Gain :          0
              SW Reg :          0
    ANT Div. Control :        201
Comment 89 jkp 2013-06-07 19:51:33 UTC
Well, I had echo 0xffffffffffffffff > /sys/kernel/debug/ieee80211/*/ath9k/debug after loading. But now loading ath9k.ko with debug=0x8f49 I still get no message from hw.c about diversity. Also, /sys/kernel/debug/ieee80211/*/ath9k/diversity
 has "0".
Comment 90 jkp 2013-06-07 20:02:30 UTC
Sorry, I take the last one back, my bad - I had locally modified the debug condition, now I get the debug log as I should:

Jun  7 23:01:44 assu kernel: [38948.170558] ath: phy22: Diversity combining enabled in EEPROM
Jun  7 23:01:44 assu kernel: [38948.170560] ath: phy22: Not enabling COMB in the driver
Comment 91 jkp 2013-06-07 20:07:20 UTC
With the patches and power management on, I still can't connect to my normal wlan AP from the place where kernel 3.6.11 and win8 do connect to the AP, so reception is definitely worse that with those environments.

One thing - with kernel 3.10rc and the patches the antennas are listed as follows:

iw phy phy22 info

	Available Antennas: TX 0x1 RX 0x1
	Configured Antennas: TX 0x1 RX 0x1

My recollection is that earlier with some earlier kernel versions I've seen 0x3 listed as the RX antenna.
Comment 92 jkp 2013-06-07 20:23:36 UTC
Without the disable-comp patch:

	Available Antennas: TX 0x1 RX 0x3
	Configured Antennas: TX 0x1 RX 0x3
Comment 93 jkp 2013-06-08 08:31:17 UTC
But with power management on, I can connect to the 4G Sierra AP from ca. 7-8 meters and connection is 72 Mbps.
Comment 94 gfmichaud 2013-06-10 05:21:52 UTC
I've tested the kernel with both patches.
Connectivity is not better.
Close to the AP (syslog1.txt), it works. Then, farther, Network Manager still shows the connection working but everything I try times out (syslog2.txt). Then it disconnects (syslog3.txt). And connects again when I come back closer (syslog4.txt).
Comment 95 gfmichaud 2013-06-10 05:22:46 UTC
Created attachment 104091 [details]
Syslog - 2013-06-10 7h19
Comment 96 gfmichaud 2013-06-10 05:39:41 UTC
I've just run a second test session and the result was much much better !
No disconnection at all, good link quality (3 out 4 for some time) and good bitrate (from 19 to 22 MB/s).
I give you the syslog too.
I may be able to do a longer test session (a few hours) tonight.
Comment 97 gfmichaud 2013-06-10 05:41:15 UTC
Created attachment 104101 [details]
Syslog - 2013-06-10 7h39
Comment 98 Sujith 2013-06-10 05:45:52 UTC
Thanks for testing. So the antenna diversity code in ath9k is probably buggy. It was written for the earlier AR9002 chips and has not been touched in years even though the driver gained "support" for AR9003 (including AR9485). I'll look at it.
Comment 99 gfmichaud 2013-06-12 11:19:31 UTC
OK ! If you need me test anything, feel free to ask.
Comment 100 jkp 2013-06-13 06:18:31 UTC
It appears there's some changes in kernel version 3.10-rc5 ath9k code (at kernel.org) - I'm compiling it and will be testing.

Also trying some tests with the sensitivity (not seeing not-so-close networks) - appears that with 3.6.11 and 3.7.1 I can see & connect to my regular network while with 3.8.0 and 3.10-rc4 I can't see it. Testing next with 3.7.4. Hopefully with this I can find out which change(s) made the sensitivity worse.
Comment 101 Sujith 2013-06-13 06:28:42 UTC
(In reply to comment #100)
> It appears there's some changes in kernel version 3.10-rc5 ath9k code (at
> kernel.org) - I'm compiling it and will be testing.
> 
> Also trying some tests with the sensitivity (not seeing not-so-close
> networks)
> - appears that with 3.6.11 and 3.7.1 I can see & connect to my regular
> network
> while with 3.8.0 and 3.10-rc4 I can't see it. Testing next with 3.7.4.
> Hopefully with this I can find out which change(s) made the sensitivity
> worse.

Between 3.7 and 3.8 there were two commits for AR9485 (the rest are for PAPRD, which is disabled for all chips).

a796a1d ath9k_hw: Fix RX gain initvals for AR9485
413c030 ath9k_hw: Update AR9485 initvals

Can you try this patch ?

https://patchwork.kernel.org/patch/2696121/
Comment 102 jkp 2013-06-13 06:36:07 UTC
I'll test - against which version, 3.10-rc5?
Comment 103 Sujith 2013-06-13 06:40:16 UTC
The patch was posted for the wireless-testing tree, but it should apply on top of mainline (3.10-rc5).
Comment 104 Sujith 2013-06-13 07:04:24 UTC
Also, can you please test this patch ?
http://msujith.org/patches/ar9485/ar9485-test.patch
Comment 105 jkp 2013-06-13 07:10:09 UTC
Wow, the first patch makes a big difference! Tested on 3.10-rc4 as the 3.10-rc5 compile didn't finish yet. Strength meter now shows better readings than on 3.6.11 and 3.7.1, and seems to be on par with what Win8 shows. Thanks. Writing this on the wireless link with power management on, will test with long-term wireless use and report if there are problems.

Quality=54/70  Signal level=-56 dBm
Link Quality=48/70  Signal level=-62 dBm
Comment 106 jkp 2013-06-13 07:24:56 UTC
Works also with second patch, maybe a bit lower signal values but maybe not, not sure:

          Link Quality=45/70  Signal level=-65 dBm  
          Link Quality=45/70  Signal level=-65 dBm  
          Link Quality=37/70  Signal level=-73 dBm  
          Link Quality=49/70  Signal level=-61 dBm  
          Link Quality=40/70  Signal level=-70 dBm  
          Link Quality=51/70  Signal level=-59 dBm
Comment 107 jkp 2013-06-13 07:28:52 UTC
With power management off, speed as reported by iwconfig drops to 1Mbps as before, but rises more often back to 65 Mbps, does seem problematic. . Kernel 3.10-rc4. With power management on, seems to stay at 65 Mbps.
Comment 108 Sujith 2013-06-13 07:50:14 UTC
The second patch is applicable for a specific model of AR9485. Can you please attach the output of "dmidecode" to this bug ? Also, the contents of "modal_eeprom" in the ath9k debugfs directory.

The power management issue appears to be different, so we can analyze it in a new bug report.
Comment 109 Sujith 2013-06-13 07:54:36 UTC
(In reply to comment #99)
> OK ! If you need me test anything, feel free to ask.

Please test this patch: https://patchwork.kernel.org/patch/2696121/
Comment 110 jkp 2013-06-13 08:48:50 UTC
Here's the info from kernel version 3.8.0 (suppose that doesn't matter but just saying in case), (that's because for some reason the internal display of this computer doesn't work with the 3.10rc4 kernel and I'm on the move without a display cable).

modal_eeprom:

   2GHz modal Header :
 Chain0 Ant. Control :         16
 Chain1 Ant. Control :         16
 Chain2 Ant. Control :         16
 Ant. Common Control :       1088
Ant. Common Control2 :     559240
           Ant. Gain :          0
       Switch Settle :         44
    Chain0 xatten1DB :         30
    Chain1 xatten1DB :          0
    Chain2 xatten1DB :          0
Chain0 xatten1Margin :          5
Chain1 xatten1Margin :          0
Chain2 xatten1Margin :          0
          Temp Slope :         38
          Volt Slope :          0
      spur Channels0 :        180
      spur Channels1 :        140
      spur Channels2 :        164
      spur Channels3 :        100
      spur Channels4 :          0
 Chain0 NF Threshold :         -1
 Chain1 NF Threshold :          0
 Chain2 NF Threshold :          0
          Quick Drop :          0
       txEndToXpaOff :          0
      xPA Bias Level :          0
  txFrameToDataStart :         14
       txFrameToPaOn :         14
      txFrameToXpaOn :         14
              txClip :          3
    ADC Desired size :        -30
   5GHz modal Header :
 Chain0 Ant. Control :          0
 Chain1 Ant. Control :          0
 Chain2 Ant. Control :          0
 Ant. Common Control :        272
Ant. Common Control2 :     139810
           Ant. Gain :          0
       Switch Settle :         45
    Chain0 xatten1DB :          0
    Chain1 xatten1DB :          0
    Chain2 xatten1DB :          0
Chain0 xatten1Margin :          0
Chain1 xatten1Margin :          0
Chain2 xatten1Margin :          0
          Temp Slope :         68
          Volt Slope :          0
      spur Channels0 :          0
      spur Channels1 :          0
      spur Channels2 :          0
      spur Channels3 :          0
      spur Channels4 :          0
 Chain0 NF Threshold :         -1
 Chain1 NF Threshold :          0
 Chain2 NF Threshold :          0
          Quick Drop :          0
       txEndToXpaOff :          0
      xPA Bias Level :          0
  txFrameToDataStart :         14
       txFrameToPaOn :         14
      txFrameToXpaOn :         14
              txClip :          3
    ADC Desired size :        -30


dmidecode with some id info removed:

# dmidecode 2.11
# SMBIOS entry point at 0xda152198
SMBIOS 2.7 present.
23 structures occupying 1673 bytes.
Table at 0xDA130018.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: American Megatrends Inc.
	Version: TX300CA.207
	Release Date: 01/03/2013
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 6144 kB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		EDD is supported
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		Print screen service is supported (int 5h)
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		ACPI is supported
		USB legacy is supported
		Smart battery is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 4.6

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: TX300CA
	Version: 1.0       
	Serial Number: D3N0AS...
	UUID: XX
	Wake-up Type: Power Switch
	SKU Number: ASUS-NotebookSKU
	Family: TX

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: TX300CA
	Version: 1.0       
	Serial Number: BSN12345678901234567
	Asset Tag: ATN12345678901234567
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: MIDDLE              
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0

Handle 0x0003, DMI type 3, 22 bytes
Chassis Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Type: Notebook
	Lock: Not Present
	Version: 1.0       
	Serial Number: D3N0...
	Asset Tag: No Asset Tag    
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Safe
	Security Status: None
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: 1
	Contained Elements: 0
	SKU Number: To be filled by O.E.M.

Handle 0x0004, DMI type 10, 26 bytes
On Board Device 1 Information
	Type: Video
	Status: Enabled
	Description:  VGA
On Board Device 2 Information
	Type: Ethernet
	Status: Enabled
	Description:  GLAN
On Board Device 3 Information
	Type: Ethernet
	Status: Enabled
	Description:  WLAN
On Board Device 4 Information
	Type: Sound
	Status: Enabled
	Description:  Audio CODEC 
On Board Device 5 Information
	Type: SATA Controller
	Status: Enabled
	Description:  SATA Controller
On Board Device 6 Information
	Type: Other
	Status: Enabled
	Description:  USB 2.0 Controller
On Board Device 7 Information
	Type: Other
	Status: Enabled
	Description:  USB 3.0 Controller
On Board Device 8 Information
	Type: Other
	Status: Enabled
	Description:  SMBus Controller
On Board Device 9 Information
	Type: Other
	Status: Enabled
	Description:  Card Reader
On Board Device 10 Information
	Type: Other
	Status: Enabled
	Description:  Cmos Camera
On Board Device 11 Information
	Type: Other
	Status: Enabled
	Description:  Bluetooth

Handle 0x0005, DMI type 11, 5 bytes
OEM Strings
	String 1: o-Mhkr40jcL1j
	String 2: 2wTq7ea3NiKjM
	String 3: VnnHxSQZhjGqQ
	String 4: 90NB0071-M00370
	String 5:  
	String 6:  
	String 7:  
	String 8:  
	String 9:  
	String 10:  

Handle 0x0006, DMI type 12, 5 bytes
System Configuration Options
	Option 1: DSN:210582049385                    
	Option 2: DSN:31E260C44A06                    
	Option 3: DSN:60A44C062E13                    
	Option 4: SMI:00B2CA

Handle 0x0007, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0008, DMI type 7, 19 bytes
Cache Information
	Socket Designation: CPU Internal L2
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Through
	Location: Internal
	Installed Size: 512 kB
	Maximum Size: 512 kB
	Supported SRAM Types:
		Unknown
	Installed SRAM Type: Unknown
	Speed: Unknown
	Error Correction Type: Multi-bit ECC
	System Type: Unified
	Associativity: 8-way Set-associative

Handle 0x0009, DMI type 7, 19 bytes
Cache Information
	Socket Designation: CPU Internal L1
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Through
	Location: Internal
	Installed Size: 128 kB
	Maximum Size: 128 kB
	Supported SRAM Types:
		Unknown
	Installed SRAM Type: Unknown
	Speed: Unknown
	Error Correction Type: Parity
	System Type: Data
	Associativity: 8-way Set-associative

Handle 0x000A, DMI type 7, 19 bytes
Cache Information
	Socket Designation: CPU Internal L3
	Configuration: Enabled, Not Socketed, Level 3
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 4096 kB
	Maximum Size: 4096 kB
	Supported SRAM Types:
		Unknown
	Installed SRAM Type: Unknown
	Speed: Unknown
	Error Correction Type: Multi-bit ECC
	System Type: Unified
	Associativity: 16-way Set-associative

Handle 0x000B, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 32 GB
	Error Information Handle: Not Provided
	Number Of Devices: 4

Handle 0x000C, DMI type 4, 42 bytes
Processor Information
	Socket Designation: SOCKET 0
	Type: Central Processor
	Family: Core i7
	Manufacturer: Intel(R) Corporation
	ID: A9 06 03 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 58, Stepping 9
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz
	Voltage: 12.7 V
	External Clock: 100 MHz
	Max Speed: 3800 MHz
	Current Speed: 2400 MHz
	Status: Populated, Enabled
	Upgrade: Socket rPGA988B
	L1 Cache Handle: 0x0009
	L2 Cache Handle: 0x0008
	L3 Cache Handle: 0x000A
	Serial Number: Not Specified
	Asset Tag: Fill By OEM
	Part Number: Fill By OEM
	Core Count: 2
	Core Enabled: 2
	Thread Count: 4
	Characteristics:
		64-bit capable

Handle 0x000D, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000B
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2048 MB
	Form Factor: SODIMM
	Set: None
	Locator: ChannelA-DIMM0
	Bank Locator: BANK 0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1600 MHz
	Manufacturer: Elpida
	Serial Number: 00000000
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: 1
	Configured Clock Speed: 1600 MHz

Handle 0x000E, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x000D
	Memory Array Mapped Address Handle: 0x0013
	Partition Row Position: Unknown
	Interleave Position: 1
	Interleaved Data Depth: 2

Handle 0x000F, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000B
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: ChannelA-DIMM1
	Bank Locator: BANK 1
	Type: Unknown
	Type Detail: None
	Speed: Unknown
	Manufacturer: [Empty]
	Serial Number: [Empty]
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: Unknown
	Configured Clock Speed: Unknown

Handle 0x0010, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000B
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2048 MB
	Form Factor: SODIMM
	Set: None
	Locator: ChannelB-DIMM0
	Bank Locator: BANK 2
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1600 MHz
	Manufacturer: Elpida
	Serial Number: 00000000
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: 1
	Configured Clock Speed: 1600 MHz

Handle 0x0011, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00080000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x0010
	Memory Array Mapped Address Handle: 0x0013
	Partition Row Position: Unknown
	Interleave Position: 2
	Interleaved Data Depth: 2

Handle 0x0012, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000B
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: ChannelB-DIMM1
	Bank Locator: BANK 3
	Type: Unknown
	Type Detail: None
	Speed: Unknown
	Manufacturer: [Empty]
	Serial Number: [Empty]
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: Unknown
	Configured Clock Speed: Unknown

Handle 0x0013, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 4 GB
	Physical Array Handle: 0x000B
	Partition Width: 4

Handle 0x0018, DMI type 131, 64 bytes
OEM-specific Type
	Header and Data:
		83 40 18 00 31 00 00 00 00 00 00 00 00 00 00 00
		F8 00 58 1E FF FF FF FF 01 20 00 00 01 00 08 00
		26 05 02 00 00 00 00 00 C8 00 FF FF 00 00 00 00
		00 00 00 00 66 00 00 00 76 50 72 6F 00 00 00 00

Handle 0x0019, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Long
	Installable Languages: 1
		en|US|iso8859-1
	Currently Installed Language: en|US|iso8859-1

Handle 0x001A, DMI type 127, 4 bytes
End Of Table
Comment 111 Sujith 2013-06-13 11:03:37 UTC
(In reply to comment #110)
> Here's the info from kernel version 3.8.0 (suppose that doesn't matter but
> just
> saying in case), (that's because for some reason the internal display of this
> computer doesn't work with the 3.10rc4 kernel and I'm on the move without a
> display cable).

Thanks.

Here is a patch adding support for this card:
http://msujith.org/patches/wl/Jun-13-2013/0001-ath9k-Add-custom-parameters-for-CUS198.patch

Can you test this ? This will apply on top of the earlier patch ("Assign default xlna config for AR9485").

Also, after you explicitly unload/reload ath9k (modprobe -r ath9k; modprobe ath9k), the line "Set parameters for CUS198" should be seen in dmesg.
Comment 112 jkp 2013-06-13 12:59:39 UTC
Applied first https://patchwork.kernel.org/patch/2696121/ then http://msujith.org/patches/wl/Jun-13-2013/0001-ath9k-Add-custom-parameters-for-CUS198.patch on top of Ubuntu kernel 3.8.0-26 which I have running now.

Patch(1) applied it with some fuzz and I had to manually apply the patch to pci.c.

Seems to work fine with a short test: decent bandwidth, keeps up, shows 65 Mbps as rate, link quality between 40 and 50, and I get the kernel message:

ath: phy1: Set parameters for CUS198

I can test later with some other kernel versions if needed.
Comment 113 gfmichaud 2013-06-13 13:32:25 UTC
(In reply to comment #109)
> (In reply to comment #99)
> > OK ! If you need me test anything, feel free to ask.
> 
> Please test this patch: https://patchwork.kernel.org/patch/2696121/


I need a few precisions :
- do I have to apply this patch only ?
- on top of the 3.10-rc5 kernel ?
- with powersave mode off ?
- what do I have to post (logs...) after testing ?
Comment 114 Sujith 2013-06-13 13:48:41 UTC
On top of Linus Torvalds' tree, apply these patches:

https://patchwork.kernel.org/patch/2696121/
http://msujith.org/patches/wl/Jun-13-2013/0001-ath9k-Add-custom-parameters-for-CUS198.patch

PS has been disabled by default in mainline now.

Reload ath9k and in dmesg, the message "Set parameters for CUS198" should be seen.
Comment 115 gfmichaud 2013-06-13 14:11:02 UTC
Sorry I'm a kernel newbie...
How can I download Linus' tree ?
Previously, I downloaded the sources from kernel.org
Comment 116 Sujith 2013-06-13 14:14:59 UTC
Hm, in that case, you can just apply the patches on top of the 3.10-rc5 tarball.
Comment 117 jkp 2013-06-13 14:19:38 UTC
Tested also with mainline 3.9.5, applied first https://patchwork.kernel.org/patch/2696121/ then http://msujith.org/patches/wl/Jun-13-2013/0001-ath9k-Add-custom-parameters-for-CUS198.patch. Applied with some fuzz, no manual intervention required, results look the same as with 3.8.0.
Comment 118 jkp 2013-06-13 14:31:35 UTC
Same good results with mainline 3.10-rc5, applied first
https://patchwork.kernel.org/patch/2696121/ then
http://msujith.org/patches/wl/Jun-13-2013/0001-ath9k-Add-custom-parameters-for-CUS198.patch.
Applied with some fuzz, no manual intervention required, results look the same
as with 3.8.0 and 3.9.5.
Comment 119 jkp 2013-06-13 15:59:37 UTC
Out of topic probably, but as I see that bluetooth is in the same device: seems like there is a problem with bluetooth also, but could be something else than the driver. Device is found, hciconfig shows bytes sent and received, but hcitool scan doesn't show devices.
Comment 120 Sujith 2013-06-13 16:06:42 UTC
What does lsusb -v show ?
Comment 121 jkp 2013-06-13 16:11:59 UTC
Bus 001 Device 003: ID 13d3:3402 IMC Networks 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x13d3 IMC Networks
  idProduct          0x3402 
  bcdDevice            0.01
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          177
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
       bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
   Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
Comment 122 Sujith 2013-06-13 16:25:18 UTC
Hm, that's weird. What does 'ls -l /sys/bus/usb/drivers' show ? Does it have ath3k ?
Comment 123 jkp 2013-06-13 16:32:48 UTC
No - there's "btusb" with contents:

lrwxrwxrwx 1 root root    0 kesä  13 19:30 1-1.1:1.0 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0
lrwxrwxrwx 1 root root    0 kesä  13 19:30 1-1.1:1.1 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.1
--w------- 1 root root 4096 kesä  13 19:30 bind
lrwxrwxrwx 1 root root    0 kesä  13 19:30 module -> ../../../../module/btusb
-rw-r--r-- 1 root root 4096 kesä  13 19:30 new_id
-rw-r--r-- 1 root root 4096 kesä  13 19:30 remove_id
--w------- 1 root root 4096 kesä  13 19:02 uevent
--w------- 1 root root 4096 kesä  13 19:30 unbind
Comment 124 gfmichaud 2013-06-13 16:34:57 UTC
One last question before testing : do I have to disable ATH9K_RATE_CONTROL or not ?
Comment 125 jkp 2013-06-13 16:36:08 UTC
Hmm, probably ran lsusb -v without root access, here's with root, has some more info:

Bus 001 Device 003: ID 13d3:3402 IMC Networks 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x13d3 IMC Networks
  idProduct          0x3402 
  bcdDevice            0.01
  iManufacturer           1 Atheros Communications
  iProduct                2 Bluetooth USB Host Controller
  iSerial                 3 Alaska Day 2006
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          177
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 BT HCI
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled
Comment 126 Sujith 2013-06-13 16:37:50 UTC
(In reply to comment #124)
> One last question before testing : do I have to disable ATH9K_RATE_CONTROL or
> not ?

Yes, ATH9K_RATE_CONTROL has to be disabled.
Comment 127 Sujith 2013-06-13 16:40:15 UTC
(In reply to comment #125)
> Hmm, probably ran lsusb -v without root access, here's with root, has some
> more
> info:
> 
> Bus 001 Device 003: ID 13d3:3402 IMC Networks 
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass          224 Wireless
>   bDeviceSubClass         1 Radio Frequency
>   bDeviceProtocol         1 Bluetooth
>   bMaxPacketSize0        64
>   idVendor           0x13d3 IMC Networks
>   idProduct          0x3402 
>   bcdDevice            0.01
>   iManufacturer           1 Atheros Communications
>   iProduct                2 Bluetooth USB Host Controller
>   iSerial                 3 Alaska Day 2006

Ok, I am not familiar with bluetooth - I'll try to get more information.
Comment 128 jkp 2013-06-13 16:43:44 UTC
Ah, I wondered I might have forgotten something with my 3.8.0 test - now I remember, it was ATH9K_RATE_CONTROL:

# grep RATE_CONTROL .config
CONFIG_ATH9K_RATE_CONTROL=y

Seems to work quite well even with this.

For 3.9.5 and 3.10 I had it disabled:

# grep RATE_CONTROL .config
# CONFIG_ATH9K_RATE_CONTROL is not set
Comment 129 gfmichaud 2013-06-13 17:12:47 UTC
So I've applied both patches on top of the 3.10-rc5 kernel.

Everything looks OK :
gfmichaud@dragonfly:~$ sudo rmmod ath9k
[sudo] password for gfmichaud: 
gfmichaud@dragonfly:~$ sudo modprobe ath9k
gfmichaud@dragonfly:~$ dmesg | grep -i parameters
[  289.311397] ath: phy0: ANI parameters: SI=3, ofdmWS=on FS=7 MRCcck=on listenTime=25 ofdmErrs=64 cckErrs=892
[  297.359862] ath: phy1: Set parameters for CUS198

However, it looks like powersave is on by default (I've removed the item in /etc/pm/power.d that disabled it) :
gfmichaud@dragonfly:~$ iw dev wlan0 get power_save
Power save: on

Link quality seems to have improved a lot :
- in 3.8 without patches, "iw dev wlan0 link" shows me "signal" between -74 and -86 dBm
- in 3.10-rc5 with the patches, it shows me "signal" between -55 and -62 dBm

I'll do futher testing and report here.
Comment 130 Sujith 2013-06-13 17:19:06 UTC
(In reply to comment #129)
> However, it looks like powersave is on by default (I've removed the item in
> /etc/pm/power.d that disabled it) :
> gfmichaud@dragonfly:~$ iw dev wlan0 get power_save
> Power save: on

The PS/rate-control patches will be in -rc6.
Comment 131 gfmichaud 2013-06-13 17:53:16 UTC
I've been using it with all doors closed at home and experienced no disconnection and no lag.
Looks really great !!! :-)
Comment 132 jkp 2013-06-13 18:00:31 UTC
No problems here either, seems to work fine in longer term (well, a few hours) use too. Power management has been on for me though so far, will try with power management off.
Comment 133 jkp 2013-06-13 18:18:53 UTC
With power management off, when I look at the iwconfig bit rate every five seconds, it's mostly 65 Mbps but about every once in 25 .. once in 50 it's 1 Mbps.
Comment 134 jkp 2013-06-13 19:57:05 UTC
With power management off, occasionally there are longer periods of low speed (1..30 Mbps) and this affects also practical usability quite a lot.
Comment 135 Sujith 2013-06-14 01:47:51 UTC
Can you open separate bugs for the PS and bluetooth issues ? Thanks.

John, I think this bug can be closed now, patch has been sent:
https://patchwork.kernel.org/patch/2718041/
Comment 136 jkp 2013-06-14 05:12:06 UTC
OK, I will - and big thanks for making the wireless much more usable!
Comment 137 gfmichaud 2013-06-14 05:44:46 UTC
Yes, thank you very very much ! :-)
Comment 138 jkp 2013-06-14 06:13:04 UTC
Bugs 59691 & 59701 are the power management and bluetooth bugs:

https://bugzilla.kernel.org/show_bug.cgi?id=59691

https://bugzilla.kernel.org/show_bug.cgi?id=59701
Comment 139 gfmichaud 2013-07-01 12:01:56 UTC
How do we know in which kernel the patches will be committed ?
Will the be in 3.10 or later ?
Comment 140 John W. Linville 2013-07-01 13:30:26 UTC
Presumably in 3.11...
Comment 141 Artur Szymczak 2013-07-30 07:06:44 UTC
Was it merged in 3.11-rc3?
Comment 142 Henrique Arroxelas 2013-08-29 23:33:33 UTC
Were the patches merged on 3.11-rc6?
Comment 143 Sujith 2013-09-11 02:09:05 UTC
The fixes are in the 3.11 release.
Comment 144 John W. Linville 2013-10-15 16:02:22 UTC
*** Bug 55171 has been marked as a duplicate of this bug. ***
Comment 145 John W. Linville 2013-10-15 16:02:42 UTC
*** Bug 55901 has been marked as a duplicate of this bug. ***
Comment 146 Eugene A. Shatokhin 2014-01-31 12:52:50 UTC
(In reply to Sujith from comment #143)
> The fixes are in the 3.11 release.

Thanks! Could you queue them for the stable kernel trees as well?
Comment 147 Jesuino 2019-03-17 13:04:02 UTC
Hi, can anyone help me?

How do I apply a patch? I got the same problem.