aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-bus.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
commit72cf2d4f0e181d0d3a3122e04129c58a95da713e (patch)
tree4d13c505a692104406090e94dd654fd1e98ec34e /hw/usb-bus.c
parent620150dc9c1827cdddfa64a0fada7af5f7ee405b (diff)
downloadqemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.zip
qemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.tar.gz
qemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.tar.bz2
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/usb-bus.c')
-rw-r--r--hw/usb-bus.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 169fb2f..03933f1 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -12,7 +12,7 @@ static struct BusInfo usb_bus_info = {
.print_dev = usb_bus_dev_print,
};
static int next_usb_bus = 0;
-static TAILQ_HEAD(, USBBus) busses = TAILQ_HEAD_INITIALIZER(busses);
+static QTAILQ_HEAD(, USBBus) busses = QTAILQ_HEAD_INITIALIZER(busses);
USBBus *usb_bus_new(DeviceState *host)
{
@@ -20,9 +20,9 @@ USBBus *usb_bus_new(DeviceState *host)
bus = FROM_QBUS(USBBus, qbus_create(&usb_bus_info, host, NULL));
bus->busnr = next_usb_bus++;
- TAILQ_INIT(&bus->free);
- TAILQ_INIT(&bus->used);
- TAILQ_INSERT_TAIL(&busses, bus, next);
+ QTAILQ_INIT(&bus->free);
+ QTAILQ_INIT(&bus->used);
+ QTAILQ_INSERT_TAIL(&busses, bus, next);
return bus;
}
@@ -31,8 +31,8 @@ USBBus *usb_bus_find(int busnr)
USBBus *bus;
if (-1 == busnr)
- return TAILQ_FIRST(&busses);
- TAILQ_FOREACH(bus, &busses, next) {
+ return QTAILQ_FIRST(&busses);
+ QTAILQ_FOREACH(bus, &busses, next) {
if (bus->busnr == busnr)
return bus;
}
@@ -100,7 +100,7 @@ void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
port->opaque = opaque;
port->index = index;
port->attach = attach;
- TAILQ_INSERT_TAIL(&bus->free, port, next);
+ QTAILQ_INSERT_TAIL(&bus->free, port, next);
bus->nfree++;
}
@@ -116,13 +116,13 @@ static void do_attach(USBDevice *dev)
}
dev->attached++;
- port = TAILQ_FIRST(&bus->free);
- TAILQ_REMOVE(&bus->free, port, next);
+ port = QTAILQ_FIRST(&bus->free);
+ QTAILQ_REMOVE(&bus->free, port, next);
bus->nfree--;
usb_attach(port, dev);
- TAILQ_INSERT_TAIL(&bus->used, port, next);
+ QTAILQ_INSERT_TAIL(&bus->used, port, next);
bus->nused++;
}
@@ -149,7 +149,7 @@ int usb_device_delete_addr(int busnr, int addr)
if (!bus)
return -1;
- TAILQ_FOREACH(port, &bus->used, next) {
+ QTAILQ_FOREACH(port, &bus->used, next) {
if (port->dev->addr == addr)
break;
}
@@ -157,13 +157,13 @@ int usb_device_delete_addr(int busnr, int addr)
return -1;
dev = port->dev;
- TAILQ_REMOVE(&bus->used, port, next);
+ QTAILQ_REMOVE(&bus->used, port, next);
bus->nused--;
usb_attach(port, NULL);
dev->info->handle_destroy(dev);
- TAILQ_INSERT_TAIL(&bus->free, port, next);
+ QTAILQ_INSERT_TAIL(&bus->free, port, next);
bus->nfree++;
return 0;
}
@@ -196,13 +196,13 @@ void usb_info(Monitor *mon)
USBDevice *dev;
USBPort *port;
- if (TAILQ_EMPTY(&busses)) {
+ if (QTAILQ_EMPTY(&busses)) {
monitor_printf(mon, "USB support not enabled\n");
return;
}
- TAILQ_FOREACH(bus, &busses, next) {
- TAILQ_FOREACH(port, &bus->used, next) {
+ QTAILQ_FOREACH(bus, &busses, next) {
+ QTAILQ_FOREACH(port, &bus->used, next) {
dev = port->dev;
if (!dev)
continue;