xfrm: Check for esn buffer len in xfrm_new_ae
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / hid / hid-ortek.c
blobf9b7dd4f607f9c7a4403cdead7f1cd40d28ea501
1 /*
2 * HID driver for Ortek PKB-1700/WKB-2000 (wireless keyboard + mouse trackpad).
3 * Fixes LogicalMaximum error in HID report description.
5 * Copyright (c) 2010 Johnathon Harris <jmharris@gmail.com>
6 */
8 /*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
15 #include <linux/device.h>
16 #include <linux/hid.h>
17 #include <linux/module.h>
19 #include "hid-ids.h"
21 static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
22 unsigned int *rsize)
24 if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
25 hid_info(hdev, "Fixing up Ortek WKB-2000 report descriptor\n");
26 rdesc[55] = 0x92;
28 return rdesc;
31 static const struct hid_device_id ortek_devices[] = {
32 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
33 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
34 { }
36 MODULE_DEVICE_TABLE(hid, ortek_devices);
38 static struct hid_driver ortek_driver = {
39 .name = "ortek",
40 .id_table = ortek_devices,
41 .report_fixup = ortek_report_fixup
44 static int __init ortek_init(void)
46 return hid_register_driver(&ortek_driver);
49 static void __exit ortek_exit(void)
51 hid_unregister_driver(&ortek_driver);
54 module_init(ortek_init);
55 module_exit(ortek_exit);
56 MODULE_LICENSE("GPL");