# [SOLVED] wireless problem with Intel Centrino Wireless N 130

## jopeto

Hello,

I just installed Gentoo on my Samsung RV520 laptop which has an Intel Centrino Wireless N 130 chip:

```
01:00.0 Network controller: Intel Corporation Centrino Wireless-N 130 (rev 34)

        Subsystem: Intel Corporation Centrino Wireless-N 130 BGN

        Flags: bus master, fast devsel, latency 0, IRQ 44

        Memory at f0500000 (64-bit, non-prefetchable) [size=8K]

        Capabilities: [c8] Power Management version 3

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

        Capabilities: [e0] Express Endpoint, MSI 00

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [140] Device Serial Number b8-03-05-ff-ff-7a-cb-32

        Kernel driver in use: iwlwifi

        Kernel modules: iwlwifi

```

However, when I did iwconfig, I didn't get a wlan0 interface. I ran

```
# dmesg | grep iwlwifi
```

and discovered that  I didn't have firmware installed. So I found a similar thread describing this problem:

https://forums.gentoo.org/viewtopic-t-925694.html

I followed the advice given there and ran:

```
emerge iwl6030-ucode 

emerge -q linux-firmware
```

(the first without the -C flag, since I didn't have anything installed before.) When I ran the first command I got something like:

```
The following keyword changes are necessary to proceed:

#required by iwl6030-ucode (argument)

=net-wireless/iwl6030-ucode-18.168.6.1 ~amd64
```

So I ran the second command which installed fine. Then i ran the first one again and got this error:

```
 # emerge iwl6030-ucode

 * IMPORTANT: 3 news items need reading for repository 'gentoo'.

 * Use eselect news to read news items.

Calculating dependencies... done!

[ebuild  N    ~] net-wireless/iwl6030-ucode-18.168.6.1 

[blocks B      ] net-wireless/iwl6030-ucode ("net-wireless/iwl6030-ucode" is blocking sys-kernel/linux-firmware-20120502)

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  (net-wireless/iwl6030-ucode-18.168.6.1::gentoo, ebuild scheduled for merge) pulled in by

    iwl6030-ucode

  (sys-kernel/linux-firmware-20120502::gentoo, installed) pulled in by

    sys-kernel/linux-firmware required by @selected

For more information about Blocked Packages, please refer to the following

section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

The following keyword changes are necessary to proceed:

#required by iwl6030-ucode (argument)

=net-wireless/iwl6030-ucode-18.168.6.1 ~amd64

Use --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).
```

Is that something to worry about or can I assume that the firmware is installed now?

This is what I get to dmesg now:

```
# dmesg | grep iwlwifi

iwlwifi 0000:01:00.0: pci_resource_len = 0x00002000

iwlwifi 0000:01:00.0: pci_resource_base = ffffc9000007c000

iwlwifi 0000:01:00.0: HW Revision ID = 0x34

iwlwifi 0000:01:00.0: irq 44 for MSI/MSI-X

iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEBUG enabled

iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEBUGFS disabled

iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled

iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEVICE_TESTMODE disabled

iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_P2P disabled

iwlwifi 0000:01:00.0: Detected Intel(R) Centrino(R) Wireless-N 130 BGN, REV=0xB0

iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S

iwlwifi 0000:01:00.0: device EEPROM VER=0x716, CALIB=0x6

iwlwifi 0000:01:00.0: Device SKU: 0x150

iwlwifi 0000:01:00.0: Valid Tx ant: 0x1, Valid Rx ant: 0x3

iwlwifi 0000:01:00.0: Tunable channels: 13 802.11bg, 0 802.11a channels

iwlwifi 0000:01:00.0: loaded firmware version 18.168.6.1

iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S

iwlwifi 0000:01:00.0: Radio type=0x2-0x2-0x1

iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S

iwlwifi 0000:01:00.0: Radio type=0x2-0x2-0x1
```

So I'm assuming firmware is installed successfully?

However I still get this to iwconfig:

```
# iwconfig

lo        no wireless extensions.

wlan0     no wireless extensions.

eth0      no wireless extensions.
```

Here's the output of some more commands:

```
 # /etc/init.d//wpa_supplicant start

 * WARNING: wpa_supplicant has already been started
```

```
# wpa_supplicant -iwlan0 -d -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf

Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group='0'

ap_scan=1

Priority group 5

   id=0 ssid='wifimrezha'

WEXT: cfg80211-based driver detected

ioctl[SIOCSIWPMKSA]: Invalid argument

ioctl[SIOCSIWMODE]: Invalid argument

Could not configure driver to use managed mode

ioctl[SIOCGIWRANGE]: Invalid argument

ioctl[SIOCGIWMODE]: Invalid argument

ioctl[SIOCSIWAP]: Invalid argument

WEXT: Failed to clear to disconnect

netlink: Operstate: linkmode=1, operstate=5

WEXT: SIOCSIWAUTH(param 7 value 0x1) failed: Invalid argument)

Own MAC address: b8:03:05:7a:cb:32

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_countermeasures

WEXT: SIOCSIWAUTH(param 4 value 0x0) failed: Invalid argument)

RSN: flushing PMKID list in the driver

ioctl[SIOCSIWPMKSA]: Invalid argument

Setting scan request: 0 sec 100000 usec

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: Supplicant port status: Unauthorized

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: Supplicant port status: Unauthorized

EAPOL: Supplicant port status: Unauthorized

Using existing control interface directory.

ctrl_interface_group=0

ctrl_iface bind(PF_UNIX) failed: Address already in use

ctrl_iface exists and seems to be in use - cannot override it

Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore

Failed to initialize control interface '/var/run/wpa_supplicant'.

You may have another wpa_supplicant process already running or the file was

left by an unclean termination of wpa_supplicant in which case you will need

to manually remove this file before starting wpa_supplicant again.

Failed to add interface wlan0

No keys have been configured - skip key clearing

State: DISCONNECTED -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

netlink: Operstate: linkmode=-1, operstate=5

EAPOL: External notification - portEnabled=0

EAPOL: Supplicant port status: Unauthorized

EAPOL: External notification - portValid=0

EAPOL: Supplicant port status: Unauthorized

wpa_driver_wext_set_countermeasures

WEXT: SIOCSIWAUTH(param 4 value 0x0) failed: Invalid argument)

No keys have been configured - skip key clearing

Cancelling scan request

Cancelling authentication timeout

WEXT: SIOCSIWAUTH(param 7 value 0x0) failed: Invalid argument)

ioctl[SIOCGIWMODE]: Invalid argument

ioctl[SIOCSIWAP]: Invalid argument

WEXT: Failed to clear to disconnect

netlink: Operstate: linkmode=0, operstate=6
```

I'm stumped... Can someone help me how to proceed from here so that I can get my wireless working?

Thanks a lot.Last edited by jopeto on Wed Aug 01, 2012 7:41 am; edited 1 time in total

----------

## BillWho

jopeto

 *Quote:*   

> So I'm assuming firmware is installed successfully? 

 

Yes, it can be found at /lib/firmware

The error states ctrl_iface exists and seems to be in use - cannot override it 

Stop wlan0 or temporarily  remove it from the default runlevel, delete '/var/run/wpa_supplicant'  - then start it with  wpa_supplicant -iwlan0 -d -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf 

It seems that your problem is either with wpa_supplicant.conf or maybe a missing dependency   :Wink: 

----------

## jopeto

BillWho

Thanks a lot for your reply!

 *Quote:*   

>  *Quote:*   So I'm assuming firmware is installed successfully? 
> 
> Yes, it can be found at /lib/firmware

 

Yes you are right, there are a lot of iwlwifiXXXXX.ucode files there!

Actually it turned out that there is not file '/var/run/wpa_supplicant' so there was nothing the delete (maybe because I had rebooted since my last post). Now when I run wpa_supplicant -iwlan0 -d -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf I get this:

```
# wpa_supplicant -iwlan0 -d -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf

Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group='0'

ap_scan=1

Priority group 5

   id=0 ssid='wifimrezha'

WEXT: cfg80211-based driver detected

ioctl[SIOCSIWPMKSA]: Invalid argument

ioctl[SIOCSIWMODE]: Invalid argument

Could not configure driver to use managed mode

ioctl[SIOCGIWRANGE]: Invalid argument

ioctl[SIOCGIWMODE]: Invalid argument

ioctl[SIOCSIWAP]: Invalid argument

WEXT: Failed to clear to disconnect

netlink: Operstate: linkmode=1, operstate=5

WEXT: SIOCSIWAUTH(param 7 value 0x1) failed: Invalid argument)

Own MAC address: b8:03:05:7a:cb:32

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_countermeasures

WEXT: SIOCSIWAUTH(param 4 value 0x0) failed: Invalid argument)

RSN: flushing PMKID list in the driver

ioctl[SIOCSIWPMKSA]: Invalid argument

Setting scan request: 0 sec 100000 usec

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: Supplicant port status: Unauthorized

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: Supplicant port status: Unauthorized

EAPOL: Supplicant port status: Unauthorized

ctrl_interface_group=0

Added interface wlan0

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

State: DISCONNECTED -> SCANNING

Starting AP scan for wildcard SSID

ioctl[SIOCSIWSCAN]: Invalid argument

Scan requested (ret=-1) - scan timeout 5 seconds

Failed to initiate AP scan.

State: SCANNING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

netlink: Operstate: linkmode=-1, operstate=5

Setting scan request: 1 sec 0 usec

EAPOL: disable timer tick

EAPOL: Supplicant port status: Unauthorized

State: DISCONNECTED -> SCANNING

Starting AP scan for wildcard SSID

ioctl[SIOCSIWSCAN]: Invalid argument

Scan requested (ret=-1) - scan timeout 5 seconds

Failed to initiate AP scan.

State: SCANNING -> DISCONNECTED

```

And than it gets into an infinite loop with the following output:

```
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

netlink: Operstate: linkmode=-1, operstate=5

Setting scan request: 1 sec 0 usec

State: DISCONNECTED -> SCANNING

Starting AP scan for wildcard SSID

ioctl[SIOCSIWSCAN]: Invalid argument

Scan requested (ret=-1) - scan timeout 5 seconds

Failed to initiate AP scan.

State: SCANNING -> DISCONNECTED

```

I guess the error is "Could not configure driver to use managed mode" but how do I fix that?

Here's my wpa_supplicant.conf file:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

network={

  ssid="wifimrezha"

  psk="myconnectwifi"

  # The higher the priority the sooner we are matched

  priority=5

}

```

Any ideas?

----------

## BillWho

jopeto,

I don't know your router's configuration and if I'm not mistaken you have to match it's method of connection e.g. wpa, wpa2 etc.

Here's my section:

```
proto=WPA2

key_mgmt=WPA-PSK

pairwise=CCMP TKIP

group=CCMP TKIP 

```

In addition these messages Driver did not support SIOCSIWENCODEEXT  and ioctl[SIOCSIWENCODEEXT]: Invalid argument seem to be a different problem.

EAPOL: Supplicant port status: Unauthorized  seems to be related to key management.

iwlwifi depends on  mac80211, cfg80211 and rfkill

Check your depends with

```
for m in $(lsmod|grep ^iwl|awk '{print $1}');do echo -n "$m :";modinfo "$m"|grep depends:;done
```

The output for my adapter is:

```
rt2800usb :depends:        rt2x00lib,rt2800lib,rt2x00usb

rt2x00usb :depends:        rt2x00lib,mac80211

rt2800lib :depends:        mac80211,crc-ccitt,rt2x00lib

rt2x00lib :depends:        mac80211,cfg80211

```

Good luck   :Wink: 

----------

## jopeto

Thanks for your reply. When I run

```
for m in $(lsmod|grep ^iwl|awk '{print $1}');do echo -n "$m :";modinfo "$m"|grep depends:;done
```

I get nothing as an output. I guess the reason is that I have everything built into the kernel and not as modules.

I also emerged rfkill and added

```
proto=WPA2 

key_mgmt=WPA-PSK 

pairwise=TKIP
```

to my wpa_supplicant.conf. But I'm still getting the same error.

```

# iwconfig

lo        no wireless extensions.

wlan0     no wireless extensions.

eth0      no wireless extensions.
```

```

# ifconfig -a

eth0      Link encap:Ethernet  HWaddr e8:03:9a:a1:ee:80  

          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::ea03:9aff:fea1:ee80/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:675 errors:0 dropped:0 overruns:0 frame:0

          TX packets:642 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:402208 (392.7 KiB)  TX bytes:108056 (105.5 KiB)

          Interrupt:41 Base address:0x8000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr b8:03:05:7a:cb:32  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
```

Should I post my /usr/src/linux/.config file?

----------

## jopeto

I'm getting closer! I just found this link:

http://www.linuxquestions.org/questions/linux-wireless-networking-41/wlan0-no-wireless-extension-907830/

It suggests enabling Networking Support->Wireless->cfg80211 wireless extensions compatibility in the kernel configuration and recompiling the kernel. I just did it and now after running

```
wpa_supplicant -iwlan0 -d -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf
```

I get

```
# iwconfig 

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"wifimrezha"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 38:22:9D:9B:90:C6   

          Bit Rate=1 Mb/s   Tx-Power=15 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=69/70  Signal level=-41 dBm  

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

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

```

Wireless is still now working, but I thought I'd post this update in case someone is working on a solution. I guess from now it should be a question of tweaking things...

----------

## Gusar

You should be using -Dnl80211 because iwlwifi is a netlink driver. That way you don't need the wireless extensions compatibility, which will go away at some point in the future.

----------

## BillWho

jopeto,

That looks a lot better   :Very Happy: 

 *Quote:*   

> It suggests enabling Networking Support->Wireless->cfg80211

 

That's what I was trying to point out to you with  *Quote:*   

> iwlwifi depends on mac80211, cfg80211 and rfkill 

  with my previous post.

wpa_supplicant.conf is sometimes a little trial and error with all the possible settings, but it looks like you're well on your way to wireless   :Very Happy: 

Good luck   :Wink: 

----------

## jopeto

Thanks to both of you. I finally got my wireless running, but I still have one small problem.

When I boot up, dhcpcd says that it looks for a carrier and it times out, so when I log on I have no internet access. Then if I run

```
# /etc/init.d/net.wlan0 start
```

the wireless connects and I can get on the internet. So how do I make this process automated so I don't have to wait an additional ~30sec at boot time for the time out and don't have to run the above command manually?

If it would be of any help, here's my 

```
dns_domain_lo="homenetwork"

config_eth0="dhcp"

modules="wpa_supplicant"

config_wlan0="dhcp"

wpa_cli_wlan0="-G3600"

wpa_supplicant_wlan0="-D nl80211"
```

Gusar, I assume this is the -Dnl80211 you were referring to? I got the rest from this website:

http://en.gentoo-wiki.com/wiki/Iwlwifi

Thanks once again!

----------

## jopeto

```
rc-update add net.wlan0 default
```

 did the job!

It looks like I'm all set!  :Smile: 

Thank you guys so much!

----------

