# Wireless issues - iwl3945 and WPA2

## chidorex

Hi all.

I have been on this issue for several days already, and have not found anything else on the forums or docs that has helped me resolve this issue. The closest one has been this one: https://forums.gentoo.org/viewtopic-t-742322-highlight-3945abg+wpa2.html. However, mine does not seem to work.

My home network is configured using WPA2 Pre-shared key. I started out with wpa_supplicant, then tried with wicd. No luck.

I got my wireless drivers by executing the following:

```

# emerge -av iwl3945-ucode

```

Let me post some system info, as well as some of my config files.

```

# lspci | grep -i wireless

0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)

```

```

# dmesg | grep iwl

[   10.612455] iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, in-tree:s

[   10.612459] iwl3945: Copyright(c) 2003-2011 Intel Corporation

[   10.612537] iwl3945 0000:0c:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17

[   10.612553] iwl3945 0000:0c:00.0: setting latency timer to 64

[   10.668783] iwl3945 0000:0c:00.0: Tunable channels: 11 802.11bg, 13 802.11a channels

[   10.668787] iwl3945 0000:0c:00.0: Detected Intel Wireless WiFi Link 3945ABG

[   10.668947] iwl3945 0000:0c:00.0: irq 47 for MSI/MSI-X

[   10.895078] ieee80211 phy0: Selected rate control algorithm 'iwl-3945-rs'

[   18.153974] iwl3945 0000:0c:00.0: loaded firmware version 15.32.2.9

```

```

# cat /usr/src/linux/.config | grep 80211

CONFIG_CFG80211=m

# CONFIG_NL80211_TESTMODE is not set

# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set

# CONFIG_CFG80211_REG_DEBUG is not set

CONFIG_CFG80211_DEFAULT_PS=y

# CONFIG_CFG80211_DEBUGFS is not set

# CONFIG_CFG80211_INTERNAL_REGDB is not set

CONFIG_CFG80211_WEXT=y

CONFIG_LIB80211=m

# CONFIG_LIB80211_DEBUG is not set

CONFIG_MAC80211=m

CONFIG_MAC80211_HAS_RC=y

# CONFIG_MAC80211_RC_PID is not set

CONFIG_MAC80211_RC_MINSTREL=y

CONFIG_MAC80211_RC_MINSTREL_HT=y

CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y

CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"

# CONFIG_MAC80211_MESH is not set

CONFIG_MAC80211_LEDS=y

# CONFIG_MAC80211_DEBUGFS is not set

# CONFIG_MAC80211_DEBUG_MENU is not set

# CONFIG_MAC80211_HWSIM is not set

```

```

# cat /usr/src/linux/.config | grep -i iwl

CONFIG_IWLWIFI=m

# CONFIG_IWLWIFI_DEBUG is not set

# CONFIG_IWLWIFI_DEVICE_TRACING is not set

# CONFIG_IWLWIFI_DEVICE_SVTOOL is not set

CONFIG_IWLWIFI_LEGACY=m

# CONFIG_IWLWIFI_LEGACY_DEBUG is not set

# CONFIG_IWLWIFI_LEGACY_DEVICE_TRACING is not set

# CONFIG_IWL4965 is not set

CONFIG_IWL3945=m

```

```

# cat /usr/src/linux/.config | grep -i kill

CONFIG_RFKILL=m

CONFIG_RFKILL_LEDS=y

# CONFIG_RFKILL_INPUT is not set

# CONFIG_TOSHIBA_BT_RFKILL is not set

```

```

# lsmod

Module                  Size  Used by

arc4                     974  2 

iwl3945                40394  0 

iwl_legacy             36502  1 iwl3945

mac80211              141120  2 iwl3945,iwl_legacy

cfg80211              110180  3 iwl3945,iwl_legacy,mac80211

rfkill                  6630  1 cfg80211

```

```

# rc-update show

             bootmisc | boot                         

                devfs |                       sysinit

                dmesg |                       sysinit

                 fsck | boot                         

             hostname | boot                         

              hwclock | boot                         

              keymaps | boot                         

            killprocs |              shutdown        

                local |      default                 

           localmount | boot                         

              modules | boot                         

             mount-ro |              shutdown        

                 mtab | boot                         

               net.lo | boot                         

             netmount |      default                 

               procfs | boot                         

                 root | boot                         

            savecache |              shutdown        

                 sshd |      default                 

                 swap | boot                         

               sysctl | boot                         

            syslog-ng |      default                 

         termencoding | boot                         

                 udev |                       sysinit

       udev-postmount |      default                 

              urandom | boot                         

           vixie-cron |      default                 

                 wicd | boot                         

                  xdm |      default                 

```

```

# cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

#

# dns_domain_lo="homenetwork"

# nis_domain_lo="my-nisdomain"

modules="ifconfig"

config_eth0="dhcp"

dhcpcd_eth0="-t 10"

dhcp_eth0="release nodns nontp nonis"

dhcpcd_wlan0="-t 10"

dhcp_wlan0="release nodns nontp nonis"

#WPA_SUPPLICANT

modules="wpa_supplicant"

wpa_supplicant_wlan0="-Dwext"

config_wlan0="dhcp"

```

```

# cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=0

#update_config=1

network={

  ssid="<network_name>"

  psk="<key>"

  proto=WPA2

  key_mgmt=WPA-PSK

  pairwise=CCMP

  group=CCMP

  priority=5

}

```

```

# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:1c:23:ff:28:eb  

          inet addr:192.168.100.4  Bcast:192.168.100.255  Mask:255.255.255.0

          inet6 addr: fe80::21c:23ff:feff:28eb/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:555460 (542.4 KiB)  TX bytes:261996 (255.8 KiB)

          Interrupt:17 

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:294 errors:0 dropped:0 overruns:0 frame:0

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

          collisions:0 txqueuelen:0 

          RX bytes:19596 (19.1 KiB)  TX bytes:19596 (19.1 KiB)

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)

wlan0     Link encap:Ethernet  HWaddr 00:1f:3c:32:ee:df  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:8136 (7.9 KiB)  TX bytes:12164 (11.8 KiB)

```

```

# iwconfig

lo        no wireless extensions.

sit0      no wireless extensions.

wlan0     IEEE 802.11abg  ESSID:off/any  

          Mode:Managed  Frequency:2.422 GHz  Access Point: Not-Associated   

          Tx-Power=15 dBm   

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

          Encryption key:off

          Power Management:off

          

eth0      no wireless extensions.

```

Let me know if you need anything else for me to post. I'm going crazy here.

Thanks in advance.

----------

## Gusar

There's one piece of info you haven't provided - kernel version. While I'm not 100% sure, there's a possibility this is fixed in newer kernels, the latest is 3.4.3 currently.

Other useful pieces of info: the output of "rfkill list", as well as the output of whatever commands you used in trying to connect.

----------

## chidorex

Thanks Gusar.

 *Gusar wrote:*   

> There's one piece of info you haven't provided - kernel version. While I'm not 100% sure, there's a possibility this is fixed in newer kernels, the latest is 3.4.3 currently.

 

My kernel is supposed to be the latest. I started installation on june 12th, and downloaded that day's stage3, portage tree and gentoo-kernel

```
# uname -a

Linux elrond 3.2.12-gentoo #4 SMP Sun Jun 17 14:14:50 CDT 2012 i686 Intel(R) Core(TM)2 Duo CPU T5450 @ 1.66GHz GenuineIntel GNU/Linux
```

 *Quote:*   

> Other useful pieces of info: the output of "rfkill list"

 

Sorry. How do I get that?

 *Quote:*   

>  ...as well as the output of whatever commands you used in trying to connect.

 

I think I have tried several. Let me post some responses.

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

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...                                                     [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                            [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive
```

```
# dhcpcd wlan0

dhcpcd[5428]: version 5.2.12 starting

dhcpcd[5428]: wlan0: waiting for carrier

dhcpcd[5428]: timed out

dhcpcd[5428]: allowing 8 seconds for IPv4LL timeout

dhcpcd[5428]: timed out
```

This next one used to at least start the service without issues, but now I guess is overriden by wicd (??)

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

 * Starting WPA Supplicant Daemon ...

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.

 * start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'

 * Failed to start wpa_supplicant                                                             [ !! ]

 * ERROR: wpa_supplicant failed to start
```

I hope this helps.

Thanks again.

[EDIT]

I forgot to mention that when trying to connect to my wireless network using the wicd gui (using Xfce), I get a "bad pass" response. The latest wicd.log is:

```

2012/06/18 19:30:24 :: Connecting to wireless network <my_network>

2012/06/18 19:30:25 :: Putting interface down

2012/06/18 19:30:25 :: Releasing DHCP leases...

2012/06/18 19:30:25 :: Setting false IP...

2012/06/18 19:30:25 :: Stopping wpa_supplicant

2012/06/18 19:30:27 :: Flushing the routing table...

2012/06/18 19:30:27 :: Putting interface up...

2012/06/18 19:30:29 :: Generating psk...

2012/06/18 19:30:29 :: Attempting to authenticate...

2012/06/18 19:31:04 :: wpa_supplicant authentication may have failed.

2012/06/18 19:31:04 :: connect result is failed

2012/06/18 19:31:04 :: exiting connection thread

2012/06/18 19:31:04 :: Sending connection attempt result bad_pass

```

----------

## Etal

 *chidorex wrote:*   

>  *Quote:*   Other useful pieces of info: the output of "rfkill list" 
> 
> Sorry. How do I get that?

 

```
# emerge -av net-wireless/rfkill

...

# rfkill list
```

----------

## chidorex

OK. Never heard of this one. Hope it helps.

```
# rfkill list

0: phy0: Wireless LAN

   Soft blocked: no

   Hard blocked: no

```

----------

## Gusar

 *chidorex wrote:*   

> My kernel is supposed to be the latest.

 

Clearly it's not, when the latest is 3.4.3. This is a Gentoo problem though, I have no idea why it takes so long to mark kernels as stable. Even in the 3.2 series, 3.2.20 is the latest. 3.4.3 is in ~arch.

 *chidorex wrote:*   

> This next one used to at least start the service without issues, but now I guess is overriden by wicd (??)

 

Obviously you can't use two services to control wireless. So if you're connecting on the command-line, you need to shut down wicd. Which is something I'd very much recommend - to diagnose wireless connection issues, the best way is to use wpa_supplicant manually, with debug output. Which means not even the gentoo service (/etc/init.d/net.wlan0 start), but completely manually - something like

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

Once this tells you you're connected, you need to start dhcpcd. Only once there's a wireless connection, it makes no sense to start dhcpcd before that, because it's guaranteed it will fail.

Also, you're sure the network setting are correct, that you're using CCMP and CCMP only? You might want to test by simply removing that stuff from wpa_supplicant.conf, all you need in the network block is ssid and psk, wpa_supplicant can figure out the rest on it's own.

----------

## chidorex

 *Gusar wrote:*   

> Clearly it's not, when the latest is 3.4.3.

 

Completely right. (duh!)

 *Gusar wrote:*   

>  This is a Gentoo problem though, I have no idea why it takes so long to mark kernels as stable. Even in the 3.2 series, 3.2.20 is the latest. 3.4.3 is in ~arch.

 

Should I try to get a newer version from gentoo (~arch)? How can I do this?

Would you rather recommend getting the kernel sources from kernel.org instead? I guess the compiling process should be the same.

 *Gusar wrote:*   

>  *chidorex wrote:*   This next one used to at least start the service without issues, but now I guess is overriden by wicd (??) 
> 
> Obviously you can't use two services to control wireless. So if you're connecting on the command-line, you need to shut down wicd. Which is something I'd very much recommend - to diagnose wireless connection issues, the best way is to use wpa_supplicant manually, with debug output. Which means not even the gentoo service (/etc/init.d/net.wlan0 start), but completely manually - something like
> 
> ```
> ...

 

OK. I stopped the wicd service and removed it from rc-update. Also, I removed everything from my wpa_supplicant.conf file, except for the ssid, psk, and priority elements. Here is the output of the wpa_supplicant command you suggest:

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

Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'nl80211' 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='wheel'

ap_scan=0

Priority group 5

   id=0 ssid='<my_network>'

netlink: Operstate: linkmode=1, operstate=5

Own MAC address: 00:1f:3c:32:ee:df

wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=0x80a6945 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=0x80a6945 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=0x80a6945 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=0x80a6945 key_idx=3 set_tx=0 seq_len=0 key_len=0

RSN: flushing PMKID list in the driver

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=10 (from group name 'wheel')

Added interface wlan0

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

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Could not read SSID from driver.

EAPOL: disable timer tick

EAPOL: Supplicant port status: Unauthorized

```

The service just hangs there with no connection still. I stopped it by issuing a CTRL-C, getting the following:

```
CTRL-EVENT-TERMINATING - signal 2 received

Removing interface wlan0

No keys have been configured - skip key clearing

State: DISCONNECTED -> DISCONNECTED

wpa_driver_nl80211_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

No keys have been configured - skip key clearing

Cancelling scan request

Cancelling authentication timeout

netlink: Operstate: linkmode=0, operstate=6

```

Any ideas?

Thanks again.

----------

## Gusar

 *chidorex wrote:*   

> Should I try to get a newer version from gentoo (~arch)? How can I do this?

 

Read the documentation on how to keyword packages.

 *chidorex wrote:*   

> OK. I stopped the wicd service and removed it from rc-update. Also, I removed everything from my wpa_supplicant.conf file, except for the ssid, psk, and priority elements. Here is the output of the wpa_supplicant command you suggest:
> 
> <output here>

 

That output shows the error (I think  :Smile: ):

```
Could not read SSID from driver.
```

But what causes it and what the solution is, that I don't know. Google is your friend. Do try the ~arch kernel first, it might work.

----------

## Etal

```
-Dnl80211
```

Last time I used it it was not working right. Try using "-Dwext" instead.

----------

## Gusar

 *Etal wrote:*   

> 
> 
> ```
> -Dnl80211
> ```
> ...

 

That was a bug then. iwl4965 is a netlink driver. The only reason it even works with -Dwext is CONFIG_CFG80211_WEXT, which will be marked as deprecated soon (3.5 or 3.6 kernel). Most drivers nowadays are netlink, pretty much the only still used non-netlink driver is ipw2200.

----------

