aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-xhci.c
AgeCommit message (Collapse)Author
2012-09-11xhci: update port handlingGerd Hoffmann
This patch changes the way xhci ports are linked to USBPorts. The fixed 1:1 relationship between xhci ports and USBPorts is gone. Now each USBPort represents a physical plug which has usually two xhci ports assigned: one usb2 and ond usb3 port. usb devices show up at one or the other, depending on whenever they support superspeed or not. This patch also makes the number of usb2 and usb3 ports runtime configurable by adding 'p2' and 'p3' properties. It is allowed to have different numbers of usb2 and usb3 ports. Specifying p2=4,p3=2 will give you an xhci adapter which supports all speeds on physical ports 1+2 and usb2 only on ports 3+4.
2012-09-11xhci: update register layoutGerd Hoffmann
Change the register layout to be a bit more sparse and also not depend on the number of ports. Useful when for making the number of ports runtime-configurable.
2012-09-11xhci: fix runtime write tracepointGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add trace_usb_xhci_ep_set_dequeueGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: trace cc codes in cleartextGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: iso xfer supportGerd Hoffmann
Add support for iso transfers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: implement mfindexGerd Hoffmann
Implement mfindex register and mfindex wrap event. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: move device lookup into xhci_setup_packetGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: drop bufferingGerd Hoffmann
This patch splits the xhci_xfer_data function into three. The xhci_xfer_data function used to do does two things: (1) copy transfer data between guest memory and a temporary buffer. (2) report transfer results to the guest using events. Now we three functions to handle this: (1) xhci_xfer_map creates a scatter list for the transfer and uses that (instead of the temporary buffer) to build a USBPacket. (2) xhci_xfer_unmap undoes the mapping. (3) xhci_xfer_report sends out events. The patch also fixes reporting of transaction errors which must be reported unconditinally, not only in case the guest asks for it using the ISP flag. [ v2: fix warning ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: rip out background transfer codeGerd Hoffmann
original xhci code (the one which used libusb directly) used to use 'background transfers' for iso streams. In upstream qemu the iso stream buffering is handled by usb-host & usb-redir, so we will never ever need this. It has been left in as reference, but is dead code anyway. Rip it out. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-31usb: unique packet idsGerd Hoffmann
This patch adds IDs to usb packets. Those IDs are (a) supposed to be unique for the lifecycle of a packet (from packet setup until the packet is either completed or canceled) and (b) stable across migration. uhci, ohci, ehci and xhci use the guest physical address of the transfer descriptor for this. musb needs a different approach because there is no transfer descriptor. But musb also doesn't support pipelining, so we have never more than one packet per endpoint in flight. So we go create an ID based on endpoint and device address. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: slotsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: transfersGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: endpointsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: ring fetchGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: irq + eventsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: run+stopGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: trace: mmio reads+writesGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07xhci: Clean up reset functionJan Kiszka
Properly register reset function via the device class. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-26usb-xhci: fix bit testLai Jiangshan
use & instead of the wrong && Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-26usb-xhci: Use PCI DMA helper functionsDavid Gibson
Shortly before 1.0, we added helper functions / wrappers for doing PCI DMA from individual devices. This makes what's going on clearer and means that when we add IOMMU support somewhere in the future, only the general PCI code will have to change, not every device that uses PCI DMA. However, usb-xhci is not using these wrappers, despite being a PCI only device. This patch remedies the situation, using the pci dma functions instead of direct calls to cpu_physical_memory_{read,write}(). Likewise address parameters for DMA are changed to dma_addr_t instead of target_phys_addr_t. [ kraxel: removed #ifdefs ] Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb: the big renameGerd Hoffmann
Reorganize usb source files. Create a new hw/usb/ directory and move all usb source code to that place. Also make filenames a bit more descriptive. Host adapters are prefixed with "hch-" now, usb device emulations are prefixed with "dev-". Fixup paths Makefile and include paths to make it compile. No code changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>