/** @file\r
\r
- The library provides USB descriptor, protocol operations.\r
+ The library provides USB HID Class standard and specific requests defined\r
+ in USB HID Firmware Specification 7 section : Requests.\r
\r
Copyright (c) 2004, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
\r
#include <UefiUsbLibInternal.h>\r
\r
+// \r
+// Hid RequestType Bits specifying characteristics of request.\r
+// Valid values are 10100001b (0xa1) or 00100001b (0x21).\r
+// The following description:\r
+// 7 Data transfer direction\r
+// 0 = Host to device\r
+// 1 = Device to host\r
+// 6..5 Type\r
+// 1 = Class\r
+// 4..0 Recipient\r
+// 1 = Interface\r
+//\r
\r
/**\r
Get Hid Descriptor.\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- Request.RequestType = 0x81;\r
- Request.Request = 0x06;\r
- Request.Value = (UINT16) (0x21 << 8);\r
+ Request.RequestType = USB_HID_GET_DESCRIPTOR_REQ_TYPE;\r
+ Request.Request = USB_REQ_GET_DESCRIPTOR;\r
+ Request.Value = (UINT16) (USB_DESC_TYPE_HID << 8);\r
Request.Index = InterfaceNum;\r
Request.Length = sizeof (EFI_USB_HID_DESCRIPTOR);\r
\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0x81;\r
- Request.Request = 0x06;\r
- Request.Value = (UINT16) (0x22 << 8);\r
+ Request.RequestType = USB_HID_GET_DESCRIPTOR_REQ_TYPE;\r
+ Request.Request = USB_REQ_GET_DESCRIPTOR;\r
+ Request.Value = (UINT16) (USB_DESC_TYPE_REPORT << 8);\r
Request.Index = InterfaceNum;\r
Request.Length = DescriptorSize;\r
\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0xa1;\r
- //\r
- // 10100001b;\r
- //\r
+ Request.RequestType = USB_HID_CLASS_GET_REQ_TYPE;\r
Request.Request = EFI_USB_GET_PROTOCOL_REQUEST;\r
Request.Value = 0;\r
Request.Index = Interface;\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0x21;\r
- //\r
- // 00100001b;\r
- //\r
+ Request.RequestType = USB_HID_CLASS_SET_REQ_TYPE;\r
Request.Request = EFI_USB_SET_PROTOCOL_REQUEST;\r
Request.Value = Protocol;\r
Request.Index = Interface;\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0x21;\r
- //\r
- // 00100001b;\r
- //\r
+ Request.RequestType = USB_HID_CLASS_SET_REQ_TYPE;\r
Request.Request = EFI_USB_SET_IDLE_REQUEST;\r
Request.Value = (UINT16) ((Duration << 8) | ReportId);\r
Request.Index = Interface;\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0xa1;\r
- //\r
- // 10100001b;\r
- //\r
+ Request.RequestType = USB_HID_CLASS_GET_REQ_TYPE;\r
Request.Request = EFI_USB_GET_IDLE_REQUEST;\r
Request.Value = ReportId;\r
Request.Index = Interface;\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0x21;\r
- //\r
- // 00100001b;\r
- //\r
+ Request.RequestType = USB_HID_CLASS_SET_REQ_TYPE;\r
Request.Request = EFI_USB_SET_REPORT_REQUEST;\r
Request.Value = (UINT16) ((ReportType << 8) | ReportId);\r
Request.Index = Interface;\r
//\r
// Fill Device request packet\r
//\r
- Request.RequestType = 0xa1;\r
- //\r
- // 10100001b;\r
- //\r
+ Request.RequestType = USB_HID_CLASS_GET_REQ_TYPE;\r
Request.Request = EFI_USB_GET_REPORT_REQUEST;\r
Request.Value = (UINT16) ((ReportType << 8) | ReportId);\r
Request.Index = Interface;\r