# ipw3945 can't start during startup; SCAN_ABORD_CMD in dmesg

## don_martino

Hello World!

I'm having trouble with my ipw3945 WLAN chipset. When init brings up the interface everything looks and works fine, but when it's done something crashes. In order to get it to work I need to do

modprobe -r ipw3945

modprobe ipw3945

after that it works perfectly. The interface comes back online, connects to the network and gets an IP-address. The only thing that's wrong is that i have to use these 2 commands. I tried adding them to /etc/conf.d/local.start with a rather bad result. The system stops and obviously there aren't any gettys to log in to and since there is no network connection i can't ssh into the box, so i threw that idea away. Having to log in as root and unload, load the module is really anoying.

Before i post this as a bug to sourceforge i figure i ask the gentoo forum first in case it's a gentoo problem.

This is my /etc/conf.d/net

```
modules=( "wpa_supplicant" )

config_eth0=("null")

wpa_supplicant_eth1="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_eth1=60

config_eth1=( "dhcp" )
```

these are the interesting lines on my /etc/modprobe.conf

```
install ipw3945 /sbin/modprobe --ignore-install ipw3945; sleep 0.5; /etc/init.d/ipw3945d start

remove ipw3945 /etc/init.d/ipw3945d stop; /sbin/modprobe -r --ignore-remove ipw3945
```

this is the non-comment content of /etc/conf.d/ipw3945d

```
ARGS="--timeout=-1 --quiet"
```

and that's dmesg during startup. I left the other messages in between for completeness.

```
[...]

ieee80211_crypt: registered algorithm 'NULL'

ieee80211: 802.11 data/management/control stack, git-1.1.13

ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>

ipw3945: Intel(R) PRO/Wireless 3945 Network Connection driver for Linux, 1.2.2dmpr

ipw3945: Copyright(c) 2003-2006 Intel Corporation

PCI: Enabling device 0000:05:00.0 (0000 -> 0002)

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

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

ipw3945: Detected Intel PRO/Wireless 3945ABG Network Connection

Synaptics Touchpad, model: 1, fw: 6.2, id: 0x12a0b1, caps: 0xa04713/0x204000

input: SynPS/2 Synaptics TouchPad as /class/input/input5

NTFS driver 2.1.28 [Flags: R/W MODULE].

NTFS volume version 3.1.

NTFS-fs warning (device sda3): load_system_files(): Unsupported volume flags 0x4000 encountered.

NTFS-fs error (device sda3): load_system_files(): Volume has unsupported flags set.  Mounting read-only.  Run chkdsk and mount in Windows.

ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)

Bridge firewalling registered

ipw3945: Error sending SCAN_ABORT_CMD: time out after 500ms.

ipw3945: Error sending cmd #08 to daemon: time out after 500ms.

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

[fglrx] total      GART = 130023424

[fglrx] free       GART = 114032640

[fglrx] max single GART = 114032640

[fglrx] total      LFB  = 268304384

[fglrx] free       LFB  = 208613376

[fglrx] max single LFB  = 208613376

[fglrx] total      Inv  = 0

[fglrx] free       Inv  = 0

[fglrx] max single Inv  = 0

[fglrx] total      TIM  = 0

ipw3945: 1 frames still in use.  Did we lose one?

ipw3945: Radio disabled by module parameter.

ACPI: PCI interrupt for device 0000:05:00.0 disabled

```

after using modprobe to restart the device dmesg adds these lines

```
ieee80211_crypt: unregistered algorithm 'NULL'

ieee80211_crypt: registered algorithm 'NULL'

ieee80211: 802.11 data/management/control stack, git-1.1.13

ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>

ipw3945: Intel(R) PRO/Wireless 3945 Network Connection driver for Linux, 1.2.2dmpr

ipw3945: Copyright(c) 2003-2006 Intel Corporation

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

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

ipw3945: Detected Intel PRO/Wireless 3945ABG Network Connection

ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)

ieee80211_crypt: registered algorithm 'TKIP'
```

and after that my wlan works perfectly.

I am using this software:

sys-kernel/gentoo-sources-2.6.22-r5

net-wireless/ipw3945-ucode-1.14.2

net-wireless/ipw3945d-1.7.22-r4

sys-apps/sysvinit-2.86-r9

and i built the package/module ipw3945-1.2.2 from the sources available from sourceforge. with the versions from the portage tree i get the same problem and 1.2.2 is not in the portage-tree yet.

Is this problem known to anybody and has that problem been solved before?

----------

## didymos

Is the interface in either of the boot or default runlevels?  If not, then set this in /etc/conf.d/rc:

```

RC_PLUG_SERVICES="!net.eth1

```

then set it to start in the default runlevel.  If it's in boot, then change it to start in default.

----------

## don_martino

Worked!

udev used to start net.eth1. So I did as you sugested. Added the line to /etc/conf.d/rc and did a rc-update add net-eth1 default. I get warnings from sshd, netmount, postgresql and apache now b/c eth1 is not entirely up and running when those services start (i have RC_PARALLEL="no") but it's just a warning the services start and are accessible as configured.

Thanks for the quick help!

----------

## Offler

Is there any chance that the net.eth1 can be added to udev so it can start normally - without the extra line in the rc file? I still need to run 

```
/etc/init.d/net.eth1 restart
```

To get my wireless to work.

----------

## Offler

Ok added the above line to my local.start and it works but it's still a band aid papering over some sort of bug. When I did a rc-status net.eth1 was flagged as inactive for some reason and lsmod showed ipw3945 as OK and loaded.

----------

## don_martino

yes, i have the same "problem". there is the side effect that if net.eth1 is unable to start my wlan (killswitch) all the services depending on network won't start. For some reason net.eth0 isn't enough for all the services. I think the inactive flag is b/c of wpa_supplicant (don't know if you use that one). i could observe that the net.eth1 script terminates before wpa_supplicant associates to an AP not to mention authenticate.so i guess wlan is always considered inactive b/c the real state can't be easily determined.

----------

## Offler

This thread might hold a solution but I'm hesitant to go through all those steps in case I lose my band-aid working solution...I'm not at the moment totally confident with wireless and Gentoo (heck I'm still surprised I have it working  :Very Happy: ). Someone mentioned in another thread that the ipw3945 rc script tries to write to the file system (PID file) before it's writable and therefore fails but I can't see that being the cause as that would mean the ipw3945d service would not be running and yet for me lsmod shows it running.[/url]

----------

## Offler

Yes I use wpa_supplicant and what you mentioned regarding net.eth1 finishing before wpa_sup had a chance to finish is interesting......

```
#preup() {

#      if [[ ${IFACE} = "eth1" ]]; then

#              sleep 10

#      fi

#      return 0

#}

```

The preup() is commented out in my conf.d/net file because I use the -w flag with wpa_supplicant so the resource not ready error won't occur but I wonder if there is another function that can be called that can slow the net.eth1script for 10 seconds with a sleep and give wpa_supplicant time to finish running?

duringexecution()? or something like that  :Smile: 

----------

## don_martino

been there, done that. it doesn't work. i don't know why it works when net.eth1 is started in default instead of boot (or from udev) but it does. apparently there is some race condition i don't see.

btw: it's open source you can put the script to sleep when- and whereever you see fit.

----------

## Offler

Maybe postup()? So it does it's stuff forks off the ipw3945 stuff then hits the postup() which puts it to sleep for 10 seconds (15 maybe to be safe) and then returns but now because it gave ipw3945 code some breathing space it will see it doesn't need to flag net.eth1 as inactive. I'll try it later on after work and see what happens.

----------

## Offler

Yes it's postup() according to this networking page

----------

