downloading firmware
Hi,
I wanted to download firmware via the hotplug mechanism...I just wrote a simple module for the sake of testing. This is the module:
static struct device dev = {
.bus_id = "dev"
};
static void sample_probe_default(void)
{
const struct firmware *fw_entry =NULL;
int k;
printk("firmware_driver: device is inserted\n");
k = request_firmware(&fw_entry,"fw_load",&dev);
if(k!=0)
{
printk(KERN_ERR "firmware_driver: Firmware not available\n");
return;
}
}
static int sample_init(void)
{
device_initialize(&dev);
printk(KERN_DEBUG "initialized device\n");
sample_probe_default();
return 0;
}
static void __exit sample_exit(void)
{
}
module_init (sample_init);
module_exit (sample_exit);
MODULE_LICENSE("GPL");
When I insert the module, the system hangs...and I get to see the following messages on the screen.
firmware_driver: device is inserted
fw_register_class_device: class_device_register failed
firmware_driver: Firmware not available
Also..sme imp things...
cat /proc/sys/kernel/hotplug shows /sbin/hotplug
I have placed the firmware file i.e. fw_load in the apporpriate directory i.e. /usr/lib/hotplug/firmware/fw_load
The firmware.agent is also at the appopriate place /etc/hotplug/firmware.agent
The module creates a directory dev but it doesnot contain the required files i.e. loading & data
If smeone cud help me out wid dis.... am using kernel version 2.6.6...any help wud be appreciated..Plz also point out anythin dat Iam missing here.
|