aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-uhci.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-06 16:13:29 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-06 16:13:29 +0000
commita594cfbf3e1a38bc6f3908d7d0903d41e8ea9da8 (patch)
tree08a6cbb83a11db3d8c675b95cfe427dcd981ce81 /hw/usb-uhci.c
parent8738a8d079b661a612e89612844dc270ef5f0924 (diff)
downloadqemu-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-uhci.c')
-rw-r--r--hw/usb-uhci.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 4dd0c63..0f0c185 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -63,7 +63,6 @@
typedef struct UHCIPort {
USBPort port;
uint16_t ctrl;
- USBDevice *dev; /* connected device */
} UHCIPort;
typedef struct UHCIState {
@@ -128,8 +127,8 @@ static void uhci_reset(UHCIState *s)
for(i = 0; i < NB_PORTS; i++) {
port = &s->ports[i];
port->ctrl = 0x0080;
- if (port->dev)
- uhci_attach(&port->port, port->dev);
+ if (port->port.dev)
+ uhci_attach(&port->port, port->port.dev);
}
}
@@ -183,7 +182,7 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
/* send reset on the USB bus */
for(i = 0; i < NB_PORTS; i++) {
port = &s->ports[i];
- dev = port->dev;
+ dev = port->port.dev;
if (dev) {
dev->handle_packet(dev,
USB_MSG_RESET, 0, 0, NULL, 0);
@@ -224,7 +223,7 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
if (n >= NB_PORTS)
return;
port = &s->ports[n];
- dev = port->dev;
+ dev = port->port.dev;
if (dev) {
/* port reset */
if ( (val & UHCI_PORT_RESET) &&
@@ -320,7 +319,7 @@ static void uhci_attach(USBPort *port1, USBDevice *dev)
UHCIPort *port = &s->ports[port1->index];
if (dev) {
- if (port->dev) {
+ if (port->port.dev) {
usb_attach(port1, NULL);
}
/* set connect status */
@@ -332,7 +331,7 @@ static void uhci_attach(USBPort *port1, USBDevice *dev)
port->ctrl |= UHCI_PORT_LSDA;
else
port->ctrl &= ~UHCI_PORT_LSDA;
- port->dev = dev;
+ port->port.dev = dev;
/* send the attach message */
dev->handle_packet(dev,
USB_MSG_ATTACH, 0, 0, NULL, 0);
@@ -346,13 +345,13 @@ static void uhci_attach(USBPort *port1, USBDevice *dev)
port->ctrl &= ~UHCI_PORT_EN;
port->ctrl |= UHCI_PORT_ENC;
}
- dev = port->dev;
+ dev = port->port.dev;
if (dev) {
/* send the detach message */
dev->handle_packet(dev,
USB_MSG_DETACH, 0, 0, NULL, 0);
}
- port->dev = NULL;
+ port->port.dev = NULL;
}
}
@@ -386,7 +385,7 @@ static int uhci_broadcast_packet(UHCIState *s, uint8_t pid,
#endif
for(i = 0; i < NB_PORTS; i++) {
port = &s->ports[i];
- dev = port->dev;
+ dev = port->port.dev;
if (dev && (port->ctrl & UHCI_PORT_EN)) {
ret = dev->handle_packet(dev, pid,
devaddr, devep,