usbbus.h

来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 1,128 行 · 第 1/3 页

H
1,128
字号
  IN  UINT8                                DeviceAddress,
  IN  UINT8                                DeviceSpeed,
  IN  UINTN                                MaximumPacketLength,
  IN  EFI_USB_DEVICE_REQUEST               *Request,
  IN  EFI_USB_DATA_DIRECTION               TransferDirection,
  IN  OUT VOID                             *Data,
  IN  OUT UINTN                            *DataLength,
  IN  UINTN                                TimeOut,
  IN  EFI_USB2_HC_TRANSACTION_TRANSLATOR   *Translator,
  OUT UINT32                               *TransferResult
  )
/*++
  
  Routine Description:
  
    Virtual interface to submits control transfer to a target USB device
    for both Hc2 and Hc protocol.
  
  Arguments:
    
    UsbBusDev     - A pointer to bus controller of the device.
    DeviceAddress - Represents the address of the target device on the USB,
                  which is assigned during USB enumeration.
    DeviceSpeed   - Indicates target device speed.
    MaximumPacketLength - Indicates the maximum packet size that the 
                        default control transfer endpoint is capable of 
                        sending or receiving.
    Request       - A pointer to the USB device request that will be sent 
                  to the USB device. 
    TransferDirection - Specifies the data direction for the transfer.
                      There are three values available, DataIn, DataOut 
                      and NoData.
    Data          - A pointer to the buffer of data that will be transmitted 
                  to USB device or received from USB device.
    DataLength    - Indicates the size, in bytes, of the data buffer 
                  specified by Data.
    TimeOut       - Indicates the maximum time, in microseconds, 
                  which the transfer is allowed to complete.
    Translator      - A pointr to the transaction translator data.
    TransferResult  - A pointer to the detailed result information generated 
                    by this control transfer.
                    
  Returns:
  
    EFI_SUCCESS 
        The control transfer was completed successfully.
    EFI_OUT_OF_RESOURCES  
        The control transfer could not be completed due to a lack of resources.
    EFI_INVALID_PARAMETER 
        Some parameters are invalid.
    EFI_TIMEOUT 
        The control transfer failed due to timeout.
    EFI_DEVICE_ERROR  
        The control transfer failed due to host controller or device error. 
        Caller should check TranferResult for detailed error information.

--*/
;

EFI_STATUS
EFIAPI
UsbVirtualHcBulkTransfer (
  IN  USB_BUS_CONTROLLER_DEVICE           *UsbBusDev,
  IN  UINT8                               DeviceAddress,
  IN  UINT8                               EndPointAddress,
  IN  UINT8                               DeviceSpeed,
  IN  UINTN                               MaximumPacketLength,
  IN  UINT8                               DataBuffersNumber,
  IN  OUT VOID                            *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
  IN  OUT UINTN                           *DataLength,
  IN  OUT UINT8                           *DataToggle,
  IN  UINTN                               TimeOut,
  IN  EFI_USB2_HC_TRANSACTION_TRANSLATOR  *Translator,
  OUT UINT32                              *TransferResult
  )
/*++
  
  Routine Description:
  
    Virtual interface to submits bulk transfer to a bulk endpoint of a USB device
    both for Hc2 and Hc protocol.
    
  Arguments:
    
    UsbBusDev         - A pointer to bus controller of the device.
    DeviceAddress     - Represents the address of the target device on the USB,
                      which is assigned during USB enumeration.               
    EndPointAddress   - The combination of an endpoint number and an 
                      endpoint direction of the target USB device. 
                      Each endpoint address supports data transfer in 
                      one direction except the control endpoint 
                      (whose default endpoint address is 0). 
                      It is the caller's responsibility to make sure that 
                      the EndPointAddress represents a bulk endpoint.                  
    DeviceSpeed       - Indicates device speed. The supported values are EFI_USB_SPEED_FULL
                      and EFI_USB_SPEED_HIGH.
    MaximumPacketLength - Indicates the maximum packet size the target endpoint
                        is capable of sending or receiving.                 
    DataBuffersNumber - Number of data buffers prepared for the transfer.
    Data              - Array of pointers to the buffers of data that will be transmitted 
                      to USB device or received from USB device.              
    DataLength        - When input, indicates the size, in bytes, of the data buffer
                      specified by Data. When output, indicates the actually 
                      transferred data size.              
    DataToggle        - A pointer to the data toggle value. On input, it indicates 
                      the initial data toggle value the bulk transfer should adopt;
                      on output, it is updated to indicate the data toggle value 
                      of the subsequent bulk transfer. 
    Translator        - A pointr to the transaction translator data. 
    TimeOut           - Indicates the maximum time, in microseconds, which the 
                      transfer is allowed to complete.              
    TransferResult    - A pointer to the detailed result information of the 
                      bulk transfer.

  Returns:
  
    EFI_SUCCESS 
        The bulk transfer was completed successfully.
    EFI_OUT_OF_RESOURCES  
        The bulk transfer could not be submitted due to lack of resource.
    EFI_INVALID_PARAMETER 
        Some parameters are invalid.
    EFI_TIMEOUT 
        The bulk transfer failed due to timeout.
    EFI_DEVICE_ERROR  
        The bulk transfer failed due to host controller or device error.
        Caller should check TranferResult for detailed error information.

--*/
;

EFI_STATUS
EFIAPI
UsbVirtualHcAsyncInterruptTransfer (
  IN  USB_BUS_CONTROLLER_DEVICE             * UsbBusDev,
  IN  UINT8                                 DeviceAddress,
  IN  UINT8                                 EndPointAddress,
  IN  UINT8                                 DeviceSpeed,
  IN  UINTN                                 MaximumPacketLength,
  IN  BOOLEAN                               IsNewTransfer,
  IN OUT UINT8                              *DataToggle,
  IN  UINTN                                 PollingInterval,
  IN  UINTN                                 DataLength,
  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR * Translator,
  IN  EFI_ASYNC_USB_TRANSFER_CALLBACK       CallBackFunction,
  IN  VOID                                  *Context OPTIONAL
  )
/*++
  
  Routine Description:
  
    Virtual interface to submits an asynchronous interrupt transfer to an 
    interrupt endpoint of a USB device for both Hc2 and Hc protocol.
  
  Arguments:
    
    UsbBusDev       - A pointer to bus controller of the device.
    DeviceAddress   - Represents the address of the target device on the USB,
                    which is assigned during USB enumeration.                
    EndPointAddress - The combination of an endpoint number and an endpoint 
                    direction of the target USB device. Each endpoint address 
                    supports data transfer in one direction except the 
                    control endpoint (whose default endpoint address is 0). 
                    It is the caller's responsibility to make sure that 
                    the EndPointAddress represents an interrupt endpoint.              
    DeviceSpeed     - Indicates device speed.
    MaximumPacketLength  - Indicates the maximum packet size the target endpoint
                         is capable of sending or receiving.                   
    IsNewTransfer   - If TRUE, an asynchronous interrupt pipe is built between
                    the host and the target interrupt endpoint. 
                    If FALSE, the specified asynchronous interrupt pipe 
                    is canceled.               
    DataToggle      - A pointer to the data toggle value.  On input, it is valid 
                    when IsNewTransfer is TRUE, and it indicates the initial 
                    data toggle value the asynchronous interrupt transfer 
                    should adopt.  
                    On output, it is valid when IsNewTransfer is FALSE, 
                    and it is updated to indicate the data toggle value of 
                    the subsequent asynchronous interrupt transfer.              
    PollingInterval - Indicates the interval, in milliseconds, that the 
                    asynchronous interrupt transfer is polled.  
                    This parameter is required when IsNewTransfer is TRUE.               
    DataLength      - Indicates the length of data to be received at the 
                    rate specified by PollingInterval from the target 
                    asynchronous interrupt endpoint.  This parameter 
                    is only required when IsNewTransfer is TRUE.             
    Translator      - A pointr to the transaction translator data.
    CallBackFunction  - The Callback function.This function is called at the 
                      rate specified by PollingInterval.This parameter is 
                      only required when IsNewTransfer is TRUE.               
    Context         - The context that is passed to the CallBackFunction.
                    - This is an optional parameter and may be NULL.
  
  Returns:
  
    EFI_SUCCESS 
        The asynchronous interrupt transfer request has been successfully 
        submitted or canceled.
    EFI_INVALID_PARAMETER 
        Some parameters are invalid.
    EFI_OUT_OF_RESOURCES  
        The request could not be completed due to a lack of resources.  
    EFI_DEVICE_ERROR
        Can't read register
        
--*/
;

EFI_STATUS
EFIAPI
UsbVirtualHcSyncInterruptTransfer (
  IN  USB_BUS_CONTROLLER_DEVICE             *UsbBusDev,
  IN  UINT8                                 DeviceAddress,
  IN  UINT8                                 EndPointAddress,
  IN  UINT8                                 DeviceSpeed,
  IN  UINTN                                 MaximumPacketLength,
  IN OUT VOID                               *Data,
  IN OUT UINTN                              *DataLength,
  IN OUT UINT8                              *DataToggle,
  IN  UINTN                                 TimeOut,
  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
  OUT UINT32                                *TransferResult
  )
/*++
  
  Routine Description:
  
    Vitual interface to submits synchronous interrupt transfer to an interrupt endpoint 
    of a USB device for both Hc2 and Hc protocol.
  
  Arguments:
    
    UsbBusDev       - A pointer to bus controller of the device.
    DeviceAddress   - Represents the address of the target device on the USB, 
                    which is assigned during USB enumeration.
    EndPointAddress   - The combination of an endpoint number and an endpoint 
                      direction of the target USB device. Each endpoint 
                      address supports data transfer in one direction 
                      except the control endpoint (whose default 
                      endpoint address is 0). It is the caller's responsibility
                      to make sure that the EndPointAddress represents 
                      an interrupt endpoint. 
    DeviceSpeed     - Indicates device speed.
    MaximumPacketLength - Indicates the maximum packet size the target endpoint 
                        is capable of sending or receiving.
    Data            - A pointer to the buffer of data that will be transmitted 
                    to USB device or received from USB device.
    DataLength      - On input, the size, in bytes, of the data buffer specified 
                    by Data. On output, the number of bytes transferred.
    DataToggle      - A pointer to the data toggle value. On input, it indicates
                    the initial data toggle value the synchronous interrupt 
                    transfer should adopt; 
                    on output, it is updated to indicate the data toggle value 
                    of the subsequent synchronous interrupt transfer. 
    TimeOut         - Indicates the maximum time, in microseconds, which the 
                    transfer is allowed to complete.
    Translator      - A pointr to the transaction translator data.
    TransferResult  - A pointer to the detailed result information from 
                    the synchronous interrupt transfer.  

  Returns:
  
    EFI_SUCCESS 
        The synchronous interrupt transfer was completed successfully.
    EFI_OUT_OF_RESOURCES  
        The synchronous interrupt transfer could not be submitted due 
        to lack of resource.
    EFI_INVALID_PARAMETER 
        Some parameters are invalid.
    EFI_TIMEOUT 
        The synchronous interrupt transfer failed due to timeout.
    EFI_DEVICE_ERROR  
        The synchronous interrupt transfer failed due to host controller 
        or device error. Caller should check TranferResult for detailed 
        error information.  
        
--*/
;

EFI_STATUS
EFIAPI
UsbVirtualHcIsochronousTransfer (
  IN  USB_BUS_CONTROLLER_DEVICE             *UsbBusDev,
  IN  UINT8                                 DeviceAddress,
  IN  UINT8                                 EndPointAddress,
  IN  UINT8                                 DeviceSpeed,
  IN  UINTN                                 MaximumPacketLength,
  IN  UINT8                                 DataBuffersNumber,
  IN  OUT VOID                              *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
  IN  UINTN                                 DataLength,
  IN  EFI_USB2_HC_TRANSACTION_TRANSLATOR    *Translator,
  OUT UINT32                                *TransferResult
  )
/*++
  
  Routine Description:
  
    Virtual interface to submits isochronous transfer to a target USB device
    for both Hc2 and Hc protocol.
  
  Arguments:
    
    UsbBusDev        - A pointer to bus controller of the device.
    DeviceAddress    - Represents the address of the target device on the USB,
                     which is assigned during USB enumeration.
    EndPointAddress  - End point address
    DeviceSpeed      - Indicates device speed.
    MaximumPacketLength    - Indicates the maximum packet size that the 
                           default control transfer endpoint is capable of 
                           sending or receiving.
    DataBuffersNumber - Number of data buffers prepared for the transfer.
    Data              - Array of pointers to the buffers of data that will be 
                      transmitted to USB device or received from USB device.
    DataLength        - Indicates the size, in bytes, of the data buffer 
                      specified by Data.
    Translator        - A pointr to the transaction translator data.
    TransferResult    - A pointer to the detailed result information generated 
                      by this control transfer.               
                      
  Returns:
  
    EFI_UNSUPPORTED 

--*/
;

EFI_STATUS
EFIAPI
UsbVirtualHcAsyncIsochronousTransfer (
  IN  USB_BUS_CONTROLLER_DEVICE           *UsbBusDev,
  IN  UINT8                               DeviceAddress,
  IN  UINT8                               EndPointAddress,
  IN  UINT8                               DeviceSpeed,
  IN  UINTN                               MaximumPacketLength,
  IN  UINT8                               DataBuffersNumber,
  IN OUT VOID                             *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
  IN  UINTN                               DataLength,
  IN  EFI_USB2_HC_TRANSACTION_TRANSLATOR  *Translator,
  IN  EFI_ASYNC_USB_TRANSFER_CALLBACK     IsochronousCallBack,
  IN  VOID                                *Context
  )
/*++
  
  Routine Description:
  
    Vitual interface to submits Async isochronous transfer to a target USB device
    for both Hc2 and Hc protocol.
  
  Arguments:
  
    UsbBusDev           - A pointer to bus controller of the device.
    DeviceAddress       - Represents the address of the target device on the USB,
                        which is assigned during USB enumeration.
    EndPointAddress     - End point address
    DeviceSpeed         - Indicates device speed.
    MaximumPacketLength - Indicates the maximum packet size that the 
                        default control transfer endpoint is capable of 
                        sending or receiving.
    DataBuffersNumber   - Number of data buffers prepared for the transfer.
    Data                - Array of pointers to the buffers of data that will be transmitted 
                        to USB device or received from USB device.
    DataLength          - Indicates the size, in bytes, of the data buffer 
                        specified by Data.
    Translator          - A pointr to the transaction translator data.
    IsochronousCallBack - When the transfer complete, the call back function will be called
    Context             - Pass to the call back function as parameter
                    
  Returns:
  
    EFI_UNSUPPORTED 

--*/
;

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?