qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset
@ 2011-11-22  8:52 hkran
  0 siblings, 0 replies; 6+ messages in thread
From: hkran @ 2011-11-22  8:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: hkran, Stefan Hajnoczi, Gerd Hoffmann

Implement the function usb_hub_handle_reset. without it the guest 
propablly fail to configure the usb device attached to the virtulized 
hub with a correct address.

Typically, attaching more than one usb devices when lauch qemu may lead 
to the problem.


Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
---
  hw/usb-hub.c |   13 ++++++++++++-
  1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 3eb0f1a..6731075 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -220,7 +220,18 @@ static void usb_hub_complete(USBPort *port, 
USBPacket *packet)

  static void usb_hub_handle_reset(USBDevice *dev)
  {
-    /* XXX: do it */
+    USBHubPort *port = NULL;
+    USBHubState *s = (USBHubState *)dev;
+    int i;
+
+    for(i = 0; i < NUM_PORTS; i++) {
+        port = &(s->ports[i]);
+        if(port->wPortStatus & PORT_STAT_CONNECTION) {
+            usb_reset(&port->port);
+            port->wPortStatus = PORT_STAT_CONNECTION | PORT_STAT_POWER;
+            port->wPortChange = PORT_STAT_C_CONNECTION;
+        }
+    }
  }

  static int usb_hub_handle_control(USBDevice *dev, USBPacket *p,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset
@ 2011-11-22  9:08 hkran
  0 siblings, 0 replies; 6+ messages in thread
From: hkran @ 2011-11-22  9:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha


Implement the function usb_hub_handle_reset. without it the guest  
propablly fail to configure the usb device attached to the virtulized  
hub with a correct address.

Typically, attaching more than one usb devices when lauch qemu may  
lead to the problem.


Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
---
  hw/usb-hub.c |   13 ++++++++++++-
  1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 3eb0f1a..6731075 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -220,7 +220,18 @@ static void usb_hub_complete(USBPort *port,  
USBPacket *packet)

  static void usb_hub_handle_reset(USBDevice *dev)
  {
-    /* XXX: do it */
+    USBHubPort *port = NULL;
+    USBHubState *s = (USBHubState *)dev;
+    int i;
+
+    for(i = 0; i < NUM_PORTS; i++) {
+        port = &(s->ports[i]);
+        if(port->wPortStatus & PORT_STAT_CONNECTION) {
+            usb_reset(&port->port);
+            port->wPortStatus = PORT_STAT_CONNECTION | PORT_STAT_POWER;
+            port->wPortChange = PORT_STAT_C_CONNECTION;
+        }
+    }
  }

  static int usb_hub_handle_control(USBDevice *dev, USBPacket *p,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset
@ 2011-11-22  8:58 hkran
  2011-11-22 12:36 ` Gerd Hoffmann
  0 siblings, 1 reply; 6+ messages in thread
From: hkran @ 2011-11-22  8:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Gerd Hoffmann

Implement the function usb_hub_handle_reset. without it the guest 
propablly fail to configure the usb device attached to the virtulized 
hub with a correct address.

Typically, attaching more than one usb devices when lauch qemu may lead 
to the problem.


Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
---
  hw/usb-hub.c |   13 ++++++++++++-
  1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 3eb0f1a..6731075 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -220,7 +220,18 @@ static void usb_hub_complete(USBPort *port, 
USBPacket *packet)

  static void usb_hub_handle_reset(USBDevice *dev)
  {
-    /* XXX: do it */
+    USBHubPort *port = NULL;
+    USBHubState *s = (USBHubState *)dev;
+    int i;
+
+    for(i = 0; i < NUM_PORTS; i++) {
+        port = &(s->ports[i]);
+        if(port->wPortStatus & PORT_STAT_CONNECTION) {
+            usb_reset(&port->port);
+            port->wPortStatus = PORT_STAT_CONNECTION | PORT_STAT_POWER;
+            port->wPortChange = PORT_STAT_C_CONNECTION;
+        }
+    }
  }

  static int usb_hub_handle_control(USBDevice *dev, USBPacket *p,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset
@ 2011-11-22  8:37 hkran
  0 siblings, 0 replies; 6+ messages in thread
From: hkran @ 2011-11-22  8:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Gerd Hoffmann

Implement the function usb_hub_handle_reset. without it the guest 
propablly fail to configure the usb device attached to the virtulized 
hub with a correct address.

Typically, attaching more than one usb devices when lauch qemu may lead 
to the problem.


Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
---
  hw/usb-hub.c |   13 ++++++++++++-
  1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 3eb0f1a..6731075 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -220,7 +220,18 @@ static void usb_hub_complete(USBPort *port, 
USBPacket *packet)

  static void usb_hub_handle_reset(USBDevice *dev)
  {
-    /* XXX: do it */
+    USBHubPort *port = NULL;
+    USBHubState *s = (USBHubState *)dev;
+    int i;
+
+    for(i = 0; i < NUM_PORTS; i++) {
+        port = &(s->ports[i]);
+        if(port->wPortStatus & PORT_STAT_CONNECTION) {
+            usb_reset(&port->port);
+            port->wPortStatus = PORT_STAT_CONNECTION | PORT_STAT_POWER;
+            port->wPortChange = PORT_STAT_C_CONNECTION;
+        }
+    }
  }

  static int usb_hub_handle_control(USBDevice *dev, USBPacket *p,
-- 
1.7.1

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

end of thread, other threads:[~2011-11-23  3:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22  8:52 [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset hkran
  -- strict thread matches above, loose matches on Subject: below --
2011-11-22  9:08 hkran
2011-11-22  8:58 hkran
2011-11-22 12:36 ` Gerd Hoffmann
2011-11-23  3:16   ` hkran
2011-11-22  8:37 hkran

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).