From 3ae4630e287d6b27c4f19180d68831f019dfd7d4 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 19 Mar 2014 16:30:40 +0100 Subject: unifying: fill in more device and receiver info These serial numbers are obviously fake, the product and device names, however, are real. Signed-off-by: Peter Wu --- hw/usb/hid-logitech-dj.c | 18 ++++++++++++++++++ hw/usb/hid-logitech-dj.h | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c index a1dfeb9534..62a15ea802 100644 --- a/hw/usb/hid-logitech-dj.c +++ b/hw/usb/hid-logitech-dj.c @@ -305,12 +305,27 @@ static void hidpp_init_device(USBLtunifyState *s, int device_index, int devtype) case DEVTYPE_KEYBOARD: hd->hid = &s->hid[IFACE_KBD]; hd->info.report_types = 0x1a; /* Keyboard, Consumer Control, System Control */ + hd->info.wireless_pid = 0x2010; + hd->info.serial = 0x4b657973; + memcpy(hd->info.name, "K800", 4); break; case DEVTYPE_MOUSE: hd->hid = &s->hid[IFACE_MSE]; hd->info.report_types = 4; /* HID Collection: Mouse */ + hd->info.wireless_pid = 0x4013; + hd->info.serial = 0x52617473; + memcpy(hd->info.name, "M525", 4); + break; + case DEVTYPE_TOUCHPAD: + /* TODO: perhaps "unpair" mouse and use this touchpad instead? */ + hd->hid = &s->hid[IFACE_MSE]; + hd->info.report_types = 0x0e; /* Keyboard, Mouse, Consumer Ctrl */ + hd->info.wireless_pid = 0x4026; + hd->info.serial = 0x4f4f4f48; + memcpy(hd->info.name, "T650", 4); break; } + hd->info.protocol_version = 0x0200; /* HID++ 2.0 */ hd->mode = LTUNIFY_MODE_HID; hd->powered_on = true; } @@ -329,6 +344,9 @@ void hidpp_reset(USBLtunifyState *s) void hidpp_init(USBLtunifyState *s) { + LHidReceiver *r = &s->receiver; + r->info.serial = 0x4c4f5354; + hidpp_init_device(s, 1, DEVTYPE_KEYBOARD); hidpp_init_device(s, 2, DEVTYPE_MOUSE); } diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index bcfe17cc7e..5e0ba2efe8 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -122,7 +122,7 @@ struct firmware_version { }; typedef struct { - const struct { + struct { uint32_t serial; struct firmware_version version; } info; /* static information */ @@ -155,7 +155,7 @@ typedef struct { uint16_t protocol_version; /* HID++ protocol version */ uint16_t wireless_pid; uint32_t serial; - const char name[15]; + char name[15]; uint8_t usability_info; /* bits 0..3 power switch location */ uint32_t report_types; /* supported report types (e.g. mouse) */ /* TODO: feature set */ -- cgit v1.2.1