summaryrefslogtreecommitdiff
path: root/hw/usb/dump.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-20usbdump: support xhciPeter Wu1-8/+19
The XHCI HCD sends an OUT packet which was unexpected by the usbdump code. That was the case because the core USB code that was normally calling handle_control only called when the full data was received from the host (from the Status stage, with PID == USB_TOKEN_IN). Then there is also the do_parameter function as used by XHCI that was not really handled. Fix this by allowing OUT tokens, also document why this is necessary. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: fix endpoint lookupPeter Wu1-5/+9
bNumEndpoints specify the number of endpoints in the endpoint descriptor. When the mouse endpoint was tried (EP2), it triggered this assertion because there is only one endpoint for the interface. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: do not hard-code bus number, use nr from USBBusPeter Wu1-1/+3
Instead of changing bus.c (next_usb_bus) and possibly breaking configurations relying on this number, just add one in the dump code for cosmetic purposes. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix start time offset of capturePeter Wu1-3/+2
There is still a discrepancy (seen 300 ms and 600 ms), but it is better than completely a difference equal to the uptime. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: comments updatePeter Wu1-1/+8
And I was wondering why the interrupt packets in dev-hid.c had a reversed type marking...
2014-03-16usbdump: fix IN marking for non-control packetsPeter Wu1-2/+8
Non-control transfers have a meaningless setup buffer. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: constantify variablesPeter Wu1-11/+11
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix reversal of URB length and captured lengthPeter Wu1-4/+11
The "length" field stores the expected size of data. "len_cap" stores the real length of the data in the current packet (the "captured" data). Also try to set a slightly more sane length value depending on submission type, but this is much braindead. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix interval retrieval for endpointPeter Wu1-2/+4
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: initial API extension for handle_dataPeter Wu1-0/+56
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fail early if dump file is not availablePeter Wu1-2/+8
This allows for less less checking by the consumer and avoids unnecessary work if the capture cannot be written anyway. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: get interval from descriptorPeter Wu1-2/+21
It looks very ugly, perhaps a helper function should moved to desc.c? Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16Initial usbdump helperPeter Wu1-0/+352
USB packets are captured in the pcap format using the Linux usbmon link-layer type. Right now, this only works with handle_ctrl. Data packets (isochronous, bulk and interrupt) are not (fully) implemented yet. Signed-off-by: Peter Wu <peter@lekensteyn.nl>