# ipw2200 firmware doesn't get loaded sometimes

## Spidey

Sometimes I boot my system and I just don't get the WLAN card firmware loaded. I'll try and log dmesg next time (I use Gentoo on my work laptop, I'm currently on my desktop) I boot, but I can't find any references as to why the firmware loading failed, despite the -5 error code. I searched for the error code meaning, but with no success. Since ipw2200a firmware is a binary blob, directly from intel, I feel I might be unlucky to get the exact error code signification, unless Intel explicitly documents them, which Google rather proved not being the case.

I'm creating this topic to ask for help on DEBUGGING this behavior. What can I do to get more explicit error messages? I'll compile the driver with debug options, and invoke it with debug options too (how to set up /etc/modprobe.d/ with options for module ABC, or this works only for specific modules? - If I can't invoke ipw2200 this way, I can always modprobe it by hand), but where these debug messages will be logged? To dmesg?

----------

## Spidey

Ok, I'm back.

So, when I booted today, no wireless. Rebooted and then the init process halted at "Waiting for uevents to process". I need to reboot several times until it would finish booting, without crashing. But I guess this is another problem, I'll run memtest to check my RAM and then I'll check my HD. But, as I already said, this is another problem.

Ok, booted, no wifi. dmesg confirmed the dreaded problem: failure to load the firmware. I then removed both ipw2200 and libipw modules. Loaded both and now I have network. I can't tell for sure if the problem is that libipw needs some time to initialize properly, but that is exactly what appears to be happening.

Ok, here is the last boot dmesg -> rmmod -> modprobe "log":

http://paste.pocoo.org/show/206331/

And now the log from last time, I just removed ipw2200 (the module that throws the errors) and reinserted it, two times to be sure:

http://paste.pocoo.org/show/206339/

----------

## Rexilion

Looks like a race condition. Perhaps it's better (like I did), to just build the firmware and the driver inside the kernel (=y). There is an option in the kernel for that (especially for the firmware).

----------

## Spidey

I've tried, but since I depend on ipw2200 microcode, I don't know how to do it. May I just copy it to some kernel source folder and make the new kernel? I don't know how to insert firmware blobs inside the kernel, although I've read about it in the kernel help pages.

----------

## Rexilion

It's in menuconfig:

Device Drivers -> Generic Driver Options -> External firmware blobs to build into the kernel binary

It's help says:

  │ CONFIG_EXTRA_FIRMWARE:                                                                       │  

  │                                                                                              │  

  │ This option allows firmware to be built into the kernel, for the                             │  

  │ cases where the user either cannot or doesn't want to provide it from                        │  

  │ userspace at runtime (for example, when the firmware in question is                          │  

  │ required for accessing the boot device, and the user doesn't want to                         │  

  │ use an initrd).                                                                              │  

  │                                                                                              │  

  │ This option is a string, and takes the (space-separated) names of the                        │  

  │ firmware files -- the same names which appear in MODULE_FIRMWARE()                           │  

  │ and request_firmware() in the source. These files should exist under                         │  

  │ the directory specified by the EXTRA_FIRMWARE_DIR option, which is                           │  

  │ by default the firmware/ subdirectory of the kernel source tree.                             │  

  │                                                                                              │  

  │ So, for example, you might set CONFIG_EXTRA_FIRMWARE="usb8388.bin",                          │  

  │ copy the usb8388.bin file into the firmware/ directory, and build the                        │  

  │ kernel. Then any request_firmware("usb8388.bin") will be                                     │  

  │ satisfied internally without needing to call out to userspace.                               │  

<<<snip>>>

----------

