From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from blyat.fensystems.co.uk (blyat.fensystems.co.uk [54.246.183.96]) by mx.groups.io with SMTP id smtpd.web11.7465.1625219216658154093 for ; Fri, 02 Jul 2021 02:46:57 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ipxe.org, ip: 54.246.183.96, mailfrom: mcb30@ipxe.org) Received: from dolphin.home (unknown [IPv6:2a00:23c6:5495:5e00:72b3:d5ff:feb1:e101]) by blyat.fensystems.co.uk (Postfix) with ESMTPSA id 2768644181; Fri, 2 Jul 2021 09:46:53 +0000 (UTC) Subject: Re: [edk2-devel] EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization From: "Michael Brown" To: Ethin Probst Cc: devel@edk2.groups.io Reply-To: devel@edk2.groups.io, mcb30@ipxe.org References: <168DEFFB0E406B59.30759@groups.io> Message-ID: Date: Fri, 2 Jul 2021 10:46:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <168DEFFB0E406B59.30759@groups.io> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on blyat.fensystems.co.uk Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 02/07/2021 10:41, Michael Brown wrote: > UsbIo->UsbControlTransfer(UsbIo, &Req, EfiUsbDataIn, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 PcdGet32 (PcdUsbTransferTimeoutValue), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 &Header, sizeof(Header), &Status); >=20 > (Error handling etc omitted for brevity) >=20 > That would get you the first 8 bytes of the class-specific AC interface= =20 > header descriptor.=C2=A0 You would then need to extract the TotalLength= =20 > field, allocate that length of memory, and repeat the=20 > UsbControlTransfer() call to fetch the full-length descriptor into the=20 > newly allocated block. >=20 > Hope that helps, BTW, in case you aren't already aware of this: wireshark is pretty good=20 at dissecting USB traffic. You can capture it by doing a "modprobe=20 usbmon", after which you'll see a number of usbmonN devices show up in=20 the wireshark interface list. Try them each in turn until you find=20 which one corresponds to the host controller to which your device is=20 attached. My normal method for developing or debugging iPXE USB drivers will=20 typically involve using wireshark to capture the USB traffic that=20 happens when the device is being used by a known-working driver (e.g.=20 the Linux driver for that device) and comparing it to the traffic that=20 happens when I'm using my own driver (via USB pass-through in a VM).=20 This is often a lot faster than trying to pull together all of the=20 information from the multiple USB spec documents. Good luck! Michael