TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbIoPeim.c File Reference
#include "UsbPeim.h"
#include "PeiUsbLib.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI PeiUsbControlTransfer (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION Direction, IN UINT32 Timeout, IN OUT VOID *Data OPTIONAL, IN UINTN DataLength OPTIONAL)
 
EFI_STATUS EFIAPI PeiUsbBulkTransfer (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout)
 
EFI_STATUS EFIAPI PeiUsbGetInterfaceDescriptor (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, OUT EFI_USB_INTERFACE_DESCRIPTOR **InterfaceDescriptor)
 
EFI_STATUS EFIAPI PeiUsbGetEndpointDescriptor (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN UINT8 EndpointIndex, OUT EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptor)
 
EFI_STATUS EFIAPI PeiUsbPortReset (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This)
 

Detailed Description

The module is used to implement Usb Io PPI interfaces.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UsbIoPeim.c.

Function Documentation

◆ PeiUsbBulkTransfer()

EFI_STATUS EFIAPI PeiUsbBulkTransfer ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI This,
IN UINT8  DeviceEndpoint,
IN OUT VOID *  Data,
IN OUT UINTN DataLength,
IN UINTN  Timeout 
)

Submits bulk transfer to a bulk endpoint of a USB device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
ThisThe pointer of PEI_USB_IO_PPI.
DeviceEndpointEndpoint number and its direction in bit 7.
DataA pointer to the buffer of data to transmit from or receive into.
DataLengthThe length of the data buffer.
TimeoutIndicates the maximum time, in millisecond, which the transfer is allowed to complete. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
Return values
EFI_SUCCESSThe transfer was completed successfully.
EFI_OUT_OF_RESOURCESThe transfer failed due to lack of resource.
EFI_INVALID_PARAMETERParameters are invalid.
EFI_TIMEOUTThe transfer failed due to timeout.
EFI_DEVICE_ERRORThe transfer failed due to host controller error.

Definition at line 151 of file UsbIoPeim.c.

◆ PeiUsbControlTransfer()

EFI_STATUS EFIAPI PeiUsbControlTransfer ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI This,
IN EFI_USB_DEVICE_REQUEST Request,
IN EFI_USB_DATA_DIRECTION  Direction,
IN UINT32  Timeout,
IN OUT VOID *Data  OPTIONAL,
IN UINTN DataLength  OPTIONAL 
)

Submits control transfer to a target USB device.

Parameters
PeiServicesThe pointer of EFI_PEI_SERVICES.
ThisThe pointer of PEI_USB_IO_PPI.
RequestUSB device request to send.
DirectionSpecifies the data direction for the data stage.
TimeoutIndicates the maximum timeout, in millisecond. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
DataData buffer to be transmitted or received from USB device.
DataLengthThe size (in bytes) of the data buffer.
Return values
EFI_SUCCESSTransfer was completed successfully.
EFI_OUT_OF_RESOURCESThe transfer failed due to lack of resources.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_TIMEOUTTransfer failed due to timeout.
EFI_DEVICE_ERRORTransfer failed due to host controller or device error.

Definition at line 35 of file UsbIoPeim.c.

◆ PeiUsbGetEndpointDescriptor()

EFI_STATUS EFIAPI PeiUsbGetEndpointDescriptor ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI This,
IN UINT8  EndpointIndex,
OUT EFI_USB_ENDPOINT_DESCRIPTOR **  EndpointDescriptor 
)

Get the usb endpoint descriptor.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
ThisIndicates the PEI_USB_IO_PPI instance.
EndpointIndexThe valid index of the specified endpoint.
EndpointDescriptorRequest endpoint descriptor.
Return values
EFI_SUCCESSUsb endpoint descriptor is obtained successfully.
EFI_NOT_FOUNDUsb endpoint descriptor is NOT found.

Definition at line 281 of file UsbIoPeim.c.

◆ PeiUsbGetInterfaceDescriptor()

EFI_STATUS EFIAPI PeiUsbGetInterfaceDescriptor ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI This,
OUT EFI_USB_INTERFACE_DESCRIPTOR **  InterfaceDescriptor 
)

Get the usb interface descriptor.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
ThisIndicates the PEI_USB_IO_PPI instance.
InterfaceDescriptorRequest interface descriptor.
Return values
EFI_SUCCESSUsb interface descriptor is obtained successfully.

Definition at line 254 of file UsbIoPeim.c.

◆ PeiUsbPortReset()

EFI_STATUS EFIAPI PeiUsbPortReset ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI This 
)

Reset the port and re-configure the usb device.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
ThisIndicates the PEI_USB_IO_PPI instance.
Return values
EFI_SUCCESSUsb device is reset and configured successfully.
OthersOther failure occurs.

Definition at line 322 of file UsbIoPeim.c.