--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -1253,0 +1253,3 @@ +#define USB_VENDOR_ID_CHERRY 0x046a +#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 @@ -1256,1 +1259,4 @@ - return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), --- + int retval; + char *p = (char*)buf; + retval = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), @@ -1259,0 +1265,15 @@ + // wn_hack: patch wrong descriptor for this device + // hardware sends wrong descriptor + if (dev->descriptor.idVendor == USB_VENDOR_ID_CHERRY + && dev->descriptor.idProduct == USB_DEVICE_ID_CHERRY_CYMOTION + && size > 12 + && p[11] == 0x3c + && p[12] == 0x02) + { + printk(KERN_DEBUG __FILE__ " : modifying descriptor for Cherry CyMotion keyboard \n"); + p[11] = p[16] = 0xff; + p[12] = p[17] = 0x03; + } + return retval;