# [SEMI-SOLVED][ath9k] How to AR9280 & hostapd & 802.11n?

## Bialy

I fight with this trio a few months. Before I had only 802.11g (54Mbps), but yesterday I changed kernel and hostapd.

Nowadays I have 802.11n (130Mbps) and this message when hostapd starting:

```
rfkill: Cannot open RFKILL control device
```

I have Atheros AR9280 card:

```
ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xffffc90010ea0000, irq=16

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

I crating AP with hostapd:

```
net-wireless/hostapd-2.0  USE="crda ipv6 ssl wps -logwatch -madwifi"

interface=wlp2s0

driver=nl80211

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=Gentoo

country_code=PL

ieee80211d=1

hw_mode=g

channel=7

beacon_int=100

dtim_period=2

max_num_sta=255

rts_threshold=2347

fragm_threshold=2346

macaddr_acl=0

accept_mac_file=/etc/hostapd/hostapd.accept

deny_mac_file=/etc/hostapd/hostapd.deny

auth_algs=3

ignore_broadcast_ssid=0

wmm_enabled=1

wmm_ac_bk_cwmin=4

wmm_ac_bk_cwmax=10

wmm_ac_bk_aifs=7

wmm_ac_bk_txop_limit=0

wmm_ac_bk_acm=0

wmm_ac_be_aifs=3

wmm_ac_be_cwmin=4

wmm_ac_be_cwmax=10

wmm_ac_be_txop_limit=0

wmm_ac_be_acm=0

wmm_ac_vi_aifs=2

wmm_ac_vi_cwmin=3

wmm_ac_vi_cwmax=4

wmm_ac_vi_txop_limit=94

wmm_ac_vi_acm=0

wmm_ac_vo_aifs=2

wmm_ac_vo_cwmin=2

wmm_ac_vo_cwmax=3

wmm_ac_vo_txop_limit=47

wmm_ac_vo_acm=0

ieee80211n=1

ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40]

eap_server=0

own_ip_addr=127.0.0.1

wpa=3

wpa_passphrase=You_want_to_know

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP
```

and ath9k driver:

```
linux-3.8.6-hardened

CONFIG_WLAN=y

CONFIG_ATH9K_HW=y

CONFIG_ATH9K_COMMON=y

# CONFIG_ATH9K_BTCOEX_SUPPORT is not set

CONFIG_ATH9K=y

CONFIG_ATH9K_PCI=y

CONFIG_ATH9K_AHB=y

# CONFIG_ATH9K_DEBUGFS is not set

CONFIG_ATH9K_RATE_CONTROL=y

# CONFIG_ATH9K_HTC is not set

CONFIG_FIB_RULES=y

CONFIG_WIRELESS=y

CONFIG_WEXT_CORE=y

CONFIG_WEXT_PROC=y

CONFIG_CFG80211=y

# CONFIG_NL80211_TESTMODE is not set

# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set

# CONFIG_CFG80211_REG_DEBUG is not set

CONFIG_CFG80211_DEFAULT_PS=y

# CONFIG_CFG80211_DEBUGFS is not set

# CONFIG_CFG80211_INTERNAL_REGDB is not set

CONFIG_CFG80211_WEXT=y

# CONFIG_LIB80211 is not set

CONFIG_MAC80211=y

CONFIG_MAC80211_HAS_RC=y

CONFIG_MAC80211_RC_MINSTREL=y

CONFIG_MAC80211_RC_MINSTREL_HT=y

CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y

CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"

# CONFIG_MAC80211_MESH is not set

CONFIG_MAC80211_LEDS=y
```

What I want?

First of all, how to remove 'rfkill' message?

Second, how to enable full 802.11n support (300Mbps, MIMO 2x2)?Last edited by Bialy on Thu May 16, 2013 3:27 pm; edited 1 time in total

----------

## khayyam

 *Bialy wrote:*   

> 
> 
> ```
> rfkill: Cannot open RFKILL control device
> ```
> ...

 

Baily ... you need to enable CONFIG_RFKILL ... its under: Networking support  => RF switch subsystem support.

 *Bialy wrote:*   

> I crating AP with hostapd:
> 
> ```
> net-wireless/hostapd-2.0  USE="crda ipv6 ssl wps -logwatch -madwifi"
> ```
> ...

 

CONFIG_IEEE80211N is enabled by default in the hostapd ebuild. Unrelated, but unless you must use WPS then I'd suggest you disable that useflag, also you may not want/need ipv6.  

 *Bialy wrote:*   

> 
> 
> ```
> driver=nl80211
> 
> ...

 

The hostapd.conf seems fine, all the 80211N options are enabled.

 *Bialy wrote:*   

> Second, how to enable full 802.11n support (300Mbps, MIMO 2x2)?

 

The card is a AR928X and so should support the following (untested):

```
ht_capab=[HT40-][HT40+][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
```

HTH & best ... khay

----------

## Bialy

 *khayyam wrote:*   

>  *Bialy wrote:*   
> 
> ```
> rfkill: Cannot open RFKILL control device
> ```
> ...

 

I found it in the meantime  :Wink: 

 *khayyam wrote:*   

> 
> 
>  *Bialy wrote:*   Second, how to enable full 802.11n support (300Mbps, MIMO 2x2)? 
> 
> The card is a AR928X and so should support the following (untested):
> ...

 

Still don't work, but I found this:

```
Neighboring BSS: 64:70:02:ae:b2:b8 freq=2437 pri=6 sec=2

40 MHz pri/sec mismatch with BSS 64:70:02:ae:b2:b8 <2437,2417> (chan=6-) vs. <2442,2462>

20/40 MHz operation not permitted on channel pri=7 sec=11 based on overlapping BSSes

Completing interface initialization
```

And Hostapd-0.7.3 description: *Quote:*   

> > > Anyway, you wrote that hostapd check for overlapping BSSes only at startup. Let's assume that at the moment of start there was one
> 
> > > conflicting BSSes on our channels, so as result hostapd started in 20 mhz mode. Then, after some time this conflicting AP has 
> 
> > > gone away (this is an example from real life). In this case, I guess, hostapd will still work in 20 mhz mode and will not switch 
> ...

 

----------

## Bialy

I did it (almost). When my neighbor shut down his network, I restarted my hostapd and inSSIDer says that I using two channels.

Also inSSIDer says that "Max Rate" is 300Mbps, but my clients and AP shows only 130Mbps:

```
tx bitrate:     130.0 MBit/s MCS 15
```

Why Leo, why?

----------

