qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 21/30] usb: hid: change serial number to "42".


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 21/30] usb: hid: change serial number to "42".
Date: Fri, 17 Dec 2010 12:26:37 +0100

It would be nice to have some way to signal our hid devices support
remote wakeup.  There is a descriptor bit for that of course.  Problem
with using is one is that older qemu versions used to set the bit even
though they did *not* support remote wakeup.  Bummer.

This patch changes the serial number of our hid devices from "1" to "42"
to signal "it is safe to enable remote wakeup".  The serial number was
choosen because it isn't used for anything and it is available in sysfs
so it is easy to match it using udev rules like this:

ACTION=="add", SUBSYSTEM=="usb", \
        ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", \
        RUN+="usb_enable_autosuspend %p"

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 hw/usb-hid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index 60fa57f..1fec163 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -90,7 +90,7 @@ static const USBDescStrings desc_strings = {
     [STR_PRODUCT_MOUSE]    = "QEMU USB Mouse",
     [STR_PRODUCT_TABLET]   = "QEMU USB Tablet",
     [STR_PRODUCT_KEYBOARD] = "QEMU USB Keyboard",
-    [STR_SERIALNUMBER]     = "1",
+    [STR_SERIALNUMBER]     = "42", /* == remote wakeup works */
     [STR_CONFIG_MOUSE]     = "HID Mouse",
     [STR_CONFIG_TABLET]    = "HID Tablet",
     [STR_CONFIG_KEYBOARD]  = "HID Keyboard",
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]