qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value
@ 2012-03-30  7:53 Hans de Goede
  2012-03-30  7:53 ` [Qemu-devel] [PATCH 2/2] usb-redir: Notify our peer when we reject a device due to a speed mismatch Hans de Goede
  2012-03-30  9:02 ` [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value Gerd Hoffmann
  0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2012-03-30  7:53 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel

The sofv value only ever gets a value assigned and is never used (read)
anywhere, so we can just drop it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/hcd-ehci.c |    8 --------
 1 file changed, 8 deletions(-)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 53c3c8f..64b58e3 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -403,7 +403,6 @@ struct EHCIState {
     /*
      *  Internal states, shadow registers, etc
      */
-    uint32_t sofv;
     QEMUTimer *frame_timer;
     int attach_poll_counter;
     int astate;                        // Current state in asynchronous schedule
@@ -1103,10 +1102,6 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
         val &= USBINTR_MASK;
         break;
 
-    case FRINDEX:
-        s->sofv = val >> 3;
-        break;
-
     case CONFIGFLAG:
         val &= 0x1;
         if (val) {
@@ -2158,9 +2153,6 @@ static void ehci_frame_timer(void *opaque)
                 ehci_set_interrupt(ehci, USBSTS_FLR);
                 ehci->frindex = 0;
             }
-
-            ehci->sofv = (ehci->frindex - 1) >> 3;
-            ehci->sofv &= 0x000003ff;
         }
 
         if (frames - i > ehci->maxframes) {
-- 
1.7.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] usb-redir: Notify our peer when we reject a device due to a speed mismatch
  2012-03-30  7:53 [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value Hans de Goede
@ 2012-03-30  7:53 ` Hans de Goede
  2012-03-30  9:02 ` [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2012-03-30  7:53 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel

Also cleanup (reset) our device state when we reject a device due to a
speed mismatch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/redirect.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 8e9f175..c9d22e4 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -835,7 +835,13 @@ static void usbredir_do_attach(void *opaque)
 {
     USBRedirDevice *dev = opaque;
 
-    usb_device_attach(&dev->dev);
+    if (usb_device_attach(&dev->dev) != 0) {
+        usbredir_device_disconnect(dev);
+        if (usbredirparser_peer_has_cap(dev->parser, usb_redir_cap_filter)) {
+            usbredirparser_send_filter_reject(dev->parser);
+            usbredirparser_do_write(dev->parser);
+        }
+    }
 }
 
 /*
-- 
1.7.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value
  2012-03-30  7:53 [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value Hans de Goede
  2012-03-30  7:53 ` [Qemu-devel] [PATCH 2/2] usb-redir: Notify our peer when we reject a device due to a speed mismatch Hans de Goede
@ 2012-03-30  9:02 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2012-03-30  9:02 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

On 03/30/12 09:53, Hans de Goede wrote:
> The sofv value only ever gets a value assigned and is never used (read)
> anywhere, so we can just drop it.

Both patches added to usb patch queue.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-30  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30  7:53 [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value Hans de Goede
2012-03-30  7:53 ` [Qemu-devel] [PATCH 2/2] usb-redir: Notify our peer when we reject a device due to a speed mismatch Hans de Goede
2012-03-30  9:02 ` [Qemu-devel] [PATCH 1/2] usb-ehci: Drop unused sofv value Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).