summaryrefslogtreecommitdiff
path: root/hw/usb/host-linux.c
AgeCommit message (Collapse)AuthorFilesLines
2012-09-12usb-host: allow emulated (non-async) control requests without USBPacketGerd Hoffmann1-1/+1
xhci needs this for USB_REQ_SET_ADDRESS due to the way usb addressing is handled by the xhci hardware. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-16usb: async control xfer fixupGerd Hoffmann1-0/+1
Need to clear p->result after copying setup data using usb_packet_copy() because we'll reuse the USBPacket for the data transfer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09usb-host: add trace events for iso xfersGerd Hoffmann1-4/+6
Replace iso transfer fprintf's with trace points. Also rename existing tracepoints so they all match usb_host_iso_*. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09usb: split endpoint init and resetGerd Hoffmann1-2/+3
Create a new usb_ep_reset() function to reset endpoint state, without re-initialiting the queues, so we don't unlink in-flight packets just because usb-host has to re-parse the descriptor tables. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-20usb-host: live migration supportGerd Hoffmann1-1/+46
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-20usb-host: attach only to running guestGerd Hoffmann1-15/+17
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-14usb-host: handle guest-issued clear haltGerd Hoffmann1-0/+9
Most important here is to update our internal endpoint state so we know the endpoint isn't in halted state any more. Without this usb-host tries to clear halt again with the next data transfer submitted. Doing this twice is (a) not correct and (b) confuses some usb devices, rendering them non-functional in the guest. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-26usb-host: fix zero-length packetsGerd Hoffmann1-3/+3
usb-host optimizes away zero-length packets by not entering the processing loop at all. Which isn't correct, we should submit a zero-length urb to the host devicein that case. This patch makes sure we run the processing loop at least once. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-26usb-host: don't dereference invalid iovecsGerd Hoffmann1-3/+3
usb-host assumes the first iovec element is always valid. In case of a zero-length packet this isn't true though. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: rewrite usb_linux_update_endp_tableGerd Hoffmann1-93/+101
This patch carries a complete rewrite of the usb descriptor parser. Changes / improvements: * We are using the USBDescriptor struct instead of hard-coded offsets now to access descriptor data. * (debug) printfs are all gone, tracepoints have been added instead. * We don't try (and fail) to skip over unneeded descriptors. We parse them all one by one. We keep track of which configuration, interface and altsetting we are looking at and use this information to figure which desciptors are in use and which we can ignore. * On parse errors we clear all endpoint information, which will disallow any communication with the device, except control endpoint messages. This makes sure we don't end up with a silly device state where half of the endpoints got enabled and the other half was left disabled. * Some sanity checks have been added. The new parser is more robust and also leaves complete device information in the trace log if you enable the ush_host_parse_* tracepoints. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: add property to turn off pipeliningGerd Hoffmann1-1/+9
Add a property to usb-host to disable the bulk endpoint pipelining. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: add usb packet to request tracepointsGerd Hoffmann1-12/+14
Add pointer to USBPacket to all tracepoints tracking requests to make it easier to identify them when multiple requests are in flight. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: trace canceled requestsGerd Hoffmann1-1/+3
Add tracepoints to track canceled requests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: trace emulated requestsGerd Hoffmann1-3/+9
Add tracepoint to track completion of emulated control requests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17Add bootindex support to usb-host and usb-redirGerd Hoffmann1-0/+3
When passing through a usb pendrive seabios will present it in the F12 boot menu and will happily boot from it. This patch adds bootorder support so you can even make it the default boot device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb: the big renameGerd Hoffmann1-0/+1913
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>