2011-09-06 08:40:33

by Kalle Valo

[permalink] [raw]
Subject: How to request firmware during module init?

Hi,

ath6kl needs to request the firmware from user space during module init
(or to be exact from sdio probe, but it's almost the same thing) and
boot hardware to get some settings etc before it registers itself to
cfg80211. What's the proper way to handle this?

I noticed that when I compile ath6kl into kernel boot fails on my x86
box as firmware is not available because user space is not ready.

Kalle


2011-09-06 08:48:12

by Kalle Valo

[permalink] [raw]
Subject: Re: How to request firmware during module init?

On 09/06/2011 11:44 AM, Johannes Berg wrote:
> On Tue, 2011-09-06 at 11:40 +0300, Kalle Valo wrote:
>> Hi,
>>
>> ath6kl needs to request the firmware from user space during module init
>> (or to be exact from sdio probe, but it's almost the same thing) and
>> boot hardware to get some settings etc before it registers itself to
>> cfg80211. What's the proper way to handle this?
>>
>> I noticed that when I compile ath6kl into kernel boot fails on my x86
>> box as firmware is not available because user space is not ready.
>
> We do an async request, once it comes back we register with mac80211.

I take it you mean request_firmware_nowait(). I'll use that also.

Thanks!

Kalle

2011-09-06 08:59:50

by Tony Vroon

[permalink] [raw]
Subject: Re: How to request firmware during module init?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/09/11 09:40, Kalle Valo wrote:
> I noticed that when I compile ath6kl into kernel boot fails on my
> x86 box as firmware is not available because user space is not
> ready.

Provided CONFIG_FIRMWARE_IN_KERNEL=y you could add this firmware to
the kernel image with CONFIG_EXTRA_FIRMWARE. That's how I successfully
operate monolithic kernels on X86 laptops.
As an example:
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="iwlwifi-6000g2a-5.ucode"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

Regards,
- --
Tony Vroon
UNIX systems administrator
London Internet Exchange Ltd, Trinity Court, Trinity Street,
Peterborough, PE1 1DA
Registered in England number 3137929
E-Mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5l3sIACgkQp5vW4rUFj5qIdgCbBD0fzZc+DB8qCxt7UVn4SXYK
THoAoKzKOg/hIpDV4+54KXCWRQu/ziPa
=DREw
-----END PGP SIGNATURE-----

2011-09-06 08:44:24

by Johannes Berg

[permalink] [raw]
Subject: Re: How to request firmware during module init?

On Tue, 2011-09-06 at 11:40 +0300, Kalle Valo wrote:
> Hi,
>
> ath6kl needs to request the firmware from user space during module init
> (or to be exact from sdio probe, but it's almost the same thing) and
> boot hardware to get some settings etc before it registers itself to
> cfg80211. What's the proper way to handle this?
>
> I noticed that when I compile ath6kl into kernel boot fails on my x86
> box as firmware is not available because user space is not ready.

We do an async request, once it comes back we register with mac80211.

johannes