From: "Michael Brown" <mcb30@ipxe.org>
To: Ethin Probst <harlydavidsen@gmail.com>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization
Date: Fri, 2 Jul 2021 10:46:52 +0100 [thread overview]
Message-ID: <cc4d5a3e-45f1-30a6-4226-c2fceea19bf6@ipxe.org> (raw)
In-Reply-To: <168DEFFB0E406B59.30759@groups.io>
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
next prev parent reply other threads:[~2021-07-02 9:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 23:01 EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization Ethin Probst
2021-07-01 14:15 ` [edk2-devel] " Michael Brown
2021-07-01 18:10 ` Ethin Probst
2021-07-02 8:59 ` Laszlo Ersek
2021-07-02 9:41 ` Michael Brown
[not found] ` <168DEFFB0E406B59.30759@groups.io>
2021-07-02 9:46 ` Michael Brown [this message]
2021-07-02 18:18 ` Ethin Probst
2021-07-02 18:22 ` Ethin Probst
2021-07-06 12:53 ` Michael Brown
2021-07-02 8:54 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc4d5a3e-45f1-30a6-4226-c2fceea19bf6@ipxe.org \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox