[pve-devel] [PATCH] remove usb fixes and add libacard fix

Derumier Alexandre aderumier at odiso.com
Sun Mar 11 17:37:43 CET 2012


Signed-off-by: Derumier Alexandre <aderumier at odiso.com>
---
 .../libacard-fix-compilaton-with-gcc.4.7.diff      |   17 +++++
 debian/patches/series                              |    3 +-
 .../usb-desc-fix-user-trigerrable-segfaults.diff   |   76 --------------------
 debian/patches/usb-hid-fix-tablet-activation.diff  |   24 ------
 4 files changed, 18 insertions(+), 102 deletions(-)
 create mode 100644 debian/patches/libacard-fix-compilaton-with-gcc.4.7.diff
 delete mode 100644 debian/patches/usb-desc-fix-user-trigerrable-segfaults.diff
 delete mode 100644 debian/patches/usb-hid-fix-tablet-activation.diff

diff --git a/debian/patches/libacard-fix-compilaton-with-gcc.4.7.diff b/debian/patches/libacard-fix-compilaton-with-gcc.4.7.diff
new file mode 100644
index 0000000..e46a126
--- /dev/null
+++ b/debian/patches/libacard-fix-compilaton-with-gcc.4.7.diff
@@ -0,0 +1,17 @@
+http://patchwork.ozlabs.org/patch/144276/
+
+diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
+index d4d8e2e..d3e9522 100644
+--- a/libcacard/vcardt.h
++++ b/libcacard/vcardt.h
+@@ -26,8 +26,8 @@  typedef struct VCardEmulStruct VCardEmul;
+ #define MAX_CHANNEL 4
+ 
+ /* create an ATR with appropriate historical bytes */
+-#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
+-                               'V', 'C', 'A', 'R', 'D', '_')
++#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
++                               'V', 'C', 'A', 'R', 'D', '_'
+ 
+ 
+ typedef enum {
diff --git a/debian/patches/series b/debian/patches/series
index 0bfa296..767ccfd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,5 +5,4 @@ keymap.diff
 set-max-nics.patch
 pve-auth.patch
 update-target-x86_64.conf-to-rhel6.2-version.patch
-usb-hid-fix-tablet-activation.diff
-usb-desc-fix-user-trigerrable-segfaults.diff
+libacard-fix-compilaton-with-gcc.4.7.diff
diff --git a/debian/patches/usb-desc-fix-user-trigerrable-segfaults.diff b/debian/patches/usb-desc-fix-user-trigerrable-segfaults.diff
deleted file mode 100644
index 37edb74..0000000
--- a/debian/patches/usb-desc-fix-user-trigerrable-segfaults.diff
+++ /dev/null
@@ -1,76 +0,0 @@
-From: Alon Levy <alevy at redhat.com>
-
-Check for dev->config being NULL in two places:
- USB_REQ_GET_CONFIGURATION and USB_REQ_GET_STATUS.
-
-The behavior of USB_REQ_GET_STATUS is unspecified in the Default state,
-that corresponds to dev->config being NULL (it defaults to NULL and is
-reset whenever a SET_CONFIGURATION with value 0, or attachment). I
-implemented it to correspond with the state before
-ed5a83ddd8c1d8ec7b1015315530cf29949e7c48, the commit moving SET_STATUS
-to usb-desc; if dev->config is not set we return whatever is in the
-first configuration.
-
-The behavior of USB_REQ_GET_CONFIGURATION is also undefined before any
-SET_CONFIGURATION, but here we just return 0 (same as specified for the
-Address state).
-
-A win7 guest failed to initialize the device before this patch,
-segfaulting when GET_STATUS was called with dev->config == NULL. With
-this patch the passthrough device still doesn't work but the failure is
-unrelated.
-
-Signed-off-by: Alon Levy <alevy at redhat.com>
-Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
----
- hw/usb-desc.c |   20 +++++++++++++++++---
- 1 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/hw/usb-desc.c b/hw/usb-desc.c
-index 3c3ed6a..ccf85ad 100644
---- a/hw/usb-desc.c
-+++ b/hw/usb-desc.c
-@@ -536,7 +536,11 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
-         break;
- 
-     case DeviceRequest | USB_REQ_GET_CONFIGURATION:
--        data[0] = dev->config->bConfigurationValue;
-+        /*
-+         * 9.4.2: 0 should be returned if the device is unconfigured, otherwise
-+         * the non zero value of bConfigurationValue.
-+         */
-+        data[0] = dev->config ? dev->config->bConfigurationValue : 0;
-         ret = 1;
-         break;
-     case DeviceOutRequest | USB_REQ_SET_CONFIGURATION:
-@@ -544,9 +548,18 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
-         trace_usb_set_config(dev->addr, value, ret);
-         break;
- 
--    case DeviceRequest | USB_REQ_GET_STATUS:
-+    case DeviceRequest | USB_REQ_GET_STATUS: {
-+        const USBDescConfig *config = dev->config ?
-+            dev->config : &dev->device->confs[0];
-+
-         data[0] = 0;
--        if (dev->config->bmAttributes & 0x40) {
-+        /*
-+         * Default state: Device behavior when this request is received while
-+         *                the device is in the Default state is not specified.
-+         * We return the same value that a configured device would return if
-+         * it used the first configuration.
-+         */
-+        if (config->bmAttributes & 0x40) {
-             data[0] |= 1 << USB_DEVICE_SELF_POWERED;
-         }
-         if (dev->remote_wakeup) {
-@@ -555,6 +568,7 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
-         data[1] = 0x00;
-         ret = 2;
-         break;
-+    }
-     case DeviceOutRequest | USB_REQ_CLEAR_FEATURE:
-         if (value == USB_DEVICE_REMOTE_WAKEUP) {
-             dev->remote_wakeup = 0;
--- 
-1.7.1
diff --git a/debian/patches/usb-hid-fix-tablet-activation.diff b/debian/patches/usb-hid-fix-tablet-activation.diff
deleted file mode 100644
index c6ee81c..0000000
--- a/debian/patches/usb-hid-fix-tablet-activation.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-Activate usb hid pointer devices (mouse+tablet) unconditionally
-on polls, even if we NAK the poll due to lack of new events.
-
-Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
----
- hw/usb-hid.c |    3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/hw/usb-hid.c b/hw/usb-hid.c
-index 7fc0bd8..37bca78 100644
---- a/hw/usb-hid.c
-+++ b/hw/usb-hid.c
-@@ -466,6 +466,9 @@ static int usb_hid_handle_data(USBDevice *dev, USBPacket *p)
-     case USB_TOKEN_IN:
-         if (p->ep->nr == 1) {
-             int64_t curtime = qemu_get_clock_ns(vm_clock);
-+            if (hs->kind == HID_MOUSE || hs->kind == HID_TABLET) {
-+                hid_pointer_activate(hs);
-+            }
-             if (!hid_has_events(hs) &&
-                 (!hs->idle || hs->next_idle_clock - curtime > 0)) {
-                 return USB_RET_NAK;
--- 
-1.7.1
-- 
1.7.2.5




More information about the pve-devel mailing list