kernel module cannot find firmware file on Android device; where should it be?

gnychis picture gnychis · May 16, 2011 · Viewed 11.7k times · Source

I am having trouble placing firmware properly on an Android device, I keep getting:

<3>[ 3590.997375] usb 3-1.4: ath9k_htc: Firmware - htc_7010.fw not found

If on a standard linux machine running Ubuntu, I place htc_7010.fw in /lib/firmware then I do not get this error.

However, if I place this firmware in /lib/firmware on Android, I still get the error. I have tried all of the following directories and still receive the error:

/lib/firmware
/etc/firmware
/system/lib/modules
/system/lib/firmware
/system/etc

No such luck... what dictates where the firmware should be, and how could I determine which directories it is scanning for the firmware?

Answer

Russ Schultz picture Russ Schultz · Aug 9, 2012

On Android (ICS anyways) it has its own daemon/service (or whatever you want to call it) to manage hotplug events, including firmware requests. In <android>/system/core/init/devices.c, there are two #defines that specify locations where firmware will be checked:

#define FIRMWARE_DIR1   "/etc/firmware"
#define FIRMWARE_DIR2   "/vendor/firmware"

On my initial build of the ICS filesystem, /etc/firmware didn't exist (and the etc directory seems to be a symbolic link created at boot/init time). The directory I had to place firmware in on my NFS mounted rootfs was <mount point>/system/etc/firmware

After doing this, request_firmware() calls from my module successfully completed.