MdePkg/Library/UefiUsbLib/Hid.c File Reference


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 - 2010, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the HID interface on the USB target.
HidDescriptor The 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_SUCCESS The request executed successfully.
EFI_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EfiUsbDataIn, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_DESC_TYPE_HID, USB_HID_GET_DESCRIPTOR_REQ_TYPE, USB_REQ_GET_DESCRIPTOR, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
ReportId The identifier of the report to retrieve.
Duration A pointer to the idle rate retrieved from the specified USB target.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EFI_USB_GET_IDLE_REQUEST, EfiUsbDataIn, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_HID_CLASS_GET_REQ_TYPE, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
Protocol A pointer to the protocol for the specified USB target.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EFI_USB_GET_PROTOCOL_REQUEST, EfiUsbDataIn, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_HID_CLASS_GET_REQ_TYPE, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
DescriptorLength The size, in bytes, of DescriptorBuffer.
DescriptorBuffer A pointer to the buffer to store the report class descriptor.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_OUT_OF_RESOURCES The 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_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EfiUsbDataIn, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_DESC_TYPE_REPORT, USB_HID_GET_DESCRIPTOR_REQ_TYPE, USB_REQ_GET_DESCRIPTOR, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
ReportId The identifier of the report to retrieve.
ReportType The type of report to retrieve.
ReportLength The size, in bytes, of Report.
Report A pointer to the buffer to store the report descriptor.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_OUT_OF_RESOURCES The 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_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EFI_USB_GET_REPORT_REQUEST, EfiUsbDataIn, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_HID_CLASS_GET_REQ_TYPE, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
ReportId The identifier of the report to retrieve.
Duration The idle rate to set for the specified USB target.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EFI_USB_SET_IDLE_REQUEST, EfiUsbNoData, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_HID_CLASS_SET_REQ_TYPE, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
Protocol The protocol value to set for the specified USB target.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EFI_USB_SET_PROTOCOL_REQUEST, EfiUsbNoData, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_HID_CLASS_SET_REQ_TYPE, and USB_DEVICE_REQUEST::Value.

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:
UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
Interface The index of the report interface on the USB target.
ReportId The identifier of the report to retrieve.
ReportType The type of report to retrieve.
ReportLength The size, in bytes, of Report.
Report A pointer to the report descriptor buffer to set.
Return values:
EFI_SUCCESS The request executed successfully.
EFI_TIMEOUT A timeout occurred executing the request.
EFI_DEVICE_ERROR The request failed due to a device error.

References ASSERT, EFI_USB_SET_REPORT_REQUEST, EfiUsbDataOut, USB_DEVICE_REQUEST::Index, USB_DEVICE_REQUEST::Length, NULL, PcdGet32, USB_DEVICE_REQUEST::Request, USB_DEVICE_REQUEST::RequestType, USB_HID_CLASS_SET_REQ_TYPE, and USB_DEVICE_REQUEST::Value.


Generated on Thu Sep 24 23:14:24 2015 for MdePkg[ALL] by  doxygen 1.5.7.1