summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-05-09 09:33:51 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-05-09 09:33:51 +0000
commit4679885ba99827f4b9836d6b4f7ce0134b82b565 (patch)
treef84fd657aaba79f4d824a8bb7f021f774902acad /tools
parentf3c0a1a49b0b505b8543b5b3405bd62126be1a24 (diff)
Add support for switching HID proxy devices from Dell
Diffstat (limited to 'tools')
-rw-r--r--tools/hid2hci.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/hid2hci.c b/tools/hid2hci.c
index 124829fb..eee6da8f 100644
--- a/tools/hid2hci.c
+++ b/tools/hid2hci.c
@@ -211,6 +211,37 @@ static int switch_logitech(struct device_info *devinfo)
return err;
}
+static int switch_dell(struct device_info *devinfo)
+{
+ char report[] = { 0x7f, 0x13, 0x00, 0x00 };
+
+ struct usb_dev_handle *handle;
+ int err;
+
+ handle = usb_open(devinfo->dev);
+ if (handle) {
+ usb_claim_interface(handle, 0);
+ usb_detach_kernel_driver_np(handle, 0);
+ }
+
+ err = usb_control_msg(handle,
+ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ 0x09, 0x7f | (0x03 << 8), 0,
+ report, sizeof(report), 10000);
+
+ if (err == 0) {
+ err = -1;
+ errno = EALREADY;
+ } else {
+ if (errno == ETIMEDOUT)
+ err = 0;
+ }
+
+ usb_close(handle);
+
+ return err;
+}
+
static struct device_id device_list[] = {
{ HCI, 0x0a12, 0x1000, switch_hidproxy },
{ HID, 0x0a12, 0x0001, switch_hidproxy },
@@ -229,6 +260,8 @@ static struct device_id device_list[] = {
{ HCI, 0x046d, 0xc70e, switch_logitech }, /* Logitech diNovo keyboard */
{ HCI, 0x046d, 0xc713, switch_logitech }, /* Logitech diNovo Edge */
{ HCI, 0x046d, 0xc714, switch_logitech }, /* Logitech diNovo Edge */
+ { HCI, 0x413c, 0x8158, switch_dell }, /* Dell Wireless 370 */
+ { HCI, 0x413c, 0x8154, switch_dell }, /* Dell Wireless 410 */
{ -1 }
};