diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-11-06 16:13:29 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-11-06 16:13:29 +0000 |
commit | a594cfbf3e1a38bc6f3908d7d0903d41e8ea9da8 (patch) | |
tree | 08a6cbb83a11db3d8c675b95cfe427dcd981ce81 /hw/usb.c | |
parent | 8738a8d079b661a612e89612844dc270ef5f0924 (diff) | |
download | qemu-a594cfbf3e1a38bc6f3908d7d0903d41e8ea9da8.zip qemu-a594cfbf3e1a38bc6f3908d7d0903d41e8ea9da8.tar.gz qemu-a594cfbf3e1a38bc6f3908d7d0903d41e8ea9da8.tar.bz2 |
USB user interface
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1603 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/usb.c')
-rw-r--r-- | hw/usb.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -201,7 +201,6 @@ int set_usb_string(uint8_t *buf, const char *str) typedef struct USBHubPort { USBPort port; - USBDevice *dev; uint16_t wPortStatus; uint16_t wPortChange; } USBHubPort; @@ -342,7 +341,7 @@ static void usb_hub_attach(USBPort *port1, USBDevice *dev) USBHubPort *port = &s->ports[port1->index]; if (dev) { - if (port->dev) + if (port->port.dev) usb_attach(port1, NULL); port->wPortStatus |= PORT_STAT_CONNECTION; @@ -351,9 +350,9 @@ static void usb_hub_attach(USBPort *port1, USBDevice *dev) port->wPortStatus |= PORT_STAT_LOW_SPEED; else port->wPortStatus &= ~PORT_STAT_LOW_SPEED; - port->dev = dev; + port->port.dev = dev; } else { - dev = port->dev; + dev = port->port.dev; if (dev) { port->wPortStatus &= ~PORT_STAT_CONNECTION; port->wPortChange |= PORT_STAT_C_CONNECTION; @@ -361,7 +360,7 @@ static void usb_hub_attach(USBPort *port1, USBDevice *dev) port->wPortStatus &= ~PORT_STAT_ENABLE; port->wPortChange |= PORT_STAT_C_ENABLE; } - port->dev = NULL; + port->port.dev = NULL; } } } @@ -498,7 +497,7 @@ static int usb_hub_handle_control(USBDevice *dev, int request, int value, if (n >= s->nb_ports) goto fail; port = &s->ports[n]; - dev = port->dev; + dev = port->port.dev; switch(value) { case PORT_SUSPEND: port->wPortStatus |= PORT_STAT_SUSPEND; @@ -529,7 +528,7 @@ static int usb_hub_handle_control(USBDevice *dev, int request, int value, if (n >= s->nb_ports) goto fail; port = &s->ports[n]; - dev = port->dev; + dev = port->port.dev; switch(value) { case PORT_ENABLE: port->wPortStatus &= ~PORT_STAT_ENABLE; @@ -624,7 +623,7 @@ static int usb_hub_broadcast_packet(USBHubState *s, int pid, for(i = 0; i < s->nb_ports; i++) { port = &s->ports[i]; - dev = port->dev; + dev = port->port.dev; if (dev && (port->wPortStatus & PORT_STAT_ENABLE)) { ret = dev->handle_packet(dev, pid, devaddr, devep, |