18 #include <linux/module.h>
20 #include <linux/slab.h>
24 #define S2250_LOADER_FIRMWARE "s2250_loader.fw"
25 #define S2250_FIRMWARE "s2250.fw"
33 #define USB_s2250loader_MAJOR 240
34 #define USB_s2250loader_MINOR_BASE 0
35 #define MAX_DEVICES 256
37 static pdevice_extension_t s2250_dev_table[
MAX_DEVICES];
40 #define to_s2250loader_dev_common(d) container_of(d, device_extension_t, kref)
41 static void s2250loader_delete(
struct kref *
kref)
51 struct usb_device *usbdev;
53 pdevice_extension_t
s =
NULL;
56 usbdev =
usb_get_dev(interface_to_usbdev(interface));
63 usbdev->descriptor.idVendor, usbdev->descriptor.idProduct,
66 if (usbdev->descriptor.bNumConfigurations != 1) {
73 if (s2250_dev_table[minor] ==
NULL)
77 if (minor < 0 || minor >= MAX_DEVICES) {
88 s2250_dev_table[minor] =
s;
91 usbdev->devnum, usbdev->bus->busnum, minor);
97 kref_init(&(s->
kref));
103 "s2250: unable to load firmware from file \"%s\"\n",
116 "s2250: unable to load firmware from file \"%s\"\n",
127 usb_set_intfdata(interface, s);
134 kref_put(&(s->
kref), s2250loader_delete);
140 static void s2250loader_disconnect(
struct usb_interface *interface)
142 pdevice_extension_t
s;
144 s = usb_get_intfdata(interface);
145 usb_set_intfdata(interface,
NULL);
146 kref_put(&(s->
kref), s2250loader_delete);
150 {USB_DEVICE(0x1943, 0xa250)},
156 static struct usb_driver s2250loader_driver = {
157 .name =
"s2250-loader",
158 .probe = s2250loader_probe,
159 .disconnect = s2250loader_disconnect,
160 .id_table = s2250loader_ids,