public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] Various confusing bits around USB host controller protocols
@ 2025-02-10 17:01 Leif Lindholm via groups.io
  2025-02-11  4:16 ` 回复: " gaoliming via groups.io
  0 siblings, 1 reply; 2+ messages in thread
From: Leif Lindholm via groups.io @ 2025-02-10 17:01 UTC (permalink / raw)
  To: devel; +Cc: Kinney, Michael D, Liming Gao, Ray Ni, Ard Biesheuvel

Spotted while looking into https://github.com/tianocore/edk2/pull/10593

This starts with
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Include/Ppi/Usb2HostController.h#L244,
which states that PEI_USB2_HOST_CONTROLLER_PPI is modelled after
EFI_USB2_HOST_CONTROLLER_PROTOCOL as described by UEFI 2.3.

The problem is that
1) UEFI 2.3 does not describe any EFI_USB2_HOST_CONTROLLER_PROTOCOL
(it describes a EFI_USB2_HC_PROTOCOL, which thankfully is what edk2
uses elsewhere).
2) EFI_USB2_HC_PROTOCOL does not contain a GetRootHubPortNumber().
3) The specification still references GetRootHubPortNumber() in three locations.
4) https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Protocol/UsbHostController.h#L464
defines a EFI_USB_HC_PROTOCOL that is not described by the UEFI
specification version 2.0 or later.

As far as I can tell there is one clear errata in the UEFI
speficiation: the references to GetRootHubPortNumber().
Which presumably should be updated to reflect that the information
should be retrieved from GetCapability() instead (which UsbBusDxe
does).
Are there any other implications?

But that leaves the support for the extra-spec EFI_USB_HC_PROTOCOL.
Why is it still there, in UsbBusDxe, and is anyone actually using it?
Relying on it?
Could we delete it? Deprecate it?

I don't know what if anything should be done about the
PEI_USB*_HOST_CONTROLLER_PPI structs, but the comments describing them
are actively misleading and should be updated *somehow*.

/
    Leif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121114): https://edk2.groups.io/g/devel/message/121114
Mute This Topic: https://groups.io/mt/111105835/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2025-02-11  4:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 17:01 [edk2-devel] Various confusing bits around USB host controller protocols Leif Lindholm via groups.io
2025-02-11  4:16 ` 回复: " gaoliming via groups.io

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