aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usbdump.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usbdump.c b/usbdump.c
index 6558663..fd3358e 100644
--- a/usbdump.c
+++ b/usbdump.c
@@ -121,6 +121,14 @@ void process_packet(struct usbmon_packet *hdr, char *data)
else
snprintf(linebuf+strlen(linebuf), LINEBUF_LEN-strlen(linebuf), "-->%d ", hdr->epnum & 0x7f);
+ if (hdr->xfer_type == XFER_TYPE_CONTROL) {
+ uint8_t bmRequestType = hdr->s.setup[0];
+ uint8_t bRequest = hdr->s.setup[1];
+ uint16_t wValue = hdr->s.setup[2] | (hdr->s.setup[3] << 8);
+ uint16_t wIndex = hdr->s.setup[4] | (hdr->s.setup[5] << 8);
+ snprintf(linebuf+strlen(linebuf), LINEBUF_LEN-strlen(linebuf), "%02x %d %04x %04x ", bmRequestType, bRequest, wValue, wIndex);
+ }
+
if (hdr->len_cap > 0) {
if (hdr->len_cap == hdr->length)
snprintf(linebuf+strlen(linebuf), LINEBUF_LEN-strlen(linebuf), "%d: ", hdr->len_cap);