usbbus.h
来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 1,128 行 · 第 1/3 页
H
1,128 行
VOID
SetDataToggleBit (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT8 EndpointAddr,
IN UINT8 DataToggle
)
/*++
Routine Description:
Set the datatoggle of a specified endpoint
Arguments:
UsbIo - Given Usb Controller device.
EndpointAddr - Given Endpoint address.
DataToggle - The current data toggle of that endpoint to be set
Returns:
VOID
--*/
;
INTERFACE_DESC_LIST_ENTRY *
FindInterfaceListEntry (
IN EFI_USB_IO_PROTOCOL *This
)
/*++
Routine Description:
Find Interface ListEntry.
Arguments:
This - EFI_USB_IO_PROTOCOL
Returns:
INTERFACE_DESC_LIST_ENTRY pointer
--*/
;
ENDPOINT_DESC_LIST_ENTRY *
FindEndPointListEntry (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 EndPointAddress
)
/*++
Routine Description:
Find EndPoint ListEntry.
Arguments:
This - EFI_USB_IO_PROTOCOL
EndpointAddr - Endpoint address.
Returns:
ENDPOINT_DESC_LIST_ENTRY pointer
--*/
;
EFI_STATUS
IsDeviceDisconnected (
IN USB_IO_CONTROLLER_DEVICE *UsbIoController,
IN OUT BOOLEAN *Disconnected
)
/*++
Routine Description:
Reset if the device is disconencted or not
Arguments:
UsbIoController - Indicating the Usb Controller Device.
Disconnected - Indicate whether the device is disconencted or not
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
--*/
;
EFI_STATUS
UsbDeviceDeConfiguration (
IN USB_IO_DEVICE *UsbIoDevice
)
/*++
Routine Description:
Remove Device, Device Handles, Uninstall Protocols.
Arguments:
UsbIoDevice - The device to be deconfigured.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcGetCapability (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
OUT UINT8 *MaxSpeed,
OUT UINT8 *PortNumber,
OUT UINT8 *Is64BitCapable
)
/*++
Routine Description:
Virtual interface to Retrieves the capablility of root hub ports
for both Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
MaxSpeed - A pointer to the number of the host controller.
PortNumber - A pointer to the number of the root hub ports.
Is64BitCapable - A pointer to the flag for whether controller supports
64-bit memory addressing.
Returns:
EFI_SUCCESS
The host controller capability were retrieved successfully.
EFI_INVALID_PARAMETER
MaxSpeed or PortNumber or Is64BitCapable is NULL.
EFI_DEVICE_ERROR
An error was encountered while attempting to retrieve the capabilities.
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcReset (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
IN UINT16 Attributes
)
/*++
Routine Description:
Virtual interface to provides software reset for the USB host controller
for both Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
Attributes - A bit mask of the reset operation to perform.
See below for a list of the supported bit mask values.
#define EFI_USB_HC_RESET_GLOBAL 0x0001 // Hc2 and Hc
#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002 // Hc2 and Hc
#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004 // Hc2
#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008 // Hc2
EFI_USB_HC_RESET_GLOBAL
If this bit is set, a global reset signal will be sent to the USB bus.
This resets all of the USB bus logic, including the USB host
controller hardware and all the devices attached on the USB bus.
EFI_USB_HC_RESET_HOST_CONTROLLER
If this bit is set, the USB host controller hardware will be reset.
No reset signal will be sent to the USB bus.
EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG
If this bit is set, a global reset signal will be sent to the USB bus.
This resets all of the USB bus logic, including the USB host
controller hardware and all the devices attached on the USB bus.
If this is an EHCI controller and the debug port has configured, then
this is will still reset the host controller.
EFI_USB_HC_RESET_HOST_WITH_DEBUG
If this bit is set, the USB host controller hardware will be reset.
If this is an EHCI controller and the debug port has been configured,
then this will still reset the host controller.
Returns:
EFI_SUCCESS
The reset operation succeeded.
EFI_INVALID_PARAMETER
Attributes is not valid.
EFI_UNSUPPOURTED
The type of reset specified by Attributes is not currently supported by
the host controller hardware.
EFI_ACCESS_DENIED
Reset operation is rejected due to the debug port being configured and
active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Atrributes can be used to
perform reset operation for this host controller.
EFI_DEVICE_ERROR
An error was encountered while attempting to perform
the reset operation.
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcGetState (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
OUT EFI_USB_HC_STATE *State
)
/*++
Routine Description:
Virtual interface to retrieves current state of the USB host controller
for both Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
State - A pointer to the EFI_USB_HC_STATE data structure that
indicates current state of the USB host controller.
Type EFI_USB_HC_STATE is defined below.
typedef enum {
EfiUsbHcStateHalt,
EfiUsbHcStateOperational,
EfiUsbHcStateSuspend,
EfiUsbHcStateMaximum
} EFI_USB_HC_STATE;
Returns:
EFI_SUCCESS
The state information of the host controller was returned in State.
EFI_INVALID_PARAMETER
State is NULL.
EFI_DEVICE_ERROR
An error was encountered while attempting to retrieve the
host controller's current state.
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcSetState (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
IN EFI_USB_HC_STATE State
)
/*++
Routine Description:
Virtual interface to sets the USB host controller to a specific state
for both Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
State - Indicates the state of the host controller that will be set.
Returns:
EFI_SUCCESS
The USB host controller was successfully placed in the state
specified by State.
EFI_INVALID_PARAMETER
State is invalid.
EFI_DEVICE_ERROR
Failed to set the state specified by State due to device error.
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcGetRootHubPortStatus (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
IN UINT8 PortNumber,
OUT EFI_USB_PORT_STATUS *PortStatus
)
/*++
Routine Description:
Virtual interface to retrieves the current status of a USB root hub port
both for Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
PortNumber - Specifies the root hub port from which the status
is to be retrieved. This value is zero-based. For example,
if a root hub has two ports, then the first port is numbered 0,
and the second port is numbered 1.
PortStatus - A pointer to the current port status bits and
port status change bits.
Returns:
EFI_SUCCESS The status of the USB root hub port specified by PortNumber
was returned in PortStatus.
EFI_INVALID_PARAMETER PortNumber is invalid.
EFI_DEVICE_ERROR Can't read register
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcSetRootHubPortFeature (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
IN UINT8 PortNumber,
IN EFI_USB_PORT_FEATURE PortFeature
)
/*++
Routine Description:
Virual interface to sets a feature for the specified root hub port
for both Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
PortNumber - Specifies the root hub port whose feature
is requested to be set.
PortFeature - Indicates the feature selector associated
with the feature set request.
Returns:
EFI_SUCCESS
The feature specified by PortFeature was set for the
USB root hub port specified by PortNumber.
EFI_INVALID_PARAMETER
PortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERROR
Can't read register
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcClearRootHubPortFeature (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
IN UINT8 PortNumber,
IN EFI_USB_PORT_FEATURE PortFeature
)
/*++
Routine Description:
Virtual interface to clears a feature for the specified root hub port
for both Hc2 and Hc protocol.
Arguments:
UsbBusDev - A pointer to bus controller of the device.
PortNumber - Specifies the root hub port whose feature
is requested to be cleared.
PortFeature - Indicates the feature selector associated with the
feature clear request.
Returns:
EFI_SUCCESS
The feature specified by PortFeature was cleared for the
USB root hub port specified by PortNumber.
EFI_INVALID_PARAMETER
PortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERROR
Can't read register
--*/
;
EFI_STATUS
EFIAPI
UsbVirtualHcControlTransfer (
IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?