[edk2-devel] EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization
Michael Brown
mcb30 at ipxe.org
Fri Jul 2 09:46:52 UTC 2021
On 02/07/2021 10:41, Michael Brown wrote:
> UsbIo->UsbControlTransfer(UsbIo, &Req, EfiUsbDataIn,
> PcdGet32 (PcdUsbTransferTimeoutValue),
> &Header, sizeof(Header), &Status);
>
> (Error handling etc omitted for brevity)
>
> That would get you the first 8 bytes of the class-specific AC interface
> header descriptor. You would then need to extract the TotalLength
> field, allocate that length of memory, and repeat the
> UsbControlTransfer() call to fetch the full-length descriptor into the
> newly allocated block.
>
> Hope that helps,
BTW, in case you aren't already aware of this: wireshark is pretty good
at dissecting USB traffic. You can capture it by doing a "modprobe
usbmon", after which you'll see a number of usbmonN devices show up in
the wireshark interface list. Try them each in turn until you find
which one corresponds to the host controller to which your device is
attached.
My normal method for developing or debugging iPXE USB drivers will
typically involve using wireshark to capture the USB traffic that
happens when the device is being used by a known-working driver (e.g.
the Linux driver for that device) and comparing it to the traffic that
happens when I'm using my own driver (via USB pass-through in a VM).
This is often a lot faster than trying to pull together all of the
information from the multiple USB spec documents.
Good luck!
Michael
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77446): https://edk2.groups.io/g/devel/message/77446
Mute This Topic: https://groups.io/mt/83904983/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list