TianoCore EDK2 master
Loading...
Searching...
No Matches
Hid.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI UsbGetHidDescriptor (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor)
 
EFI_STATUS EFIAPI UsbGetReportDescriptor (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT16 DescriptorLength, OUT UINT8 *DescriptorBuffer)
 
EFI_STATUS EFIAPI UsbGetProtocolRequest (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, OUT UINT8 *Protocol)
 
EFI_STATUS EFIAPI UsbSetProtocolRequest (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT8 Protocol)
 
EFI_STATUS EFIAPI UsbSetIdleRequest (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT8 ReportId, IN UINT8 Duration)
 
EFI_STATUS EFIAPI UsbGetIdleRequest (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT8 ReportId, OUT UINT8 *Duration)
 
EFI_STATUS EFIAPI UsbSetReportRequest (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT8 ReportId, IN UINT8 ReportType, IN UINT16 ReportLen, IN UINT8 *Report)
 
EFI_STATUS EFIAPI UsbGetReportRequest (IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT8 ReportId, IN UINT8 ReportType, IN UINT16 ReportLen, OUT UINT8 *Report)
 

Detailed Description

The library provides USB HID Class standard and specific requests defined in USB HID Firmware Specification 7 section : Requests.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Hid.c.

Function Documentation

◆ UsbGetHidDescriptor()

EFI_STATUS EFIAPI UsbGetHidDescriptor ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
OUT EFI_USB_HID_DESCRIPTOR HidDescriptor 
)

Get the descriptor of the specified USB HID interface.

Submit a USB get HID descriptor request for the USB device specified by UsbIo and Interface and return the HID descriptor in HidDescriptor. If UsbIo is NULL, then ASSERT(). If HidDescriptor is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the HID interface on the USB target.
HidDescriptorThe pointer to the USB HID descriptor that was retrieved from the specified USB target and interface. Type EFI_USB_HID_DESCRIPTOR is defined in the MDE Package Industry Standard include file Usb.h.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 47 of file Hid.c.

◆ UsbGetIdleRequest()

EFI_STATUS EFIAPI UsbGetIdleRequest ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
IN UINT8  ReportId,
OUT UINT8 *  Duration 
)

Get the idle rate of the specified USB HID report.

Submit a USB get HID report idle request for the USB device specified by UsbIo, Interface, and ReportId, and return the ide rate in Duration. If UsbIo is NULL, then ASSERT(). If Duration is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
ReportIdThe identifier of the report to retrieve.
DurationA pointer to the idle rate retrieved from the specified USB target.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 315 of file Hid.c.

◆ UsbGetProtocolRequest()

EFI_STATUS EFIAPI UsbGetProtocolRequest ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
OUT UINT8 *  Protocol 
)

Get the HID protocol of the specified USB HID interface.

Submit a USB get HID protocol request for the USB device specified by UsbIo and Interface and return the protocol retrieved in Protocol. If UsbIo is NULL, then ASSERT(). If Protocol is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
ProtocolA pointer to the protocol for the specified USB target.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 157 of file Hid.c.

◆ UsbGetReportDescriptor()

EFI_STATUS EFIAPI UsbGetReportDescriptor ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
IN UINT16  DescriptorLength,
OUT UINT8 *  DescriptorBuffer 
)

Get the report descriptor of the specified USB HID interface.

Submit a USB get HID report descriptor request for the USB device specified by UsbIo and Interface and return the report descriptor in DescriptorBuffer. If UsbIo is NULL, then ASSERT(). If DescriptorBuffer is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
DescriptorLengthThe size, in bytes, of DescriptorBuffer.
DescriptorBufferA pointer to the buffer to store the report class descriptor.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_OUT_OF_RESOURCESThe request could not be completed because the buffer specified by DescriptorLength and DescriptorBuffer is not large enough to hold the result of the request.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 102 of file Hid.c.

◆ UsbGetReportRequest()

EFI_STATUS EFIAPI UsbGetReportRequest ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
IN UINT8  ReportId,
IN UINT8  ReportType,
IN UINT16  ReportLen,
OUT UINT8 *  Report 
)

Get the report descriptor of the specified USB HID interface.

Submit a USB get HID report request for the USB device specified by UsbIo, Interface, ReportId, and ReportType, and return the report in the buffer specified by Report. If UsbIo is NULL, then ASSERT(). If Report is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
ReportIdThe identifier of the report to retrieve.
ReportTypeThe type of report to retrieve.
ReportLengthThe size, in bytes, of Report.
ReportA pointer to the buffer to store the report descriptor.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_OUT_OF_RESOURCESThe request could not be completed because the buffer specified by ReportLength and Report is not large enough to hold the result of the request.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 437 of file Hid.c.

◆ UsbSetIdleRequest()

EFI_STATUS EFIAPI UsbSetIdleRequest ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
IN UINT8  ReportId,
IN UINT8  Duration 
)

Set the idle rate of the specified USB HID report.

Submit a USB set HID report idle request for the USB device specified by UsbIo, Interface, and ReportId, and set the idle rate to the value specified by Duration. If UsbIo is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
ReportIdThe identifier of the report to retrieve.
DurationThe idle rate to set for the specified USB target.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 262 of file Hid.c.

◆ UsbSetProtocolRequest()

EFI_STATUS EFIAPI UsbSetProtocolRequest ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
IN UINT8  Protocol 
)

Set the HID protocol of the specified USB HID interface.

Submit a USB set HID protocol request for the USB device specified by UsbIo and Interface and set the protocol to the value specified by Protocol. If UsbIo is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
ProtocolThe protocol value to set for the specified USB target.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 210 of file Hid.c.

◆ UsbSetReportRequest()

EFI_STATUS EFIAPI UsbSetReportRequest ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN UINT8  Interface,
IN UINT8  ReportId,
IN UINT8  ReportType,
IN UINT16  ReportLen,
IN UINT8 *  Report 
)

Set the report descriptor of the specified USB HID interface.

Submit a USB set HID report request for the USB device specified by UsbIo, Interface, ReportId, and ReportType, and set the report descriptor using the buffer specified by ReportLength and Report. If UsbIo is NULL, then ASSERT(). If Report is NULL, then ASSERT().

Parameters
UsbIoA pointer to the USB I/O Protocol instance for the specific USB target.
InterfaceThe index of the report interface on the USB target.
ReportIdThe identifier of the report to retrieve.
ReportTypeThe type of report to retrieve.
ReportLengthThe size, in bytes, of Report.
ReportA pointer to the report descriptor buffer to set.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 373 of file Hid.c.