# ipw3945 and WPA-PSK

## krolden

For the past few days I have been trying to get my Wireless internet to work, but so far I have been unsuccesful in doing so.

I have set my AP to use WPA-Personal with PSK and TKIP as its encryption.

The wireless card uses ipw3945.  All needed modules (as far as I know) are installed.  Ipw3945d is running.

/etc/conf.d/net settings:

```
config_eth1=( "dhcp" )

modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

wpa_timeout_eth1=60
```

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

update_config=0

fast_reauth=1

network={

        ssid="ssidhere"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP

        psk="keyhere"

        priority=5

        }
```

When running /etc/init.d/net.eth1 start, I get the following error.

```
* Starting eth1

 *   Starting wpa_supplicant on eth1 ...

ioctl[SIOCSIWMODE]: Resource temporarily unavailable

Could not configure driver to use managed mode

ioctl[SIOCGIWRANGE]: Resource temporarily unavailable

ioctl[SIOCSIWAUTH]: Resource temporarily unavailable

WEXT auth param 7 value 0x1 - ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWAUTH]: Resource temporarily unavailable

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Resource temporarily unavailable  [ ok ]th param 5 value 0x1 -

 *   Starting wpa_cli on eth1 ...                                         [ ok ] *     Backgrounding ...

```

kernel:

```
Linux giri 2.6.17-gentoo-r8 #1 SMP PREEMPT
```

Any help would be much appreciated.  :Smile: 

----------

## krolden

bump

----------

## madisonicus

Are there any errors being reported by wpa_cli?

----------

## krolden

```
yume ~ # wpa_supplicant -c /etc/wpa_supplicant.conf -i eth1 -B

ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported

Failed to set encryption.

ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported

Failed to set encryption.

ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported

Failed to set encryption.

ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported

Failed to set encryption.
```

When recompiling ipw3945 with debug support, I got these warnings when building.

```
WARNING: "ieee80211_wx_get_encodeext" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_wx_set_encodeext" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_wx_get_encode" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_wx_set_encode" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_wx_get_scan" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_freq_to_channel" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_set_geo" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_get_channel" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_rx_mgt" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_rx" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_get_channel_flags" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_get_geo" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_channel_to_index" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_tx_frame" [/var/ipw3945/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_is_valid_channel" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "escape_essid" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "ieee80211_txb_free" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "alloc_ieee80211" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!

WARNING: "free_ieee80211" [/var/tmp/portage/ipw3945-1.1.0-r1/work/ipw3945-1.1.0/ipw3945.ko] undefined!
```

Although unsure, I think that is referring to the fact that I didn't build ieee80211 support in the kernel, but these are normally loaded by bootup

/etc/modules.autoload.d/kernel-2.6

```
ieee80211_crypt_wep

ieee80211_crypt_tkip

ieee80211_crypt_ccmp
```

Compiling with debug support doesn't give any more information.  However I believe it is a basic problem, since using WEP also gives me these errors.

----------

## madisonicus

I'm not an expert on this stuff by any means, so just trying to help you find some possible places to start.

 *Quote:*   

> ioctl[PRISM2_IOCTL_HOSTAPD]: Operation not supported 

 

That really perplexes me.  Why would it be looking at prism2 or hostapd if you're using ipw3945 and wext?

I believe the "Resource temporarily unavailable" errors are due to the card's not being fully up yet, and so nothing to worry about.  wpa_supplicant does eventually start right?

You did run 

```
/bin/sh /usr/portage/net-wireless/ieee80211/files/remove-old /usr/src/linux 
```

 before installing ieee80211, right?

Does it work without encryption?

----------

## krolden

To the best of my knowledge I did run that command before emerging ieee80211

I did do it again though, just to be sure, but to no avail.

I keep on getting these errors when running /etc/init.d/net.eth1 start.  Interestingly enough if I run wpa_supplicant I get no error messages, but neither do I get an IP.

```
yume src # wpa_supplicant -Dwext -i eth1 -B -c/etc/wpa_supplicant.conf -dd

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

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

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group='wheel' (DEPRECATED)

update_config=0

fast_reauth=1

Line: 6 - start of a new network block

ssid - hexdump_ascii(len=16):

     6c 69 6e 6b 73 79 73 5f 53 45 53 5f 35 38 36 30   linksys_SES_5860

scan_ssid=1 (0x1)

proto: 0x1

key_mgmt: 0x2

pairwise: 0x8

group: 0x8

PSK (ASCII passphrase) - hexdump_ascii(len=16): [REMOVED]

priority=5 (0x5)

PSK (from passphrase) - hexdump(len=32): [REMOVED]

Priority group 5

   id=0 ssid='linksys_SES_5860'

Initializing interface (2) 'eth1'

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)=20 WE(source)=16 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:13:02:bf:26:6c

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

wpa_driver_wext_set_drop_unencrypted

Setting scan request: 0 sec 100000 usec

Using existing control interface directory.

ctrl_interface_group=10 (from group name 'wheel')

Added interface eth1

Daemonize..
```

----------

## Brooske

I have the same error, but I have a temporary fix for it, so read on  :Smile: 

First my output:

```

# /etc/init.d/net.eth1 start

 * Starting eth1

 *   Loading networking modules for eth1

 *     modules: apipa arping ccwgroup macchanger macnet rename wpa_supplicant essidnet iptunnel ifconfig system dhcpcd ip6to4

 *       wpa_supplicant provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Configuring eth1 for MAC address 00:13:CE:8A:95:44 ...                                                       [ ok ] 

 *   Wireless radio has been killed for interface eth1

 *   wpa_supplicant will launch, but not associate until

 *   wireles radio is re-enabled for interface eth1

 *   Starting wpa_supplicant on eth1 ...

ioctl[SIOCSIWMODE]: Resource temporarily unavailable

ioctl[SIOCGIWRANGE]: Resource temporarily unavailable

ioctl[SIOCSIWAUTH]: Resource temporarily unavailable

WEXT auth param 7 value 0x1 - ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWAUTH]: Resource temporarily unavailable

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Resource temporarily unavailable  [ ok ]th param 5 value 0x1 -

 *   Starting wpa_cli on eth1 ...                                                                                 [ ok ] 

 *     Waiting for association                                                                                    [ ok ] 

 *     Backgrounding ...

```

Now my temp fix:

```

# /etc/init.d/net.eth1 start

*** errors etc ***

# killall wpa_supplicant

# killall wpa_cli

# killall dhcpcd (if any running)

# wpa_supplicant -Dwext -i eth1 -c /etc/wpa_supplicant/wpa_supplicant.conf   (start manually)

- if OK, put into background -> ctrl+Z

  # bg

- If not OK, kill and try again

# dhcpcd eth1

```

If this doesn't work, try stopping the ipw3945d script, rmmod ipw3945, modprobe ipw3945, start ipw3945d script, and then exec the commands above (including killing wpa_supplicant and wpa_cli, cause depending on your settings they'll start when loading the ipw3945 module)

Seems to me the interface isn't ready indeed...  Is there any place in the init-script or config files where we should config a delay or something like that ?

I noticed that when I boot, the interface works right on. But I don't want it to automatically start, and normally put  RC_PLUG_SERVICES="!net.*" in /etc/conf.d/rc.

Only the automatic start by the udev_runscript-thingie works, but in both cases a restart of the interface goes wrong. (and I don't know anything about udev and hotplug, so I can't debug this properly...)

Steven

----------

## Brooske

Filed a bug for this:  https://bugs.gentoo.org/show_bug.cgi?id=155330

Steven

----------

