# [SOLVED] Cannot force wifi card to work in 802.11n mode

## subox

Hi,

I have a new router, which supports 802.11n and I'd like to connect to it using these standard. All my tries ended with 54 Mb/s( on my girlfriend's notebook with windows 7 bit rate oscillates: 98-124  ):

```
suboxComp ~ # iwconfig wlan0

wlan0     IEEE 802.11abgn  ESSID:"siec"  

          Mode:Managed  Frequency:2.437 GHz  Access Point: 28:BE:9B:04:A8:9C   

          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=61/70  Signal level=-49 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:1443   Missed beacon:01443   Missed beacon:0
```

Here are my configs:

```
lspci | grep -i 'network cont'

03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6200 (rev 35)

```

```
lsmod |grep -i iwl 

iwlagn                166074  0 

mac80211              162488  1 iwlagn

cfg80211              140298  2 iwlagn,mac80211
```

```
grep -r -i iwl /etc/modprobe.d/
```

```
grep -r -i iwl /etc/conf.d/

/etc/conf.d/modules:#modules_2_6="${modules_2_6} iwlagn"

/etc/conf.d/modules:modules_2_6="${modules_2_6} iwlagn"

/etc/conf.d/modules:module_iwlagn_args_2_6="11n_disable=0"
```

```
uname -a

Linux suboxComp 3.0.6-tuxonice #7 SMP Tue Dec 27 15:20:19 CET 2011 x86_64 Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz GenuineIntel GNU/Linux
```

```
grep -i iwl /usr/src/linux/.config

CONFIG_IWLAGN=m

# CONFIG_IWLWIFI_DEBUG is not set

# CONFIG_IWLWIFI_DEVICE_TRACING is not set

# CONFIG_IWLWIFI_DEVICE_SVTOOL is not set

# CONFIG_IWL_P2P is not set

CONFIG_IWLWIFI_LEGACY=m

# CONFIG_IWLWIFI_LEGACY_DEBUG is not set

# CONFIG_IWLWIFI_LEGACY_DEVICE_TRACING is not set

CONFIG_IWL4965=m

# CONFIG_IWL3945 is not set
```

```
dmesg | grep -i iwl

[    8.240053] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, in-tree:

[    8.240055] iwlagn: Copyright(c) 2003-2011 Intel Corporation

[    8.240118] iwlagn 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17

[    8.240127] iwlagn 0000:03:00.0: setting latency timer to 64

[    8.240168] iwlagn 0000:03:00.0: Detected Intel(R) Centrino(R) Advanced-N 6200 AGN, REV=0x74

[    8.250131] iwlagn 0000:03:00.0: device EEPROM VER=0x436, CALIB=0x6

[    8.250133] iwlagn 0000:03:00.0: Device SKU: 0Xb

[    8.250161] iwlagn 0000:03:00.0: Tunable channels: 13 802.11bg, 24 802.11a channels

[    8.250287] iwlagn 0000:03:00.0: irq 43 for MSI/MSI-X

[    8.358035] iwlagn 0000:03:00.0: loaded firmware version 9.221.4.1 build 25532

[    8.358462] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'
```

```
eix iwl6000

[I] net-wireless/iwl6000-ucode

     Available versions:  (~)9.221.4.1

     Installed versions:  9.221.4.1(13:33:41 27.12.2011)

     Homepage:            http://intellinuxwireless.org/?p=iwlwifi

     Description:         Intel (R) Wireless WiFi Advanced N 6000 ucode
```

I've also tried reload modules with and without 11n_disable=0.

Does anyone know what else should I try without replacing wifi card?Last edited by subox on Tue Jan 03, 2012 4:48 pm; edited 1 time in total

----------

## anakin87

hey, I'm starting to think that I've a similar problem....

since the kernelversion 3.1.5 my wireless won't work at full speed - it's a iwl 6300 

with the previous version 3.1.4 where no problems at all and of course i used the gentoo-wiki iwl-guide for the kerneloptions and ucode / firmware

but the 3.1.5 did not connect to the AP with more then 120Mb/s however with 3.1.6 I noticed a little improvement, the connection is now between 130-150Mb/s

the odd thing is now that the transfer-rate won't reach 6Mb/s! why? I thought the connection has at least 130...

The quality should be ok 

```

iwconfig wlan0 #under  3.1.6

Bit Rate=115.6 Mb/s

Link Quality=70/70

Signal level = -35 dBm

iwconfig wlan0 #under 3.1.4

Bit Rate=216 Mb/s

Link Quality=70/70

Signal level = -35 dBm

```

some friends of mine think it has to do with the disabled 40mhz channel-width in the 2.4ghz band - which should be this option in the kernel "cfg80211_disable_40mhz_24ghz" but I guess not for the iwlagn apparently

@subox

wait a minute why did you set the 4965 to a module? I thought you have an 6200?

sry, for my bad english I'm not used to it - for now  :Wink: 

Edit:

Ok there are more people out with similar issues (iwlagn regression), it looks like there is a patch (sort of) http://patchwork.ozlabs.org/patch/131185/

but unfortunatly I'm not sure how I should apply this - I mean I've found the sourcefile and the right methode should I simply paste it at the beginning; save; compile + reboot??

the fedora people had it fixed in 3.1.6-1???

http://lists.fedoraproject.org/pipermail/package-announce/2011-December/071332.html

----------

## mbar

 *subox wrote:*   

> Hi,
> 
> I have a new router, which supports 802.11n and I'd like to connect to it using these standard.

 

Is WPA2 enabled?

----------

## anakin87

@mbar 

I'm not really sure about this because his iwconfig wlan0 let assume that he already established a connection... I don't see why this is relevant, maybe I miss something???

So I just got it working again - it looks like there are some problems with the iwlagn module which falls in the 2.4GHz mode from 40MHz channel width to 20MHz...

To solve this you "just" have to change a source-file for the iwlagn module.

1. open to edit the /usr/src/<your_kernel>/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c

2. search for this method int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)

3.  search for this block

```

                        if (ctx->ht.enabled) {

                                /* if HT40 is used, it should not change

                                 * after associated except channel switch */

                                if (iwl_is_associated_ctx(ctx) &&

                                     !ctx->ht.is_40mhz)

                                        iwlagn_config_ht40(conf, ctx);

                        } else

                                ctx->ht.is_40mhz = false;

```

replace this

```

            if (iwl_is_associated_ctx(ctx) &&

                 !ctx->ht.is_40mhz)

```

with that

```

            if ((iwl_is_associated_ctx(ctx) &&

                  !ctx->ht.is_40mhz) ||

                  !iwl_is_associated_ctx(ctx))

```

4. gcc -c iwl-agn-rxon.c

5. cd /usr/src/<your_kernel>

6. make modules_install

7. modprobe -r iwlagn

8. modprobe iwlagn

9. reconnect to your wlan and enjoy  :Wink: 

special thanks to the folks there http://patchwork.ozlabs.org/patch/131185/

but I guess with the next kernel-update the changes will be gone  :Sad:  or hopefully fixed  :Wink: 

@all is this bug tracked? or how do I report this so it can get fixed...

----------

## subox

 *mbar wrote:*   

>  *subox wrote:*   Hi,
> 
> I have a new router, which supports 802.11n and I'd like to connect to it using these standard. 
> 
> Is WPA2 enabled?

 

Thanks, I've changed from WPA2 TKIP to WPA2 CCMP + TKIP and now I have 802.11n connection  :Smile: .

----------

## SysGhost

Sorry for this extreme necro bump, but there is a good reason for it. Besides this topic can still help people, as 802.11n on 2.4 GHz band is quite common even today, if not even more so.

Here's my findings as I searched for an answer on this very topic (This thread was among the top ones in my Google search) 

According to the manual for the dd-wrt router firmware:

 *Quote:*   

> 
> 
> With N-Mode you must use WPA2/AES.
> 
> 

 

Couldn't be simpler. I only had to change my security setting from my previous "WPA2/TKIP" to "WPA2/TKIP+AES" in order to enable 802.11n. (I need TKIP for some of my devices that refuce to work with AES. TKIP is optional, and is only needed by some older/odd devices. One can skip TKIP alltogether if no such devices is used in the network.)

After this all my 802.11n devices autmoatically switched over to N mode straight off the bat. Huge improvement.

----------

