Loading hw/usb/dev-hid.c +65 −1 Original line number Diff line number Diff line Loading @@ -226,6 +226,37 @@ static const USBDescIface desc_iface_keyboard = { }, }; static const USBDescIface desc_iface_keyboard2 = { .bInterfaceNumber = 0, .bNumEndpoints = 1, .bInterfaceClass = USB_CLASS_HID, .bInterfaceSubClass = 0x01, /* boot */ .bInterfaceProtocol = 0x01, /* keyboard */ .ndesc = 1, .descs = (USBDescOther[]) { { /* HID descriptor */ .data = (uint8_t[]) { 0x09, /* u8 bLength */ USB_DT_HID, /* u8 bDescriptorType */ 0x11, 0x01, /* u16 HID_class */ 0x00, /* u8 country_code */ 0x01, /* u8 num_descriptors */ USB_DT_REPORT, /* u8 type: Report */ 0x3f, 0, /* u16 len */ }, }, }, .eps = (USBDescEndpoint[]) { { .bEndpointAddress = USB_DIR_IN | 0x01, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = 8, .bInterval = 7, /* 2 ^ (8-1) * 125 usecs = 8 ms */ }, }, }; static const USBDescDevice desc_device_mouse = { .bcdUSB = 0x0100, .bMaxPacketSize0 = 8, Loading Loading @@ -311,6 +342,23 @@ static const USBDescDevice desc_device_keyboard = { }, }; static const USBDescDevice desc_device_keyboard2 = { .bcdUSB = 0x0200, .bMaxPacketSize0 = 64, .bNumConfigurations = 1, .confs = (USBDescConfig[]) { { .bNumInterfaces = 1, .bConfigurationValue = 1, .iConfiguration = STR_CONFIG_KEYBOARD, .bmAttributes = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP, .bMaxPower = 50, .nif = 1, .ifs = &desc_iface_keyboard2, }, }, }; static const USBDescMSOS desc_msos_suspend = { .SelectiveSuspendEnabled = true, }; Loading Loading @@ -387,6 +435,21 @@ static const USBDesc desc_keyboard = { .msos = &desc_msos_suspend, }; static const USBDesc desc_keyboard2 = { .id = { .idVendor = 0x0627, .idProduct = 0x0001, .bcdDevice = 0, .iManufacturer = STR_MANUFACTURER, .iProduct = STR_PRODUCT_KEYBOARD, .iSerialNumber = STR_SERIALNUMBER, }, .full = &desc_device_keyboard, .high = &desc_device_keyboard2, .str = desc_strings, .msos = &desc_msos_suspend, }; static const uint8_t qemu_mouse_hid_report_descriptor[] = { 0x05, 0x01, /* Usage Page (Generic Desktop) */ 0x09, 0x02, /* Usage (Mouse) */ Loading Loading @@ -674,7 +737,7 @@ static void usb_mouse_realize(USBDevice *dev, Error **errp) static void usb_keyboard_realize(USBDevice *dev, Error **errp) { usb_hid_initfn(dev, HID_KEYBOARD, &desc_keyboard, NULL, errp); usb_hid_initfn(dev, HID_KEYBOARD, &desc_keyboard, &desc_keyboard2, errp); } static int usb_ptr_post_load(void *opaque, int version_id) Loading Loading @@ -774,6 +837,7 @@ static const TypeInfo usb_mouse_info = { }; static Property usb_keyboard_properties[] = { DEFINE_PROP_UINT32("usb_version", USBHIDState, usb_version, 2), DEFINE_PROP_STRING("display", USBHIDState, display), DEFINE_PROP_END_OF_LIST(), }; Loading include/hw/i386/pc.h +4 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "usb-mouse",\ .property = "usb_version",\ .value = stringify(1),\ },{\ .driver = "usb-kbd",\ .property = "usb_version",\ .value = stringify(1),\ } #define PC_COMPAT_2_0 \ Loading Loading
hw/usb/dev-hid.c +65 −1 Original line number Diff line number Diff line Loading @@ -226,6 +226,37 @@ static const USBDescIface desc_iface_keyboard = { }, }; static const USBDescIface desc_iface_keyboard2 = { .bInterfaceNumber = 0, .bNumEndpoints = 1, .bInterfaceClass = USB_CLASS_HID, .bInterfaceSubClass = 0x01, /* boot */ .bInterfaceProtocol = 0x01, /* keyboard */ .ndesc = 1, .descs = (USBDescOther[]) { { /* HID descriptor */ .data = (uint8_t[]) { 0x09, /* u8 bLength */ USB_DT_HID, /* u8 bDescriptorType */ 0x11, 0x01, /* u16 HID_class */ 0x00, /* u8 country_code */ 0x01, /* u8 num_descriptors */ USB_DT_REPORT, /* u8 type: Report */ 0x3f, 0, /* u16 len */ }, }, }, .eps = (USBDescEndpoint[]) { { .bEndpointAddress = USB_DIR_IN | 0x01, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = 8, .bInterval = 7, /* 2 ^ (8-1) * 125 usecs = 8 ms */ }, }, }; static const USBDescDevice desc_device_mouse = { .bcdUSB = 0x0100, .bMaxPacketSize0 = 8, Loading Loading @@ -311,6 +342,23 @@ static const USBDescDevice desc_device_keyboard = { }, }; static const USBDescDevice desc_device_keyboard2 = { .bcdUSB = 0x0200, .bMaxPacketSize0 = 64, .bNumConfigurations = 1, .confs = (USBDescConfig[]) { { .bNumInterfaces = 1, .bConfigurationValue = 1, .iConfiguration = STR_CONFIG_KEYBOARD, .bmAttributes = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP, .bMaxPower = 50, .nif = 1, .ifs = &desc_iface_keyboard2, }, }, }; static const USBDescMSOS desc_msos_suspend = { .SelectiveSuspendEnabled = true, }; Loading Loading @@ -387,6 +435,21 @@ static const USBDesc desc_keyboard = { .msos = &desc_msos_suspend, }; static const USBDesc desc_keyboard2 = { .id = { .idVendor = 0x0627, .idProduct = 0x0001, .bcdDevice = 0, .iManufacturer = STR_MANUFACTURER, .iProduct = STR_PRODUCT_KEYBOARD, .iSerialNumber = STR_SERIALNUMBER, }, .full = &desc_device_keyboard, .high = &desc_device_keyboard2, .str = desc_strings, .msos = &desc_msos_suspend, }; static const uint8_t qemu_mouse_hid_report_descriptor[] = { 0x05, 0x01, /* Usage Page (Generic Desktop) */ 0x09, 0x02, /* Usage (Mouse) */ Loading Loading @@ -674,7 +737,7 @@ static void usb_mouse_realize(USBDevice *dev, Error **errp) static void usb_keyboard_realize(USBDevice *dev, Error **errp) { usb_hid_initfn(dev, HID_KEYBOARD, &desc_keyboard, NULL, errp); usb_hid_initfn(dev, HID_KEYBOARD, &desc_keyboard, &desc_keyboard2, errp); } static int usb_ptr_post_load(void *opaque, int version_id) Loading Loading @@ -774,6 +837,7 @@ static const TypeInfo usb_mouse_info = { }; static Property usb_keyboard_properties[] = { DEFINE_PROP_UINT32("usb_version", USBHIDState, usb_version, 2), DEFINE_PROP_STRING("display", USBHIDState, display), DEFINE_PROP_END_OF_LIST(), }; Loading
include/hw/i386/pc.h +4 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "usb-mouse",\ .property = "usb_version",\ .value = stringify(1),\ },{\ .driver = "usb-kbd",\ .property = "usb_version",\ .value = stringify(1),\ } #define PC_COMPAT_2_0 \ Loading