LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   downloading firmware (https://www.linuxquestions.org/questions/linux-newbie-8/downloading-firmware-511825/)

sunshine11 12-19-2006 12:56 AM

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.

Tinkster 12-19-2006 02:28 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...d.php?t=511819


All times are GMT -5. The time now is 02:24 AM.