# [SOLVED] iwlwifi/iwl4965 can't associate with AP

## ab3ap

My ~x86 associated fine with my AP yesterday but won't today:

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

 * Starting wlan0

 *   Running preup function

 *   Configuring wireless network for wlan0

 *   Failed to configure wireless for wlan0                                                                                                     [ !! ]

```

And from the /var/log/messages file:

```
Dec 28 17:04:12 hamshack rc-scripts: Failed to configure wireless for wlan0

Dec 28 17:04:12 hamshack wlan0: Initial auth_alg=0

Dec 28 17:04:12 hamshack wlan0: authenticate with AP 00:16:b6:67:66:49

Dec 28 17:04:12 hamshack wlan0: Initial auth_alg=0

Dec 28 17:04:12 hamshack wlan0: authenticate with AP 00:16:b6:67:66:49

Dec 28 17:04:12 hamshack wlan0: RX authentication from 00:16:b6:67:66:49 (alg=0 transaction=2 status=0)

Dec 28 17:04:12 hamshack wlan0: authenticated

Dec 28 17:04:12 hamshack wlan0: associate with AP 00:16:b6:67:66:49

Dec 28 17:04:12 hamshack wlan0: authentication frame received from 00:16:b6:67:66:49, but not in authenticate state - ignored

hamshack mm # 
```

I'm using WEP (since AP must associate with other devices that only support WEP unfortunately) and have these modules loaded:

```
hamshack mm # lsmod

Module                  Size  Used by

ieee80211_crypt_wep     4352  0 

ieee80211_crypt         4864  1 ieee80211_crypt_wep

iwl3945               151028  0 

snd_seq_oss            29056  0 

snd_seq_midi_event      4736  1 snd_seq_oss

snd_seq                40784  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          5516  2 snd_seq_oss,snd_seq

snd_pcm_oss            32928  0 

snd_mixer_oss          12800  1 snd_pcm_oss

snd_hda_intel         244256  0 

snd_pcm                56964  2 snd_pcm_oss,snd_hda_intel

snd_timer              15876  2 snd_seq,snd_pcm

snd_page_alloc          6664  2 snd_hda_intel,snd_pcm

snd_hwdep               6148  1 snd_hda_intel

snd                    36324  9 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep

iwl4965               175220  0 

nvidia               6212560  26 

mac80211              125188  2 iwl3945,iwl4965

cfg80211                5640  1 mac80211

soundcore               6112  1 snd

```

Day before yesterday new iwl4965-ucode came out, but yesterday after booting the laptop I had no problems.  Today, it just ignores the association frames.  I've been playing around with my /etc/conf.d/net:

```
hamshack mm # cat /etc/conf.d/net

# Ethernet interface.

config_eth0=("dhcp");

# Wireless interface.

preup() {

     if [[ ${IFACE} = "wlan0" ]]; then

             modprobe iwl3945

             modprobe ieee80211_crypt_wep

             # rm $(modprobe -l rc80211_*)

             # Needs a little time before it's usable!

             sleep 3

     fi

     return 0

} 

mode_wlan0="auto"

depend_wlan0() {

        need ipw3945d

}

preferred_aps_wlan0=("----")

modules_wlan0=("iwconfig")

mode_wlan0="managed"

dhcpcd_wlan0="-t 120"

essid_wlan0="----"

key_----="----"

config_wlan0=("dhcp")

hamshack mm # 

```

where I've crossed out essid and key.  Any and all ideas greatly appreciated.  Thanks!

MikeLast edited by ab3ap on Sat Dec 29, 2007 3:23 pm; edited 1 time in total

----------

## ltboy

Ok, first, pick a driver Either iwl3945 OR iwl4965. You only need the one that is the same as your card unmerge the other one.

Don't use ipw3945 for anything. I see it referenced in your config. If it is installed uninstall it.

Finally, iwl/ipw cards are touchy. With manual config they drop out all the time in linux. I know, I have the 3945. Fortunately, great strides have been made by the NetworkManager team. It now works great with these cards. Just as a heads up though, as far as system tray icon/managers for this go, the knetworkmanager one is buggy. Use nm-applet to get an easy configuration interface.

----------

## ab3ap

Thanks very much!  That fixed it.  I unmerged ipw3945.  A "modprobe -r iwl3945" got rid of the module, but I still couldn't associate.  After a reboot, though, all is well and I'm posting via my restored wireless connection.   :Smile:   I still don't understand yet why it worked for so long, but the important thing is the box is back on the net.

My original mistake was when following the howto at 

```
http://gentoo-wiki.com/HARDWARE_ipw3945
```

 that I simply followed it in sequence without thinking through what mods would be needed when using a 4965.  Since it's clearly aimed at the 3945 I suppose I got what I deserved...  Thanks again!

Mike

----------

## Suicidal

 *ltboy wrote:*   

> Ok, first, pick a driver Either iwl3945 OR iwl4965. You only need the one that is the same as your card unmerge the other one.
> 
> Don't use ipw3945 for anything. I see it referenced in your config. If it is installed uninstall it.
> 
> Finally, iwl/ipw cards are touchy. With manual config they drop out all the time in linux. I know, I have the 3945. Fortunately, great strides have been made by the NetworkManager team. It now works great with these cards. Just as a heads up though, as far as system tray icon/managers for this go, the knetworkmanager one is buggy. Use nm-applet to get an easy configuration interface.

 

Same conclusion I came to, I had an issue with my 3945 card ignoring configurations and associating with my neighbors unencrypted AP. nm-applet works perfectly every time.

Until the driver gets better this looks like the best solution. I would prefer something that would play nicely with the Gentoo init scripts though.

----------

## ltboy

I think my only beef is that, as of yet, NetworkManger initscript doesn't count as a network interface so, without telling everything to ignore network connectivity the system tries to start net.eth0,net.wlan0,etc... I much prefer network manager though to the old way of handling network config. Now, if only they'll add a port-through feature to NM so I can pass my network on to another device via the ethernet port, (i.e. an XBox or similar...) without having to tinker with all the config files manually.

Oh, and I think I may have spoken too soon on knetworkmanager. The ebuild was updated earlier this month and the new ebuild(0.2.1_pre20071119-r1... yeah I know that says November, but the ebuild wasn't updated until partway through Dec.) seems to work great.

----------

