# iwl4965 and wpa_supplicant

## choogi

Hi all,

Been poking around for a while--first time poster!

Anyways, i just bought a new X61s on labor day and got the 4965abgn wireless card.  I downloaded/installed the Intel drivers (iwl4965-ucode and iwlwifi) and can it get to connect to my school's WEP secured network manual via:

```
ifconfig wlan0 up

iwconfig wlan0 essid ... key ... yadayadayada

dhcpcd wlan0
```

But I want to be able to use wpa for my personal network.  This is the current contents of my wpa_supplicant.conf file:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

network={

   ssid="..."

   key_mgmt=NONE

   wep_key0=...

   wep_tx_keyidx=0

   priority=1

}

```

But when I use the following command to start wpa_supplicant

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

All I get are the following errors:

```

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' (DEPRECATED)

ap_scan=1

Priority group 1

   id=0 ssid='UNC-1'

Initializing interface (2) 'wlan0'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:13:e8:a2:ab:df

wpa_driver_wext_set_wpa

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

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

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

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

wpa_driver_wext_set_countermeasures

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - wpa_driver_wext_set_drop_unencrypted

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 5 value 0x1 - Setting scan request: 0 sec 100000 usec

ctrl_interface_group=0

Added interface wlan0

RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()

Wireless event: cmd=0x8b06 len=8

Ignore event for foreign ifindex 4

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

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

Trying to get current scan results first without requesting a new scan to speed up initial association

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1

No suitable AP found.

Setting scan request: 0 sec 0 usec

Starting AP scan (broadcast SSID)

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

Wireless event: cmd=0x8b19 len=8

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1

No suitable AP found.

Setting scan request: 5 sec 0 usec

Starting AP scan (broadcast SSID)

CTRL-EVENT-TERMINATING - signal 2 received

Removing interface wlan0

State: SCANNING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

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

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

wpa_driver_wext_set_wpa

wpa_driver_wext_set_drop_unencrypted

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 5 value 0x0 - wpa_driver_wext_set_countermeasures

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - No keys have been configured - skip key clearing

Cancelling scan request

Cancelling authentication timeout

WEXT: Operstate: linkmode=0, operstate=6

```

And then I have to ctrl+c to exit out otherwise it just runs on like that forever. I still haven't tried connecting to wpa but if wep doesn't work I don't expect wpa to work either.

Any ideas as to what I'm doing wrong?  Am I using the right driver for wpa_supplicant (wext)? I saw some people with the older card were able to set their driver to ipw3945 but I've already tried iwl4965 and iwlwifi and neither works.  I've been working on this for a while now and still haven't been able to get it working.  Any help is greatly appreciated! Thanks!

----------

## barophobia

here is how i get my ipw4965 up.

```

wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B

dhcpcd wlan0

```

wpa_supplicant.conf

```

network={

            essid = "essid"

            psk="god"

            priority=5

}

```

good luck.

----------

## choogi

What drivers are you using for that? What's ipw4965? I was only able to find iwl4965

----------

## barophobia

module: iwl4965 

net-wireless/iwl4965-ucode  4.44.1.18

net-wireless/iwlwifi 1.1.17

laptop: lenovo x61s

----------

## choogi

When I tried that piece of code I get the following:

```
ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 5 value 0x1 - 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.

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 5 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 -
```

Did you have to unmask those packages to install?  I downloaded the drivers from the website.  I'll try that now.

----------

## quantumsummers

Hello,

I have the same wireless NIC (intel 4965) in my Asus G2S-A1.  I have found that using the NetworkManager package has solved many issues I was experiencing when I attempted to use multiply WIFI APs.  If you run KDE, use KNetworkManager in addition to the NetworkManager daemon.  Now I can connect to WPA, WPA2, WEP, and unsecured networks with ease.  (K)NetworkManager even takes care of scanning for APs so you can see them using the tray applet.  Pretty sweet, and I have had 0 issues with this setup.

Best Wishes,

QuantumSummers

As an after thought, try this as well, from Gentoo-Wiki:

At startup you must make sure that the mac80211 ratescaling modules do not get loaded. You do not need them for iwlwifi and they interfere with it. I just delete them.

rm $(modprobe -l rc80211_*)

This will "force" mac80211 to use the iwlwifi specific rate scaling algorithm. This is why you can't build mac80211 in the kernel. 

See these pages:

http://gentoo-wiki.com/HARDWARE_ipw3945  Particularly this one, the section on iwlwifi.

http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

----------

## barophobia

 *choogi wrote:*   

> When I tried that piece of code I get the following:
> 
> ```
> ioctl[SIOCSIWAUTH]: Operation not supported
> 
> ...

 

The ioctl[...]... Operation ... and WEXT... stuff you can ignore.  And it would work fine

The complaint about '/var/run/wpa.../wlan0' might be from a running wpa_supplicant or one that died before it could remove it.  Check to see if a wpa_supplicant process is running in the background.  The command I use tells it to fork to the background.  If so kill that process.

You might want to unmask the wireless-tools package too.

----------

## choogi

Okaayy, hold on.  I uninstalled the iwlwifi drivers I downloaded from the intel site and reinstalled it via portage.  Now I lsmod and I see:

```
iwl4965               183912  0 

mac80211              132488  1 iwl4965

cfg80211                9352  1 mac80211

```

but my network card is not being recognized. I keep getting the "unknown interface: No such device" error.  Do I need to start the other modules (ie cryptomgr, ecb, arc4, aes, crypto_algapi, blkcipher, iwl4965) manually via modules.autoload.d or is there a cleaner fix?

EDIT: also, just as a side note, do i need to get /etc/init.d/net.wlan0 working? it's not detecting the device right now. it's always been a pain in the butt having to type "ifconfig wlan0 up" each time i loaded up

----------

## quantumsummers

If you don't like the init script method see my previous post regarding NetworkManager.

In /etc/modules.autoload.d/kernel-2.6 I load the following modules related to iwl4965:

mac80211

iwl4965

ieee80211_crypt_wep

ieee80211_crypt_tkip

ieee80211_crypt_ccmp

As well for wireless make sure to delete /lib/modules/<your kernel version>/kernel/net/mac80211/rc80211_simple.ko

Read the Gentoo-Wiki pages I posted as well as the official Gentoo documentation.

Regards,

QuantumSummers

----------

## barophobia

 *choogi wrote:*   

> 
> 
> EDIT: also, just as a side note, do i need to get /etc/init.d/net.wlan0 working? it's not detecting the device right now. it's always been a pain in the butt having to type "ifconfig wlan0 up" each time i loaded up

 

output of iwconfig, ifconfig -a

output of lspci but only lines with intel in them.

I don't use net.wlan0 but that is because I do not know which network i am going to be on lan, or a number of wifi ap or no network.  I really don't want the wifi trying to associate when not needed nor dhcpcd going for a ip address when there is no physical connection.

----------

## choogi

iwconfig

```
eth0      no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

```

ifconfig -a

```

eth0      Link encap:Ethernet  HWaddr 00:16:D3:CA:17:50  

          inet addr:192.168.1.6  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::216:d3ff:feca:1750/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:100 

          RX bytes:220960 (215.7 Kb)  TX bytes:31047 (30.3 Kb)

          Base address:0x1840 Memory:f8200000-f8220000 

lo        Link encap:Local Loopback  

          LOOPBACK  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)

sit0      Link encap:IPv6-in-IPv4  

          NOARP  MTU:1480  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)

```

lspci

```

00:00.0 Host bridge: Intel Corporation Mobile Memory Controller Hub (rev 0c)

00:02.0 VGA compatible controller: Intel Corporation Mobile Integrated Graphics Controller (rev 0c)

00:02.1 Display controller: Intel Corporation Mobile Integrated Graphics Controller (rev 0c)

00:19.0 Ethernet controller: Intel Corporation Unknown device 1049 (rev 03)

00:1a.0 USB Controller: Intel Corporation USB UHCI Controller #4 (rev 03)

00:1a.1 USB Controller: Intel Corporation USB UHCI Controller #5 (rev 03)

00:1a.7 USB Controller: Intel Corporation USB2 EHCI Controller #2 (rev 03)

00:1b.0 Audio device: Intel Corporation HD Audio Controller (rev 03)

00:1c.0 PCI bridge: Intel Corporation PCI Express Port 1 (rev 03)

00:1c.1 PCI bridge: Intel Corporation PCI Express Port 2 (rev 03)

00:1d.0 USB Controller: Intel Corporation USB UHCI Controller #1 (rev 03)

00:1d.1 USB Controller: Intel Corporation USB UHCI Controller #2 (rev 03)

00:1d.7 USB Controller: Intel Corporation USB2 EHCI Controller #1 (rev 03)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)

00:1f.0 ISA bridge: Intel Corporation Mobile LPC Interface Controller (rev 03)

00:1f.1 IDE interface: Intel Corporation Mobile IDE Controller (rev 03)

00:1f.2 SATA controller: Intel Corporation Mobile SATA Controller AHCI (rev 03)

00:1f.3 SMBus: Intel Corporation SMBus Controller (rev 03)

03:00.0 Network controller: Intel Corporation Unknown device 4230 (rev 61)

05:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)

05:00.1 FireWire (IEEE 1394): Ricoh Co Ltd Unknown device 0832 (rev 04)

05:00.2 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)

```

Yes I know, my lspci is very very helpful.

When I try to "ifconfig wlan0 up" I get

```
wlan0: unknown interface: No such device
```

Did you have the same problem when you were configuring your x61s?

----------

## barophobia

No it said everything you need to know.

Why does it complain that wlan0 does not exist?  It does not exist.

If you read the output you would know that the iwl4965 is not providing with a wireless nic.

There might be numerous reasons for this.  You alluded to how you downloaded and manually installed a iwl4965 module instead of using the one in portage.  Did you really remove it?  Might want to compile a brand new kernel make it a different version just so we are sure that the old modules are not affecting you.  

You might also want to check the kernel logs you might have.  Look for lines with iwl in it.

i have the following stuff from portage installed

iwl4965-ucode-4.44.17

iwlwifi-1.1.17

wireless-tools-29

use flags for iwlwifi : ipw4965, kernel-linux

you should never ever blindly type in commands you cut and paste as root without first understanding what it is doing.

----------

## quantumsummers

or try:

modprobe -r iwl4965 && modprobe -r ieee80211 && modprobe ieee80211 && modprobe iwl4965

remove the modules (old) and then insert the new.

----------

## choogi

I ended up reinstalling gentoo on x61s because a smorgasbord of problems popped up that i couldn't figure out. It was one of my first installs so I did a pretty shoddy job.  Anyways, almost everything seems to be alright now except the wireless is still causing me difficulties.  I've emerged iwlwifi and iwl4965-ucode.  I can modprobe iwl4965 and it gets added to my lsmod but I still get the "no such device" error message when I try "ifconfig wlan0 up"

This is the output of my dmesg after I modprobe iwl4965:

```

iwl4965: Intel(R) Wireless WiFi Link 4965AGN driver for Linux, 1.1.17ds

iwl4965: Copyright(c) 2003-2007 Intel Corporation

ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 19

PCI: Setting latency timer of device 0000:03:00.0 to 64

iwl4965: Detected Intel Wireless WiFi Link 4965AGN

iwl4965: Tunable channels: 11 802.11bg, 13 802.11a channels

wmaster0: Selected rate control algorithm 'iwl-4965-rs'

wmaster0: Failed to initialize wep

iwl4965: Failed to register network device (error -12)

```

I also tried the stuff with network-manager but it didn't work either. I'd really rather jus thave wpa_supplicant working without network-manager if that's possible.

----------

## barophobia

 *choogi wrote:*   

> I can modprobe iwl4965 and it gets added to my lsmod but I still get the "no such device" error message when I try "ifconfig wlan0 up"
> 
> 

 

The name of the interface might not be wlan0.  Do a ifconfig -a or iwconfig to find what name it is assigned.

----------

## choogi

I don't get anything from either of those:

iwconfig

```
eth0      no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

```

ifconfig -a

```
eth0      Link encap:Ethernet  HWaddr 00:16:D3:CA:17:50  

          inet addr:152.2.24.41  Bcast:152.2.24.255  Mask:255.255.255.0

          inet6 addr: fe80::216:d3ff:feca:1750/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:100 

          RX bytes:2318459 (2.2 Mb)  TX bytes:213365 (208.3 Kb)

          Base address:0x1840 Memory:f8200000-f8220000 

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)

sit0      Link encap:IPv6-in-IPv4  

          NOARP  MTU:1480  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)

```

It doesn't seem like anything is getting detected.

----------

