[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/28] usb-xhci: switch to usb_find_device()
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 14/28] usb-xhci: switch to usb_find_device() |
Date: |
Fri, 10 Feb 2012 12:43:10 +0100 |
Switch over xHCI to use the new usb_find_device()
function for device lookup.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb-xhci.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c
index 7028338..aa236c9 100644
--- a/hw/usb-xhci.c
+++ b/hw/usb-xhci.c
@@ -1385,6 +1385,14 @@ static int xhci_complete_packet(XHCITransfer *xfer, int
ret)
return 0;
}
+static USBDevice *xhci_find_device(XHCIPort *port, uint8_t addr)
+{
+ if (!(port->portsc & PORTSC_PED)) {
+ return NULL;
+ }
+ return usb_find_device(&port->port, addr);
+}
+
static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer)
{
XHCITRB *trb_setup, *trb_status;
@@ -1444,7 +1452,7 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci,
XHCITransfer *xfer)
xfer->data_length = wLength;
port = &xhci->ports[xhci->slots[xfer->slotid-1].port-1];
- dev = port->port.dev;
+ dev = xhci_find_device(port, xhci->slots[xfer->slotid-1].devaddr);
if (!dev) {
fprintf(stderr, "xhci: slot %d port %d has no device\n", xfer->slotid,
xhci->slots[xfer->slotid-1].port);
@@ -1502,7 +1510,7 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer
*xfer, XHCIEPContext *epctx
}
port = &xhci->ports[xhci->slots[xfer->slotid-1].port-1];
- dev = port->port.dev;
+ dev = xhci_find_device(port, xhci->slots[xfer->slotid-1].devaddr);
if (!dev) {
fprintf(stderr, "xhci: slot %d port %d has no device\n", xfer->slotid,
xhci->slots[xfer->slotid-1].port);
--
1.7.1
- [Qemu-devel] [PATCH 02/28] usb-ehci: Clear the portstatus powner bit on device disconnect, (continued)
- [Qemu-devel] [PATCH 02/28] usb-ehci: Clear the portstatus powner bit on device disconnect, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 04/28] usb: kill USB_MSG_{ATTACH,DETACH}, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 08/28] usb-hub: implement find_device, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 01/28] usb-uhci: implement bandwidth management, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 07/28] usb: add usb_find_device(), Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 22/28] usb: add USBBusOps->wakeup_endpoint, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 10/28] usb-uhci: switch to usb_find_device(), Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 03/28] usb-redir: Add the posibility to filter out certain devices from redirecion, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 18/28] usb: add USBEndpoint->{nr,pid}, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 06/28] usb: kill usb_send_msg, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 14/28] usb-xhci: switch to usb_find_device(),
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 23/28] xhci: signal low- and fullspeed support, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 15/28] usb: kill handle_packet callback, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 12/28] usb-ohci: switch to usb_find_device(), Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 05/28] usb: kill USB_MSG_RESET, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 16/28] usb: fold usb_generic_handle_packet into usb_handle_packet, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 26/28] xhci: kill port arg from xhci_setup_packet, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 09/28] usb: handle dev == NULL in usb_handle_packet(), Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 11/28] usb-ehci: switch to usb_find_device(), Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 20/28] usb: maintain async packet list per endpoint, Gerd Hoffmann, 2012/02/10
- [Qemu-devel] [PATCH 13/28] usb-musb: switch to usb_find_device(), Gerd Hoffmann, 2012/02/10