qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Large USB patch


From: Lonnie Mendez
Subject: Re: [Qemu-devel] Large USB patch
Date: Sat, 29 Apr 2006 19:46:13 -0500
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]