lo. The attached patch addresses the problem with removing the usbhub/tablet devices and switches the handle_packet call in the port reset call to handle_msg which just happens to make the hub functional.
--- a/qemu/hw/usb-hub.c 2006-04-28 19:44:18.000000000 -0500
+++ b/qemu/hw/usb-hub.c 2006-04-29 18:55:46.000000000 -0500
@@ -240,6 +240,13 @@
     return 1;
 }
 
+int usb_hub_handle_close(USBDevice *dev)
+{
+    USBHubState *s = (USBHubState *)(dev->opaque);
+    qemu_free(s);
+    return 1;
+}
+
 int usb_hub_handle_control(USBDevice *dev, int request, int value,
                            int index, int length, uint8_t *data)
 {
@@ -385,8 +392,7 @@
                 break;
             case PORT_RESET:
                 if (dev) {
-                    dev->handle_packet(dev, 
-                                       USB_MSG_RESET, 0, 0, NULL, 0);
+                    dev->handle_msg(dev, USB_MSG_RESET);
                     port->wPortChange |= PORT_STAT_C_RESET;
                     /* set enable bit */
 //                    port->wPortChange |= PORT_STAT_C_ENABLE;
@@ -578,6 +584,7 @@
     dev->handle_packet=         usb_hub_handle_packet;
     dev->handle_attach=         usb_hub_attach;
     dev->handle_reset=          usb_hub_handle_reset;
+    dev->handle_close=          usb_hub_handle_close;
     dev->handle_control=        usb_hub_handle_control;
     dev->handle_data=           usb_hub_handle_data;
 
--- a/qemu/hw/usb-hid.c 2006-04-28 19:44:18.000000000 -0500
+++ b/qemu/hw/usb-hid.c 2006-04-29 18:56:15.000000000 -0500
@@ -526,6 +526,7 @@
     dev->handle_packet=     usb_generic_handle_packet;
 
     dev->handle_reset=      usb_mouse_handle_reset;
+    dev->handle_close=      usb_mouse_handle_close;
     dev->handle_control=    usb_mouse_handle_control;
     dev->handle_data=       usb_mouse_handle_data;
     s->kind=                USB_TABLET;
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to