From d28f4e2d86317f7ef7398651e8a1d493e4bf8c88 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 6 Jan 2012 15:23:10 +0100 Subject: usb: kill USB_MSG_RESET The USB subsystem pipes internal reset notifications through usb_handle_packet() with a special magic PID. This indirection is a pretty pointless excercise as it ends up being handled by usb_generic_handle_packet anyway. Replace the USB_MSG_RESET with a usb_device_reset() function which can be called directly. Also rename the existing usb_reset() function to usb_port_reset() to avoid confusion. Signed-off-by: Gerd Hoffmann --- hw/usb-uhci.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'hw/usb-uhci.c') diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index e0c7dbb71a..407e0f3a5a 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -342,7 +342,7 @@ static void uhci_reset(void *opaque) port = &s->ports[i]; port->ctrl = 0x0080; if (port->port.dev && port->port.dev->attached) { - usb_reset(&port->port); + usb_port_reset(&port->port); } } @@ -440,16 +440,12 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val) } if (val & UHCI_CMD_GRESET) { UHCIPort *port; - USBDevice *dev; int i; /* send reset on the USB bus */ for(i = 0; i < NB_PORTS; i++) { port = &s->ports[i]; - dev = port->port.dev; - if (dev && dev->attached) { - usb_send_msg(dev, USB_MSG_RESET); - } + usb_device_reset(port->port.dev); } uhci_reset(s); return; @@ -491,7 +487,7 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val) /* port reset */ if ( (val & UHCI_PORT_RESET) && !(port->ctrl & UHCI_PORT_RESET) ) { - usb_send_msg(dev, USB_MSG_RESET); + usb_device_reset(dev); } } port->ctrl &= UHCI_PORT_READ_ONLY; -- cgit v1.2.3