# Wireless card can't associate (driver:ath9k, chip:AR9285)

## stribika

I have recently bought an ASUS K50IJ-SX124L laptop, with an Atheros wireless card. I'm trying to use it with WPA-PSK but it can't connect to the AP. I am sure the keys are correct, I copied the wpa_supplicant.conf from an other computer. I am using the ath9k driver compiled as a module. Kernel version is 2.6.29-hardened but all the grsecurity and pax stuff is currently disabled.

The network is visible with iwlist scan or with wpa_cli.

Not sure if this is a bug or just some configuration problem. Any help is appreciated.

Here is all the logs and configurations I can think of. I would also post the debug mode (modprobe ath9k debug=0x...) logs but I am concerned it may contain keys (the log is really big if everything is enabled).

lspci -s 02:00.0 -vvv                                                

```
02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)                                                          

        Subsystem: Device 1a3b:1089                                                 

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-                                                           

        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-                                                            

        Latency: 0, Cache Line Size: 32 bytes                                       

        Interrupt: pin A routed to IRQ 17                                           

        Region 0: Memory at feaf0000 (64-bit, non-prefetchable) [size=64K]          

        Capabilities: [40] Power Management version 3                               

                Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold+)                                                                            

                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-              

        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit-

                Address: 00000000  Data: 0000

        Capabilities: [60] Express (v2) Legacy Endpoint, MSI 00

                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us

                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-

                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-

                        MaxPayload 128 bytes, MaxReadReq 512 bytes

                DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-

                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <64us

                        ClockPM- Surprise- LLActRep- BwNot-

                LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+

                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

                DevCap2: Completion Timeout: Not Supported, TimeoutDis+

                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-

                LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB

                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-

                         Compliance De-emphasis: -6dB

                LnkSta2: Current De-emphasis Level: -6dB

        Capabilities: [100] Advanced Error Reporting

                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-

                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+

                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+

                AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-

        Capabilities: [140] Virtual Channel <?>

        Capabilities: [160] Device Serial Number 00-15-17-ff-ff-24-14-12

        Capabilities: [170] Power Budgeting <?>

        Kernel driver in use: ath9k

        Kernel modules: ath9k
```

/etc/conf.d/net

```
dns_domain_lo="stribnet"

modules="wpa_supplicant"

config_eth0=( "dhcp" )

dhcp_eth0="release"

config_wlan0=( "dhcp" )

dhcp_wlan0="release"

mac_wlan0="random-samekind"

config_stribnet=( "192.168.0.4 netmask 255.255.0.0 broadcast 192.168.255.255" )

routes_stribnet=( "default via 192.168.0.1" )

dns_servers_stribnet=( "84.2.44.1" "84.2.46.1" "208.67.222.222" "208.67.220.220" )
```

/etc/wpa_supplicant/wpa_supplicant.conf

```
network={                                                  

    id_str="stribnet"                                      

    ssid="stribnet"                                        

    priority=0                                             

    proto=RSN                                              

    key_mgmt=WPA-PSK                                       

    group=CCMP                                             

    pairwise=CCMP                                          

    psk=...

}
```

There are other networks in it but nothing else.

/var/log/kern.log

```
Dec 31 15:48:44 max kernel: cfg80211: Using static regulatory domain info            

Dec 31 15:48:44 max kernel: cfg80211: Regulatory domain: US                          

Dec 31 15:48:44 max kernel:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)                                                                         

Dec 31 15:48:44 max kernel:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)                                                                              

Dec 31 15:48:44 max kernel:     (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)

Dec 31 15:48:44 max kernel:     (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)

Dec 31 15:48:44 max kernel:     (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)

Dec 31 15:48:44 max kernel:     (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)

Dec 31 15:48:44 max kernel:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)

Dec 31 15:48:44 max kernel: cfg80211: Calling CRDA for country: US

Dec 31 15:48:44 max kernel: ath9k: 0.1

Dec 31 15:48:44 max kernel: ath9k 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17

Dec 31 15:48:44 max kernel: ath9k 0000:02:00.0: setting latency timer to 64

Dec 31 15:48:44 max kernel: wmaster0 (ath9k): not using net_device_ops yet

Dec 31 15:48:44 max kernel: phy0: Selected rate control algorithm 'ath9k_rate_control'

Dec 31 15:48:44 max kernel: wlan0 (ath9k): not using net_device_ops yet

Dec 31 15:48:44 max kernel: Registered led device: ath9k-phy0:radio

Dec 31 15:48:44 max kernel: Registered led device: ath9k-phy0:assoc

Dec 31 15:48:44 max kernel: Registered led device: ath9k-phy0:tx

Dec 31 15:48:44 max kernel: Registered led device: ath9k-phy0:rx

Dec 31 15:48:44 max kernel: phy0: Atheros AR9285 MAC/BB Rev:2 AR5133 RF Rev:e0: mem=0xffffc20021380000, irq=17

Dec 31 15:51:16 max kernel: ADDRCONF(NETDEV_UP): wlan0: link is not ready

Dec 31 15:51:16 max kernel: ADDRCONF(NETDEV_UP): wlan0: link is not ready

Dec 31 15:51:18 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 1

Dec 31 15:51:18 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 2

Dec 31 15:51:18 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 3

Dec 31 15:51:19 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 timed out

Dec 31 15:51:29 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 1

Dec 31 15:51:29 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 1

Dec 31 15:51:29 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 2

Dec 31 15:51:29 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 3

Dec 31 15:51:29 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 timed out

Dec 31 15:51:40 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 1

Dec 31 15:51:40 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 1

Dec 31 15:51:40 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 2

Dec 31 15:51:40 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 try 3

Dec 31 15:51:40 max kernel: wlan0: direct probe to AP 00:19:e0:a3:1a:34 timed out

Dec 31 15:51:43 max kernel: wlan0: deauthenticating by local choice (reason=3)
```

The last message only appears after I shut down the interface. The regulatory domain should not be US but I don't think that is the problem. Is there some firmware I need?

----------

## EzInKy

I only needed firmware for a ath9k usb device, so that shouldn't be the issue. You may consider a newer kernel, my ath9k pci cards worked right of the box with 2.6.31. I researched http://linuxwireless.org before buying to ensure compatibility.

----------

## stribika

Thank you, it works with gentoo-sources-2.6.32-r1. All the log messages are the same (except for the timeouts) so I have no idea why.  The AR9285 should be supported in 2.6.29 and newer kernels.

----------

## EzInKy

Lots of development has occurred since 2.6.29.

----------

## overkll

stribika,

Which version of baselayout are you using?

Using baselayout-1.12.13, here's my working config for my ar9280:

/etc/conf.d/net

```
modules_wlan0=( "!iwconfig" "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"
```

/etc/wpa_supplicant/wpa_supplicant.conf:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=users

update_config=1

network={

        ssid="homenet"

        scan_ssid=1

        psk="supersecretpassphrase"

        key_mgmt=WPA-PSK

        priority=5

}
```

I'm not using NetworkMangler.  I'm using wpa_supplicant gui for managing connections

I've had the best connections with 2.6.29 and 2.6.32.  The other kernel modules didn't work as well.

----------

## cach0rr0

 *EzInKy wrote:*   

> Lots of development has occurred since 2.6.29.

 

++

ath9k was unstable for me on 2.6.29

stable on 2.6.30

horribly horribly unstable 2.6.31 (even with compat-wireless)

and rock solid again on 2.6.32 (well, i switched to zen-sources after being fed up with 2.6.31-gentoo-r6 having hard lockups every hour, zen1-zen3 have been rock solid for me)

using AR928x for what that's worth. 

@original poster

you could try running compat-wireless, but i don't know how well that will work on your current kernel, nor how well that will work under hardened-sources 

(it's in the 'pentoo' overlay)

----------

