From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVaBn-0003vx-Iq for qemu-devel@nongnu.org; Thu, 03 Apr 2014 01:27:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVaBm-0004za-Gz for qemu-devel@nongnu.org; Thu, 03 Apr 2014 01:27:47 -0400 Received: from mail-qa0-x231.google.com ([2607:f8b0:400d:c00::231]:60320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVaBm-0004zV-AU for qemu-devel@nongnu.org; Thu, 03 Apr 2014 01:27:46 -0400 Received: by mail-qa0-f49.google.com with SMTP id j7so1160808qaq.22 for ; Wed, 02 Apr 2014 22:27:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1392639007.26953.28.camel@nilsson.home.kraxel.org> <1393141071-14204-1-git-send-email-jano.vesely@gmail.com> Date: Thu, 3 Apr 2014 01:27:45 -0400 Message-ID: From: =?UTF-8?B?SsOhbiBWZXNlbMO9?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/2] usb-hid: Add high speed mouse configuration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Cc: Gerd Hoffmann ping2 is there anything I can do to help these patches get merged? Jan On Mon, Mar 17, 2014 at 1:53 PM, J=C3=A1n Vesel=C3=BD wrote: > ping > > any problem with v2? > > regards, > Jan > > On Sun, Feb 23, 2014 at 2:37 AM, Jan Vesely wrote= : >> v2: add usb_mouse_properties >> use macros for bmAttributes >> >> Signed-off-by: Jan Vesely >> --- >> hw/usb/dev-hid.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++= ------- >> 1 file changed, 65 insertions(+), 8 deletions(-) >> >> diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c >> index f36e617..70c2c5f 100644 >> --- a/hw/usb/dev-hid.c >> +++ b/hw/usb/dev-hid.c >> @@ -55,9 +55,10 @@ enum { >> STR_PRODUCT_TABLET, >> STR_PRODUCT_KEYBOARD, >> STR_SERIALNUMBER, >> - STR_CONFIG_MOUSE, >> STR_CONFIG_TABLET, >> STR_CONFIG_KEYBOARD, >> + STR_CONFIG_MOUSE_FULL, >> + STR_CONFIG_MOUSE_HIGH, >> }; >> >> static const USBDescStrings desc_strings =3D { >> @@ -66,12 +67,13 @@ static const USBDescStrings desc_strings =3D { >> [STR_PRODUCT_TABLET] =3D "QEMU USB Tablet", >> [STR_PRODUCT_KEYBOARD] =3D "QEMU USB Keyboard", >> [STR_SERIALNUMBER] =3D "42", /* =3D=3D remote wakeup works */ >> - [STR_CONFIG_MOUSE] =3D "HID Mouse", >> [STR_CONFIG_TABLET] =3D "HID Tablet", >> [STR_CONFIG_KEYBOARD] =3D "HID Keyboard", >> + [STR_CONFIG_MOUSE_FULL]=3D "HID Mouse Full speed configuration (usb= 1.1)", >> + [STR_CONFIG_MOUSE_HIGH]=3D "HID Mouse High speed configuration (usb= 2.0)", >> }; >> >> -static const USBDescIface desc_iface_mouse =3D { >> +static const USBDescIface desc_iface_mouse_full =3D { >> .bInterfaceNumber =3D 0, >> .bNumEndpoints =3D 1, >> .bInterfaceClass =3D USB_CLASS_HID, >> @@ -102,6 +104,37 @@ static const USBDescIface desc_iface_mouse =3D { >> }, >> }; >> >> +static const USBDescIface desc_iface_mouse_high =3D { >> + .bInterfaceNumber =3D 0, >> + .bNumEndpoints =3D 1, >> + .bInterfaceClass =3D USB_CLASS_HID, >> + .bInterfaceSubClass =3D 0x01, /* boot */ >> + .bInterfaceProtocol =3D 0x02, >> + .ndesc =3D 1, >> + .descs =3D (USBDescOther[]) { >> + { >> + /* HID descriptor */ >> + .data =3D (uint8_t[]) { >> + 0x09, /* u8 bLength */ >> + USB_DT_HID, /* u8 bDescriptorType */ >> + 0x01, 0x00, /* u16 HID_class */ >> + 0x00, /* u8 country_code */ >> + 0x01, /* u8 num_descriptors */ >> + USB_DT_REPORT, /* u8 type: Report */ >> + 52, 0, /* u16 len */ >> + }, >> + }, >> + }, >> + .eps =3D (USBDescEndpoint[]) { >> + { >> + .bEndpointAddress =3D USB_DIR_IN | 0x01, >> + .bmAttributes =3D USB_ENDPOINT_XFER_INT, >> + .wMaxPacketSize =3D 4, >> + .bInterval =3D 0x06, >> + }, >> + }, >> +}; >> + >> static const USBDescIface desc_iface_tablet =3D { >> .bInterfaceNumber =3D 0, >> .bNumEndpoints =3D 1, >> @@ -193,19 +226,36 @@ static const USBDescIface desc_iface_keyboard =3D = { >> }, >> }; >> >> -static const USBDescDevice desc_device_mouse =3D { >> - .bcdUSB =3D 0x0100, >> +static const USBDescDevice desc_device_mouse_full =3D { >> + .bcdUSB =3D 0x0200, >> + .bMaxPacketSize0 =3D 8, >> + .bNumConfigurations =3D 1, >> + .confs =3D (USBDescConfig[]) { >> + { >> + .bNumInterfaces =3D 1, >> + .bConfigurationValue =3D 1, >> + .iConfiguration =3D STR_CONFIG_MOUSE_FULL, >> + .bmAttributes =3D USB_CFG_ATT_ONE | USB_CFG_ATT_WA= KEUP, >> + .bMaxPower =3D 50, >> + .nif =3D 1, >> + .ifs =3D &desc_iface_mouse_full, >> + }, >> + }, >> +}; >> + >> +static const USBDescDevice desc_device_mouse_high =3D { >> + .bcdUSB =3D 0x0200, >> .bMaxPacketSize0 =3D 8, >> .bNumConfigurations =3D 1, >> .confs =3D (USBDescConfig[]) { >> { >> .bNumInterfaces =3D 1, >> .bConfigurationValue =3D 1, >> - .iConfiguration =3D STR_CONFIG_MOUSE, >> + .iConfiguration =3D STR_CONFIG_MOUSE_HIGH, >> .bmAttributes =3D USB_CFG_ATT_ONE | USB_CFG_ATT_WA= KEUP, >> .bMaxPower =3D 50, >> .nif =3D 1, >> - .ifs =3D &desc_iface_mouse, >> + .ifs =3D &desc_iface_mouse_high, >> }, >> }, >> }; >> @@ -274,7 +324,8 @@ static const USBDesc desc_mouse =3D { >> .iProduct =3D STR_PRODUCT_MOUSE, >> .iSerialNumber =3D STR_SERIALNUMBER, >> }, >> - .full =3D &desc_device_mouse, >> + .full =3D &desc_device_mouse_full, >> + .high =3D &desc_device_mouse_high, >> .str =3D desc_strings, >> .msos =3D &desc_msos_suspend, >> }; >> @@ -676,6 +727,11 @@ static const TypeInfo usb_tablet_info =3D { >> .class_init =3D usb_tablet_class_initfn, >> }; >> >> +static Property usb_mouse_properties[] =3D { >> + DEFINE_PROP_UINT32("usb_version", USBHIDState, usb_version, 2), >> + DEFINE_PROP_END_OF_LIST(), >> +}; >> + >> static void usb_mouse_class_initfn(ObjectClass *klass, void *data) >> { >> DeviceClass *dc =3D DEVICE_CLASS(klass); >> @@ -686,6 +742,7 @@ static void usb_mouse_class_initfn(ObjectClass *klas= s, void *data) >> uc->product_desc =3D "QEMU USB Mouse"; >> uc->usb_desc =3D &desc_mouse; >> dc->vmsd =3D &vmstate_usb_ptr; >> + dc->props =3D usb_mouse_properties; >> set_bit(DEVICE_CATEGORY_INPUT, dc->categories); >> } >> >> -- >> 1.9.0 >>