# [SOLVED] Problems switching to iwl3945

## torf

After upgrading to 2.6.25 I'm now trying to get iwl3945 working as a replacement for ipw3945. But somehow nothing works...

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

 * Starting wlan0

 *   Running preup function                                                                                                                                                                                                       [ ok ]

 *   Starting wpa_supplicant on wlan0 ...

ioctl[IEEE80211_IOCTL_SETPARAM]: Operation not supported

Failed to initialize driver interface

```

I've been googling, etc. for the error above, but didn't find anything useful. I'm running a Thinkpad T60 which has a Intel PRO/Wireless 3945ABG Mini-PCI Express Adapter. 

The necessary kernel options mentioned in the gentoo-wiki article are enabled. 

The hardware wlan kill-switch of my Thinkpad is in the "wlan active" position

Here's some more info:

```
# grep -v "^#" /etc/conf.d/net

config_eth0=( "dhcp" )

dhcp_eth0="-t 120"

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dmadwifi"

associate_timeout_wlan0=60

config_wlan0=( "dhcp" )

dhcp_wlan0="-t 120"

preup() {

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

                sleep 3

        fi

        return 0

}

config_ppp0=( "ppp" )

link_ppp0="eth0"                # PPPoE requires an ethernet interface

plugins_ppp0=(

        "pppoe"                         # Required plugin for PPPoE

)

username_ppp0='...'

password_ppp0='...'

pppd_ppp0=(

        "updetach"      # If not set, "/etc/init.d/net.ppp0 start" will return

        "debug"         # Enables syslog debugging

        "defaultroute"  # Make this PPP interface the default route

        "usepeerdns"    # Use the DNS settings provided by PPP

)

```

```
# grep -v "^#" /etc/wpa_supplicant/wpa_supplicant.conf 

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

update_config=0

fast_reauth=1

network={

        ssid="..."

        key_mgmt=WPA-PSK

        psk="..."

        priority=1000

}

network={

        key_mgmt=NONE

        priority=-9999

}

```

```
# iwconfig 

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

irda0     no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11g  ESSID:""  

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

          Tx-Power=27 dBm   

          Retry min limit:7   RTS thr:off   Fragment thr=2352 B   

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

BTW: Does anyone know how to get rid of all these entries that the new driver introduced besides wlan0?

```
# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:1a:6b:67:d6:51  

          inet addr:192.168.2.109  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::21a:6bff:fe67:d651/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:100 

          RX bytes:1143387 (1.0 MiB)  TX bytes:296947 (289.9 KiB)

irda0     Link encap:IrLAP  HWaddr 00:00:00:00  

          NOARP  MTU:2048  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:8 

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

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

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

          collisions:0 txqueuelen:0 

          RX bytes:6020 (5.8 KiB)  TX bytes:6020 (5.8 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:1b:77:2e:2f:2d  

          BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:44136 (43.1 KiB)  TX bytes:40553 (39.6 KiB)

wmaster0  Link encap:UNSPEC  HWaddr 00-1B-77-2E-2F-2D-65-74-00-00-00-00-00-00-00-00  

          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)

```

```
# cat /etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x8086:0x109a (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:6b:67:d6:51", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x4227 (iwl3945)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:77:2e:2f:2d", ATTR{type}=="801", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x4227 (iwl3945)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:77:2e:2f:2d", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

```

Software versions:net-wireless/ipw3945-ucode: 1.14.2net-wireless/wpa_supplicant: 0.5.7net-wireless/madwifi-ng: 0.9.4net-wireless/madwifi-ng-tools: 0.9.4

Any pointers on this are greatly appreciated!Last edited by torf on Wed Nov 12, 2008 2:29 pm; edited 2 times in total

----------

## aidanjt

You don't use madwifi, change wpa_supplicant_wlan0 in /etc/conf.d/net to wpa_supplicant_wlan0=("-Dwext").

----------

## defenderBG

dont post your password and user name...

I think the problem is the same as AidanJT suggested.

----------

## torf

 *defenderBG wrote:*   

> dont post your password and user name...

 

Thanks for the hint,  must be getting too old  :Shocked: 

Using wext instead of madwifi helped somewhat: After booting, both the wired eth0 and the wireless wlan0 are up and wlan0 is connected to my ap. Still there are some problems, though:

Bringing up wlan0 at boot time takes ages (especially the " Starting wpa_cli on wlan0 ... " part). I have a 120s timeout set, so I wouldn't be surprised if it just wouldn't connect and time out, but after booting it is connectedIf I bring down eth0 and keep wlan0 up I lose my Internet connection (ping tells me "Network is unreachable" if I try to ping some outside IP-addresses). I'm not sure if this is a routing problem, i.e. if I have to switch to wlan0 somehow.

```
# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

loopback        *               255.0.0.0       U     0      0        0 lo

```

If I restart wlan0 manually, it won't connect anymore:

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

 * Starting wlan0

 *   Running preup function                                                                                                                                                                                                       [ ok ]

 *   Starting wpa_supplicant on wlan0 ...                                                                                                                                                                                         [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                                                                                                                                                                [ ok ]

 *     Failed to configure wlan0 in the background        

```

If I run wpa_supplicant manually, it tells me it can't find any suitable aps:

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

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

update_config=0

fast_reauth=1

Priority group 1000

   id=0 ssid='...'

Priority group -9999

   id=1 ssid=''

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:1b:77:2e:2f:2d

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

Setting scan request: 0 sec 100000 usec

ctrl_interface_group=10 (from group name 'wheel')

Added interface wlan0

RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()

Wireless event: cmd=0x8b06 len=8

Ignore event for foreign ifindex 5

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 1000

Selecting BSS from priority group -9999

No suitable AP found.

Setting scan request: 0 sec 0 usec

Starting AP scan (broadcast SSID)

Scan timeout - try to get results

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1000

Selecting BSS from priority group -9999

No suitable AP found.

Setting scan request: 5 sec 0 usec

Starting AP scan (broadcast SSID)

Scan timeout - try to get results

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1000

Selecting BSS from priority group -9999

No suitable AP found.

Setting scan request: 5 sec 0 usec

Starting AP scan (broadcast SSID)

Scan timeout - try to get results

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1000

Selecting BSS from priority group -9999

No suitable AP found.

Setting scan request: 5 sec 0 usec

Starting AP scan (broadcast SSID)

Scan timeout - try to get results

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1000

Selecting BSS from priority group -9999

No suitable AP found.

Setting scan request: 5 sec 0 usec

Starting AP scan (broadcast SSID)

Scan timeout - try to get results

Received 0 bytes of scan results (0 BSSes)

Scan results: 0

Selecting BSS from priority group 1000

Selecting BSS from priority group -9999

No suitable AP found.

```

Sometimes after booting I'm connected to some unsecured ap in my neighborhood instead of my own ap. 

Clearly there's something wrong in the way my computer is trying to connect to my ap. Is there a way to get more information about the connection process itself?

----------

## aidanjt

DHCP clients never jive well when dealing with multiple interfaces, either considering going static and carry on using baselayout for net configuration or go with NetworkManager.  You could probably pull it off but it'll take a bit of googling and tinkering.

----------

## torf

Hm. I wouldn't be surprised if having both interfaces up at the same time messed up things, but switching from one interface to another by bringing the first down and upping the second should work, shouldn't it? 

And there's still the issue that I'm not able to connect to my ap most of the time (it only works while booting and even that fails sometimes). Here's what dmesg says after /etc/init.d/net.wlan0 start failed (these are just the last lines, there's more of the same kind):

```
wlan0: CTS protection enabled (BSSID=00:1a:4f:9b:c0:b0)

wlan0: RX deauthentication from 00:1a:4f:9b:c0:b0 (reason=1)

wlan0: deauthenticated

wlan0: authenticate with AP 00:1a:4f:9b:c0:b0

wlan0: RX authentication from 00:1a:4f:9b:c0:b0 (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:1a:4f:9b:c0:b0

wlan0: RX ReassocResp from 00:1a:4f:9b:c0:b0 (capab=0x411 status=0 aid=2)

wlan0: associated

wlan0: CTS protection enabled (BSSID=00:1a:4f:9b:c0:b0)

wlan0: RX deauthentication from 00:1a:4f:9b:c0:b0 (reason=1)

wlan0: deauthenticated

wlan0: authenticate with AP 00:1a:4f:9b:c0:b0

wlan0: RX authentication from 00:1a:4f:9b:c0:b0 (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:1a:4f:9b:c0:b0

wlan0: RX ReassocResp from 00:1a:4f:9b:c0:b0 (capab=0x411 status=0 aid=2)

wlan0: associated

wlan0: CTS protection enabled (BSSID=00:1a:4f:9b:c0:b0)

```

Can anyone shed some light on this?

----------

## torf

My wireless connection is still not working. I managed to make iwlist scan actually scan for available networks and list 4 of them (don't ask my how I did it) -- but my access point is not listed, even though it's 2m away and working (since my flatmates can connect without problems). Even if I scan for the SSID of my network (using iwlist wlan0 scan essid MYSSID) it's not found.

I found that I can get rid of the "Wireless radio has ben killed..." error messages by

```
# echo 0 > /sys/bus/pci/drivers/iwl3945/0000\:03\:00.0/rf_kill
```

I also get different errors now when I try to bring up wlan0 manually:

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

 * Starting wlan0

 *   Running preup function                                                                                                                                                                                                       [ ok ]

SIOCSIFFLAGS: Connection timed out

SIOCSIFFLAGS: Connection timed out

 *   Starting wpa_supplicant on wlan0 ...

SIOCSIFFLAGS: Connection timed out                                                                                                                                                                                                [ ok ]

 *   Starting wpa_cli on wlan0 ...

Failed to connect to wpa_supplicant - wpa_ctrl_open: Connection refused 

```

Also, there's this interesting piece in dmesg:

```
irq 17: nobody cared (try booting with the "irqpoll" option)

Pid: 0, comm: swapper Tainted: P         2.6.25-gentoo-r8 #2

 [<c013c01b>] __report_bad_irq+0x24/0x69

 [<c013c022>] __report_bad_irq+0x2b/0x69

 [<c013c227>] note_interrupt+0x1c7/0x200

 [<c013b819>] handle_IRQ_event+0x1a/0x3f

 [<c013c8f8>] handle_fasteoi_irq+0x84/0xa2

 [<c0106358>] do_IRQ+0x6e/0x82

 [<c0104ecb>] common_interrupt+0x23/0x28

 [<c01300d8>] ktime_divns+0x38/0x75

 [<c023bbba>] acpi_idle_enter_bm+0x27e/0x2e9

 [<c0351154>] cpuidle_idle_call+0x52/0x7e

 [<c0351102>] cpuidle_idle_call+0x0/0x7e

 [<c01032e5>] cpu_idle+0x87/0x9b

 =======================

handlers:

[<c03216d8>] (usb_hcd_irq+0x0/0x54)

[<f8949b01>] (azx_interrupt+0x0/0x92 [snd_hda_intel])

Disabling IRQ #17

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

PM: Writing back config space on device 0000:03:00.0 at offset 1 (was 180106, writing 100106)

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.

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

iwl3945: Wait for START_ALIVE timeout after 2000ms.
```

Any pointers on this are really appreciated...

----------

## torf

*BUMP* Anyone? Anything?

----------

## torf

This is an advice to everybody who is as sure as I was that he is able to copy a simple pass-phrase from a sheet of paper to a config file, and who has checked the result 1000 times: Check another time.

Argh! I guess it's nothing but my fault, nevertheless I would've found that one way faster if I got some "authentication failed" error or similar... Well, well, thanks for trying to help!

EDIT: Sometimes I keep getting errors like "SIOCSIFFLAGS: Connection timed out" or "Failed to connect to wpa_supplicant - wpa_ctrl_open: Connection refused". In these cases it helps to reload the iwl3945 module:

```
/etc/init.d/net.wlan0 stop

rmmod iwl3945

modprobe iwl3945

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

----------

