^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 1999-2001 Vojtech Pavlik
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * USB HIDBP Mouse support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * Should you need to contact me, the author, you can do so either by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/usb/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/hid.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* for apple IDs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #ifdef CONFIG_USB_HID_MODULE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include "../hid-ids.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * Version Information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define DRIVER_VERSION "v1.6"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define DRIVER_DESC "USB HID Boot Protocol mouse driver"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) MODULE_AUTHOR(DRIVER_AUTHOR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) MODULE_DESCRIPTION(DRIVER_DESC);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct usb_mouse {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) char name[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) char phys[64];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct usb_device *usbdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct input_dev *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct urb *irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) signed char *data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) dma_addr_t data_dma;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) static void usb_mouse_irq(struct urb *urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct usb_mouse *mouse = urb->context;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) signed char *data = mouse->data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct input_dev *dev = mouse->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) int status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) switch (urb->status) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) case 0: /* success */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) case -ECONNRESET: /* unlink */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) case -ENOENT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) case -ESHUTDOWN:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* -EPIPE: should clear the halt */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) default: /* error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) goto resubmit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) input_report_key(dev, BTN_LEFT, data[0] & 0x01);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) input_report_key(dev, BTN_RIGHT, data[0] & 0x02);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) input_report_key(dev, BTN_MIDDLE, data[0] & 0x04);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) input_report_key(dev, BTN_SIDE, data[0] & 0x08);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) input_report_key(dev, BTN_EXTRA, data[0] & 0x10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) input_report_rel(dev, REL_X, data[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) input_report_rel(dev, REL_Y, data[2]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) input_report_rel(dev, REL_WHEEL, data[3]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) input_sync(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) resubmit:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) status = usb_submit_urb (urb, GFP_ATOMIC);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) if (status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) dev_err(&mouse->usbdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) "can't resubmit intr, %s-%s/input0, status %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) mouse->usbdev->bus->bus_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) mouse->usbdev->devpath, status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) static int usb_mouse_open(struct input_dev *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) struct usb_mouse *mouse = input_get_drvdata(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) mouse->irq->dev = mouse->usbdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) if (usb_submit_urb(mouse->irq, GFP_KERNEL))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) static void usb_mouse_close(struct input_dev *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) struct usb_mouse *mouse = input_get_drvdata(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) usb_kill_urb(mouse->irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) struct usb_device *dev = interface_to_usbdev(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct usb_host_interface *interface;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) struct usb_endpoint_descriptor *endpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) struct usb_mouse *mouse;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) struct input_dev *input_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) int pipe, maxp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) int error = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) interface = intf->cur_altsetting;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) if (interface->desc.bNumEndpoints != 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) endpoint = &interface->endpoint[0].desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) if (!usb_endpoint_is_int_in(endpoint))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) mouse = kzalloc(sizeof(struct usb_mouse), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) input_dev = input_allocate_device();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) if (!mouse || !input_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) goto fail1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) if (!mouse->data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) goto fail1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) mouse->irq = usb_alloc_urb(0, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) if (!mouse->irq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) goto fail2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) mouse->usbdev = dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) mouse->dev = input_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) if (dev->manufacturer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) strlcpy(mouse->name, dev->manufacturer, sizeof(mouse->name));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) if (dev->product) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) if (dev->manufacturer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) strlcat(mouse->name, " ", sizeof(mouse->name));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) strlcat(mouse->name, dev->product, sizeof(mouse->name));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) if (!strlen(mouse->name))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) snprintf(mouse->name, sizeof(mouse->name),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) "USB HIDBP Mouse %04x:%04x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) le16_to_cpu(dev->descriptor.idVendor),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) le16_to_cpu(dev->descriptor.idProduct));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) usb_make_path(dev, mouse->phys, sizeof(mouse->phys));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) strlcat(mouse->phys, "/input0", sizeof(mouse->phys));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) input_dev->name = mouse->name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) input_dev->phys = mouse->phys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) usb_to_input_id(dev, &input_dev->id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) input_dev->dev.parent = &intf->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_SIDE) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) BIT_MASK(BTN_EXTRA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) input_dev->relbit[0] |= BIT_MASK(REL_WHEEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) input_set_drvdata(input_dev, mouse);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) input_dev->open = usb_mouse_open;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) input_dev->close = usb_mouse_close;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) usb_fill_int_urb(mouse->irq, dev, pipe, mouse->data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) (maxp > 8 ? 8 : maxp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) usb_mouse_irq, mouse, endpoint->bInterval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) mouse->irq->transfer_dma = mouse->data_dma;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) mouse->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) error = input_register_device(mouse->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) goto fail3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) usb_set_intfdata(intf, mouse);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) fail3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) usb_free_urb(mouse->irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) fail2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) fail1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) input_free_device(input_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) kfree(mouse);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) static void usb_mouse_disconnect(struct usb_interface *intf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) struct usb_mouse *mouse = usb_get_intfdata (intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) usb_set_intfdata(intf, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) if (mouse) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) usb_kill_urb(mouse->irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) input_unregister_device(mouse->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) usb_free_urb(mouse->irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) kfree(mouse);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) static const struct usb_device_id usb_mouse_id_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) { USB_INTERFACE_INFO(USB_INTERFACE_CLASS_HID, USB_INTERFACE_SUBCLASS_BOOT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) USB_INTERFACE_PROTOCOL_MOUSE) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) { } /* Terminating entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) MODULE_DEVICE_TABLE (usb, usb_mouse_id_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) static struct usb_driver usb_mouse_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) .name = "usbmouse",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) .probe = usb_mouse_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) .disconnect = usb_mouse_disconnect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) .id_table = usb_mouse_id_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) module_usb_driver(usb_mouse_driver);