On Wed, Mar 13, 2002 at 04:14:52PM -0800, Greg KH wrote:
> On Wed, Mar 13, 2002 at 10:46:36PM +0100, Vojtech Pavlik wrote:
> > Hi!
> > 
> > Here is the patch I promised for the Aten KVM switches for kernel 2.5.
> 
> Thanks, I've applied it to my tree.
> 
> If you get a chance, a 2.4 version of this patch might make a lot of
> people happy :)

Here you are.

-- 
Vojtech Pavlik
SuSE Labs
diff -urN linux-2.4.19-pre3/drivers/usb/hid-core.c linux/drivers/usb/hid-core.c
--- linux-2.4.19-pre3/drivers/usb/hid-core.c    Fri Dec 21 18:41:55 2001
+++ linux/drivers/usb/hid-core.c        Thu Mar 14 14:38:10 2002
@@ -897,6 +897,9 @@
        u8 data[len];
        int read;
 
+       if (hid->quirks & HID_QUIRK_NOGET)
+               return;
+
        if ((read = usb_get_report(hid->dev, hid->ifnum, report->type + 1, report->id, 
data, len)) != len) {
                dbg("reading report type %d id %d failed len %d read %d", report->type 
+ 1, report->id, len, read);
                return;
@@ -1076,16 +1079,25 @@
 #define USB_DEVICE_ID_WACOM_GRAPHIRE   0x0010
 #define USB_DEVICE_ID_WACOM_INTUOS     0x0020
 
+#define USB_VENDOR_ID_ATEN             0x0557
+#define USB_DEVICE_ID_ATEN_UC100KM     0x2004
+#define USB_DEVICE_ID_ATEN_CS124U      0x2202
+#define USB_DEVICE_ID_ATEN_2PORTKVM    0x2204
+
 struct hid_blacklist {
        __u16 idVendor;
        __u16 idProduct;
+       unsigned quirks;
 } hid_blacklist[] = {
-       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE },
-       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS },
-       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 1},
-       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 2},
-       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 3},
-       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 4},
+       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 1, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 2, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 3, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 4, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET },
+       { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET },
+       { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
        { 0, 0 }
 };
 
@@ -1094,13 +1106,17 @@
        struct usb_interface_descriptor *interface = 
dev->actconfig->interface[ifnum].altsetting + 0;
        struct hid_descriptor *hdesc;
        struct hid_device *hid;
-       unsigned rsize = 0;
+       unsigned quirks = 0, rsize = 0;
        char *buf;
        int n;
 
        for (n = 0; hid_blacklist[n].idVendor; n++)
                if ((hid_blacklist[n].idVendor == dev->descriptor.idVendor) &&
-                       (hid_blacklist[n].idProduct == dev->descriptor.idProduct)) 
return NULL;
+                       (hid_blacklist[n].idProduct == dev->descriptor.idProduct))
+                               quirks = hid_blacklist[n].quirks;
+
+       if (quirks & HID_QUIRK_IGNORE)
+               return NULL;
 
        if (usb_get_extra_descriptor(interface, USB_DT_HID, &hdesc) && 
((!interface->bNumEndpoints) ||
                usb_get_extra_descriptor(&interface->endpoint[0], USB_DT_HID, 
&hdesc))) {
@@ -1137,6 +1153,8 @@
                        return NULL;
                }
        }
+
+       hid->quirks = quirks;
 
        for (n = 0; n < interface->bNumEndpoints; n++) {
 
diff -urN linux-2.4.19-pre3/drivers/usb/hid.h linux/drivers/usb/hid.h
--- linux-2.4.19-pre3/drivers/usb/hid.h Wed Nov 14 02:45:27 2001
+++ linux/drivers/usb/hid.h     Thu Mar 14 14:41:24 2002
@@ -184,6 +184,8 @@
 
 #define HID_QUIRK_INVERT       0x01
 #define HID_QUIRK_NOTOUCH      0x02
+#define HID_QUIRK_IGNORE       0x04
+#define HID_QUIRK_NOGET                0x08
 
 /*
  * This is the global enviroment of the parser. This information is

Reply via email to