Skip to contentSkip to conversation

Fix USB mouse Set_Protocol behavior

PATCH New Kevin O'Connor 1 participant 1 message Aug 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix USB mouse Set_Protocol behavior

The QEMU USB mouse claims to support the "boot" protocol (bInterfaceSubClass is 1). However, the mouse rejects the Set_Protocol command.

The qemu mouse does support the "boot" protocol specification, so a simple fix is to enable the Set_Protocol request.

---
Changes v1->v2:
Add signed-off-by line.

---
 hw/usb-hid.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/usb-hid.c +2 -2
index 882d933..d54823d 100644
@@ -791,13 +791,13 @@ static int usb_hid_handle_control(USBDevice *dev, int request, int value,
             goto fail;
         break;
     case GET_PROTOCOL:
-        if (s->kind != USB_KEYBOARD)
+        if (s->kind != USB_KEYBOARD && s->kind != USB_MOUSE)
             goto fail;
         ret = 1;
         data[0] = s->protocol;
         break;
     case SET_PROTOCOL:
-        if (s->kind != USB_KEYBOARD)
+        if (s->kind != USB_KEYBOARD && s->kind != USB_MOUSE)
             goto fail;
         ret = 0;
         s->protocol = value;
Signature · 1 line
1.7.2