# userspace firmware loading

## alex.blackbit

hi,

i just swapped the wlan module in my laptop. now i have WiMAX (Intel WiMAX Link 5350), which is a USB device.

there is bug #266893 with an ebuild for the firmware, which i installed.

after reboot i get:

```
# dmesg | grep i2400

usbcore: registered new interface driver i2400m_usb

i2400m_usb 2-3:1.0: WiMAX interface wmx0 (00:1d:e1:03:24:8d) ready

i2400m_usb 2-3:1.0: firmware: requesting i2400m-fw-usb-1.4.sbcf

i2400m_usb 2-3:1.0: fw i2400m-fw-usb-1.4.sbcf: cannot load file: -2

i2400m_usb 2-3:1.0: Could not find a usable firmware image

i2400m_usb 2-3:1.0: cannot bootstrap device: -2

i2400m_usb 2-3:1.0: cannot setup device: -2

i2400m_usb: probe of 2-3:1.0 failed with error -2

#
```

the name of the firmware file in /lib/firmware/ matches.

in the kernel config i have:

```
CONFIG_FW_LOADER=y

# CONFIG_FIRMWARE_IN_KERNEL is not set
```

any ideas on what could the problem here could be?

thanks in advance.

----------

## DONAHUE

Could the bug be obsolete and this kernel config handle the problem if you rename or move the firmware you manually placed?

 *Quote:*   

> [*] Networking support  --->
> 
> [*]   Wireless  ---> 
> 
> <M>   WiMAX Wireless Broadband support  ---> 
> ...

 

----------

## alex.blackbit

i switched to modules, as you suggested.

it works now, thanks for the hint.

but, actually, that's not what i want.

any ideas on what i have to do to make firmware loading work with the wimax stuff in-kernel ?

----------

## DONAHUE

I've not found any howto or guides to building firmware into kernel

cd /usr/src/linux;make menuconfig

simple guess:

 *Quote:*   

> change the M 's to * 's, recompile and recopy kernel and try it.

 

That failing:

cd /usr/src/linux;make menuconfig

type /

type firmware,

enter

read all the helps,

It appears doable, guess at which options,

my guess:

 *Quote:*   

> Generic Driver Options  --->
> 
> (/sbin/hotplug) path to uevent helper
> 
> [*] Select only drivers that don't need compile-time external fir
> ...

 

change the M 's to * 's, recompile and recopy kernel and try it.

please post the results if you do.

----------

## alex.blackbit

thanks for your answer.

you got me wrong.

i don't want to build the firmware blob into the kernel image.

what i want to do is have the kernel load the firmware from /lib/firmware and to have the according code parts not as modules, but in-kernel.

----------

## DONAHUE

So try the simple guess above. Same config but as built in not module. The likely problem being that the kernel will attempt to load the firmware before it is mounted and available (probably the reason you started this thread). You can beat that two ways as far as I know, an initrd/initramfs or building the blob into the kernel.

----------

## alex.blackbit

weird and unpleasant.

i do not like initrd's at all, neither modules.

in this case the usage of modules is really a stinky workaround and has nothing to do with modularization.

shouldn't there be a mechanism in the kernel that determines if a part depends on a mounted file system and in that case loads that part later ?

thanks for your help.

----------

## DirtyHairy

Have a look at CONFIG_FIRMWARE_IN_KERNEL and CONFIG_EXTRA_FIRMWARE (these are under "Device Drivers" -> "Generic Driver Options"). I've never used them so far, but it looks like they force the inclusion of firmware blobs directly into the kernel, which I suppose is just what you need  :Smile:  BTW, I also don't like initrd's...

----------

## Spidey

 *alex.blackbit wrote:*   

> weird and unpleasant.
> 
> i do not like initrd's at all, neither modules.
> 
> in this case the usage of modules is really a stinky workaround and has nothing to do with modularization.
> ...

 

That's what we ALL want!

----------

