/* * * Firmware loader test driver * * Copyright (C) 2003 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include static struct usb_device_id fwldtest_table[] = { { USB_DEVICE(0x057c, 0x2200) }, { } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, fwldtest_table); static int fwldtest_probe(struct usb_interface *iface, const struct usb_device_id *id) { const struct firmware *firmware; struct usb_device *udev = interface_to_usbdev(iface); if (request_firmware(&firmware, "firmware.bin", &udev->dev) < 0) { printk(KERN_ERR "Firmware request failed\n"); goto error; } printk(KERN_INFO "firmware data %p size %d\n", firmware->data, firmware->size); error: release_firmware(firmware); return -EIO; } static void fwldtest_disconnect(struct usb_interface *iface) { } static struct usb_driver fwldtest_driver = { .owner = THIS_MODULE, .name = "fwldtest", .probe = fwldtest_probe, .disconnect = fwldtest_disconnect, .id_table = fwldtest_table, }; static int __init fwldtest_init(void) { return usb_register(&fwldtest_driver); } static void __exit fwldtest_cleanup(void) { usb_deregister(&fwldtest_driver); } module_init(fwldtest_init); module_exit(fwldtest_cleanup); MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Firmware loader test driver"); MODULE_LICENSE("GPL");