Recently
QEMU added USB Packet Logging in the PCAP format for viewing with
WireShark. Add the following PCAP parameter to your device:
Code:
pcap=uhci.pcap
Here is an example for an attached MSD device:
Code:
-device ich9-usb-uhci3 -drive id=my_usb_disk,file=usbfile.img,if=none ^
-device usb-storage,drive=my_usb_disk,pcap=uhci.pcap
QEMU will now send all incoming and outgoing USB packets to a file named 'uhci.pcap'. Then you can open this file with WireShark and see the USB traffic. This is similar to if you were running your code on real hardware and had a hardware packet capture device.
With this new announcement by QEMU, I realized that I have most of this function already in
Bochs, all I needed to do was send it to a file. Therefore, if you prefer to use Bochs, update to the
latest SVN and use the following bochrc.txt option:
Code:
usb_uhci: enabled=1, port1=disk, options1="path:D:\path\to\usb\image\file\usbimg.img,pcap:D:\path\to\capture\file\capture.pcap"
Whether you use QEMU or Bochs (or both), this is a nice new feature to see all of the USB traffic for your installed devices and hopefully helps with your USB driver development.
Cheers,
Ben
-
http://www.fysnet.net/the_universal_serial_bus.htm