Skip to contentSkip to conversation

hw/usb: record async control completion for parameter transfers

PATCH New ~ziyi_fu 1 participant 1 message May 29

lore
Share & tools
lore

~ziyi_fu

author
#0 lore raw

PATCH 1/1 hw/usb: record async control completion for parameter transfers

From: Ziyi Fu <[email protected]>

Record the completion side of parameter-based control transfers when they complete asynchronously. This lets pcap captures include descriptor response data for requests such as GET_DESCRIPTOR from usb-host devices.

The synchronous path already recorded the completion, but the async SETUP_STATE_PARAM path was missing it.

---
Tested with a usb-host HID keyboard on qemu-xhci. Before this change, the generated pcap contained GET_DESCRIPTOR submissions but not the corresponding completion payloads. After this change, the pcap contains the descriptor payloads and Wireshark can associate endpoint 0x81 with the HID interface.

 hw/usb/core.c | 1 +
 1 file changed, 1 insertion(+)
hw/usb/core.c +1 -0
index 9572a870cc..d71204c5c8 100644
@@ -345,6 +345,7 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
             p->actual_length = 0;
             usb_packet_copy(p, s->data_buf, s->setup_len);
         }
+        usb_pcap_ctrl(p, false);
         break;
 
     default:
Signature · 1 line
2.49.1