public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* USB isochronous transfers
@ 2021-07-20 15:32 Ethin Probst
  2021-07-20 17:05 ` [edk2-devel] " Michael D Kinney
  2021-07-20 17:23 ` Andrew Fish
  0 siblings, 2 replies; 3+ messages in thread
From: Ethin Probst @ 2021-07-20 15:32 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm (Nuvia address), Andrew Fish, Ray Ni

Hello all,

A few days ago Leif determined that the USB DXE does not implement
isochronous transfers. This will make USB Audio quite impossible as
the audio data endpoint requires isochronous transfers.

I was looking at the EHCI driver but I can't determine a couple things:

- Isochronous transfers have a different structure compared to other
URB types. (Each URB type may have its own structure -- I haven't
checked.)
- I can't seem to figure out how this is handled in, say, EhciDxe.
- If we were to try and implement this -- though I'm not quite sure
how -- would we need to modify the PEIs too?

-- 
Signed,
Ethin D. Probst

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] USB isochronous transfers
  2021-07-20 15:32 USB isochronous transfers Ethin Probst
@ 2021-07-20 17:05 ` Michael D Kinney
  2021-07-20 17:23 ` Andrew Fish
  1 sibling, 0 replies; 3+ messages in thread
From: Michael D Kinney @ 2021-07-20 17:05 UTC (permalink / raw)
  To: devel@edk2.groups.io, harlydavidsen@gmail.com, Kinney, Michael D
  Cc: Leif Lindholm (Nuvia address), Andrew Fish, Ni, Ray

PEI use of USB is usually limited to access to recovery images from media devices.

I would recommend focusing on UEFI components,

Mike


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ethin Probst
> Sent: Tuesday, July 20, 2021 8:33 AM
> To: devel@edk2.groups.io
> Cc: Leif Lindholm (Nuvia address) <leif@nuviainc.com>; Andrew Fish <afish@apple.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [edk2-devel] USB isochronous transfers
> 
> Hello all,
> 
> A few days ago Leif determined that the USB DXE does not implement
> isochronous transfers. This will make USB Audio quite impossible as
> the audio data endpoint requires isochronous transfers.
> 
> I was looking at the EHCI driver but I can't determine a couple things:
> 
> - Isochronous transfers have a different structure compared to other
> URB types. (Each URB type may have its own structure -- I haven't
> checked.)
> - I can't seem to figure out how this is handled in, say, EhciDxe.
> - If we were to try and implement this -- though I'm not quite sure
> how -- would we need to modify the PEIs too?
> 
> --
> Signed,
> Ethin D. Probst
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] USB isochronous transfers
  2021-07-20 15:32 USB isochronous transfers Ethin Probst
  2021-07-20 17:05 ` [edk2-devel] " Michael D Kinney
@ 2021-07-20 17:23 ` Andrew Fish
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Fish @ 2021-07-20 17:23 UTC (permalink / raw)
  To: edk2-devel-groups-io, Ethin Probst; +Cc: Leif Lindholm (Nuvia address), Ray Ni

[-- Attachment #1: Type: text/plain, Size: 2325 bytes --]



> On Jul 20, 2021, at 8:32 AM, Ethin Probst <harlydavidsen@gmail.com> wrote:
> 
> Hello all,
> 
> A few days ago Leif determined that the USB DXE does not implement
> isochronous transfers. This will make USB Audio quite impossible as
> the audio data endpoint requires isochronous transfers.
> 
> I was looking at the EHCI driver but I can't determine a couple things:
> 
> - Isochronous transfers have a different structure compared to other
> URB types. (Each URB type may have its own structure -- I haven't
> checked.)
> - I can't seem to figure out how this is handled in, say, EhciDxe.
> - If we were to try and implement this -- though I'm not quite sure
> how -- would we need to modify the PEIs too?
> 

I don’t think we would need to change PEI. 


1s you need to figure out which UsbIo service you would need to code the USB Audio driver against. 
MdePkg/Include/Protocol/UsbIo.h:485:  EFI_USB_IO_ISOCHRONOUS_TRANSFER       UsbIsochronousTransfer;
MdePkg/Include/Protocol/UsbIo.h:486:  EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;

That service would likely be implemented on top of the matching USB Host Controller service. 

MdePkg/Include/Protocol/Usb2HostController.h:635:  EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER        IsochronousTransfer;
MdePkg/Include/Protocol/Usb2HostController.h:636:  EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER  AsyncIsochronousTransfer;

MdePkg/Include/Protocol/UsbHostController.h:480:  EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER        IsochronousTransfer;
MdePkg/Include/Protocol/UsbHostController.h:481:  EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER  AsyncIsochronousTransfer;

So for each USB HC (EHCI, XHCI, OHCI, etc) that is needed you would need to implement the required isochronous transfer. This likely involves managing the DMA queue of the hardware. 

You would also need a generic change to the USB Bus Driver to implement the UsbIo services on top of the Usb Host Controller services. That would work for every USB Host Controller. 

Sorry I don’t know of any EFI USB Stack that implements Isochronous transfers. 

Thanks,

Andrew Fish

PS FYI that post I sent about gdb should work for you too if you grab those 2 files. 


> -- 
> Signed,
> Ethin D. Probst
> 
> 
> 
> 
> 


[-- Attachment #2: Type: text/html, Size: 9171 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-20 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-20 15:32 USB isochronous transfers Ethin Probst
2021-07-20 17:05 ` [edk2-devel] " Michael D Kinney
2021-07-20 17:23 ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox