[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/10] usb-hub: report status changes only once
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 08/10] usb-hub: report status changes only once |
Date: |
Wed, 3 Apr 2013 11:43:38 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/dev-hub.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index a5f092b..0b71abd 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -33,6 +33,7 @@ typedef struct USBHubPort {
USBPort port;
uint16_t wPortStatus;
uint16_t wPortChange;
+ uint16_t wPortChange_reported;
} USBHubPort;
typedef struct USBHubState {
@@ -467,8 +468,11 @@ static void usb_hub_handle_data(USBDevice *dev, USBPacket
*p)
status = 0;
for(i = 0; i < NUM_PORTS; i++) {
port = &s->ports[i];
- if (port->wPortChange)
+ if (port->wPortChange &&
+ port->wPortChange_reported != port->wPortChange) {
status |= (1 << (i + 1));
+ }
+ port->wPortChange_reported = port->wPortChange;
}
if (status != 0) {
for(i = 0; i < n; i++) {
--
1.7.9.7
- [Qemu-devel] [PULL 00/10] usb patch queue, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 04/10] xhci: remove leftover debug printf, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 06/10] xhci: zap unused name field, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 01/10] usb-redir: Fix crash on migration with no client connected, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 07/10] usb-hub: limit chain length, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 02/10] usb-redir: Add flow control support, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 08/10] usb-hub: report status changes only once,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 09/10] usb: update docs for bus name change, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 03/10] xhci: fix numintrs sanity checks, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 05/10] xhci: remove unimplemented printfs, Gerd Hoffmann, 2013/04/03
- [Qemu-devel] [PATCH 10/10] usb-tablet: Don't claim wakeup capability for USB-2 version, Gerd Hoffmann, 2013/04/03