summary refs log tree commit diff stats
path: root/hw/usb/dev-wacom.c
diff options
context:
space:
mode:
authorCésar Belley <cesar.belley@lse.epita.fr>2020-08-12 11:41:23 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-08-31 08:10:47 +0200
commit84b6c23629df888f1c11cace155704a97a239f7c (patch)
treebc291ed486754b010fe53ed4813b2b8f8d6eab62 /hw/usb/dev-wacom.c
parent10b2d90c947e557a2ec5c58919d2b5ad3c400c50 (diff)
downloadfocaccia-qemu-84b6c23629df888f1c11cace155704a97a239f7c.tar.gz
focaccia-qemu-84b6c23629df888f1c11cace155704a97a239f7c.zip
hw/usb: Regroup USB HID protocol values
Group some HID values that are used pretty much everywhere when
dealing with HID devices.

Signed-off-by: César Belley <cesar.belley@lse.epita.fr>
Message-id: 20200812094135.20550-2-cesar.belley@lse.epita.fr
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-wacom.c')
-rw-r--r--hw/usb/dev-wacom.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c
index 8aba44b8bc..76fc5a5dab 100644
--- a/hw/usb/dev-wacom.c
+++ b/hw/usb/dev-wacom.c
@@ -29,6 +29,7 @@
 #include "qemu/osdep.h"
 #include "ui/console.h"
 #include "hw/usb.h"
+#include "hw/usb/hid.h"
 #include "migration/vmstate.h"
 #include "qemu/module.h"
 #include "desc.h"
@@ -37,13 +38,6 @@
 #define WACOM_GET_REPORT	0x2101
 #define WACOM_SET_REPORT	0x2109
 
-/* HID interface requests */
-#define HID_GET_REPORT		0xa101
-#define HID_GET_IDLE		0xa102
-#define HID_GET_PROTOCOL	0xa103
-#define HID_SET_IDLE		0x210a
-#define HID_SET_PROTOCOL	0x210b
-
 typedef struct USBWacomState {
     USBDevice dev;
     USBEndpoint *intr;
@@ -86,11 +80,11 @@ static const USBDescIface desc_iface_wacom = {
             /* HID descriptor */
             .data = (uint8_t[]) {
                 0x09,          /*  u8  bLength */
-                0x21,          /*  u8  bDescriptorType */
+                USB_DT_HID,    /*  u8  bDescriptorType */
                 0x01, 0x10,    /*  u16 HID_class */
                 0x00,          /*  u8  country_code */
                 0x01,          /*  u8  num_descriptors */
-                0x22,          /*  u8  type: Report */
+                USB_DT_REPORT, /*  u8  type: Report */
                 0x6e, 0,       /*  u16 len */
             },
         },