usb: Make port wakeup and complete ops take a USBPort instead of a Device

This makes them consistent with the attach and detach ops, and in general
it makes sense to make portops take a port as argument. This also makes
adding support for a companion controller easier / cleaner.

[ kraxel: fix usb-musb.c build ]

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2011-06-21 11:52:28 +02:00 committed by Gerd Hoffmann
parent ae60fea97c
commit d47e59b8b8
7 changed files with 28 additions and 26 deletions

View file

@ -246,10 +246,10 @@ static void usb_hub_detach(USBPort *port1)
}
}
static void usb_hub_wakeup(USBDevice *dev)
static void usb_hub_wakeup(USBPort *port1)
{
USBHubState *s = dev->port->opaque;
USBHubPort *port = &s->ports[dev->port->index];
USBHubState *s = port1->opaque;
USBHubPort *port = &s->ports[port1->index];
if (port->wPortStatus & PORT_STAT_SUSPEND) {
port->wPortChange |= PORT_STAT_C_SUSPEND;
@ -257,9 +257,9 @@ static void usb_hub_wakeup(USBDevice *dev)
}
}
static void usb_hub_complete(USBDevice *dev, USBPacket *packet)
static void usb_hub_complete(USBPort *port, USBPacket *packet)
{
USBHubState *s = dev->port->opaque;
USBHubState *s = port->opaque;
/*
* Just pass it along upstream for now.