45 IN UINT16 DescriptorLength,
52 ASSERT (UsbIo !=
NULL);
53 ASSERT (Descriptor !=
NULL);
54 ASSERT (Status !=
NULL);
58 DevReq.RequestType = USB_DEV_GET_DESCRIPTOR_REQ_TYPE;
59 DevReq.Request = USB_REQ_GET_DESCRIPTOR;
62 DevReq.Length = DescriptorLength;
64 return UsbIo->UsbControlTransfer (
68 PcdGet32 (PcdUsbTransferTimeoutValue),
104 IN UINT16 DescriptorLength,
111 ASSERT (UsbIo !=
NULL);
112 ASSERT (Descriptor !=
NULL);
113 ASSERT (Status !=
NULL);
117 DevReq.RequestType = USB_DEV_SET_DESCRIPTOR_REQ_TYPE;
118 DevReq.Request = USB_REQ_SET_DESCRIPTOR;
119 DevReq.Value = Value;
120 DevReq.Index = Index;
121 DevReq.Length = DescriptorLength;
123 return UsbIo->UsbControlTransfer (
127 PcdGet32 (PcdUsbTransferTimeoutValue),
160 OUT UINT16 *AlternateSetting,
166 ASSERT (UsbIo !=
NULL);
167 ASSERT (AlternateSetting !=
NULL);
168 ASSERT (Status !=
NULL);
170 *AlternateSetting = 0;
174 DevReq.RequestType = USB_DEV_GET_INTERFACE_REQ_TYPE;
175 DevReq.Request = USB_REQ_GET_INTERFACE;
176 DevReq.Index = Interface;
179 return UsbIo->UsbControlTransfer (
183 PcdGet32 (PcdUsbTransferTimeoutValue),
215 IN UINT16 AlternateSetting,
221 ASSERT (UsbIo !=
NULL);
222 ASSERT (Status !=
NULL);
226 DevReq.RequestType = USB_DEV_SET_INTERFACE_REQ_TYPE;
227 DevReq.Request = USB_REQ_SET_INTERFACE;
228 DevReq.Value = AlternateSetting;
229 DevReq.Index = Interface;
231 return UsbIo->UsbControlTransfer (
235 PcdGet32 (PcdUsbTransferTimeoutValue),
266 OUT UINT16 *ConfigurationValue,
272 ASSERT (UsbIo !=
NULL);
273 ASSERT (ConfigurationValue !=
NULL);
274 ASSERT (Status !=
NULL);
276 *ConfigurationValue = 0;
280 DevReq.RequestType = USB_DEV_GET_CONFIGURATION_REQ_TYPE;
281 DevReq.Request = USB_REQ_GET_CONFIG;
284 return UsbIo->UsbControlTransfer (
288 PcdGet32 (PcdUsbTransferTimeoutValue),
318 IN UINT16 ConfigurationValue,
324 ASSERT (UsbIo !=
NULL);
325 ASSERT (Status !=
NULL);
329 DevReq.RequestType = USB_DEV_SET_CONFIGURATION_REQ_TYPE;
330 DevReq.Request = USB_REQ_SET_CONFIG;
331 DevReq.Value = ConfigurationValue;
333 return UsbIo->UsbControlTransfer (
337 PcdGet32 (PcdUsbTransferTimeoutValue),
371 IN USB_TYPES_DEFINITION Recipient,
379 ASSERT (UsbIo !=
NULL);
380 ASSERT (Status !=
NULL);
385 case USB_TARGET_DEVICE:
386 DevReq.RequestType = USB_DEV_SET_FEATURE_REQ_TYPE_D;
389 case USB_TARGET_INTERFACE:
390 DevReq.RequestType = USB_DEV_SET_FEATURE_REQ_TYPE_I;
393 case USB_TARGET_ENDPOINT:
394 DevReq.RequestType = USB_DEV_SET_FEATURE_REQ_TYPE_E;
404 DevReq.Request = USB_REQ_SET_FEATURE;
405 DevReq.Value = Value;
406 DevReq.Index = Target;
408 return UsbIo->UsbControlTransfer (
412 PcdGet32 (PcdUsbTransferTimeoutValue),
446 IN USB_TYPES_DEFINITION Recipient,
454 ASSERT (UsbIo !=
NULL);
455 ASSERT (Status !=
NULL);
460 case USB_TARGET_DEVICE:
461 DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_D;
464 case USB_TARGET_INTERFACE:
465 DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_I;
468 case USB_TARGET_ENDPOINT:
469 DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_E;
479 DevReq.Request = USB_REQ_CLEAR_FEATURE;
480 DevReq.Value = Value;
481 DevReq.Index = Target;
483 return UsbIo->UsbControlTransfer (
487 PcdGet32 (PcdUsbTransferTimeoutValue),
522 IN USB_TYPES_DEFINITION Recipient,
524 OUT UINT16 *DeviceStatus,
530 ASSERT (UsbIo !=
NULL);
531 ASSERT (DeviceStatus !=
NULL);
532 ASSERT (Status !=
NULL);
537 case USB_TARGET_DEVICE:
538 DevReq.RequestType = USB_DEV_GET_STATUS_REQ_TYPE_D;
541 case USB_TARGET_INTERFACE:
542 DevReq.RequestType = USB_DEV_GET_STATUS_REQ_TYPE_I;
545 case USB_TARGET_ENDPOINT:
546 DevReq.RequestType = USB_DEV_GET_STATUS_REQ_TYPE_E;
556 DevReq.Request = USB_REQ_GET_STATUS;
558 DevReq.Index = Target;
561 return UsbIo->UsbControlTransfer (
565 PcdGet32 (PcdUsbTransferTimeoutValue),
606 ASSERT (UsbIo !=
NULL);
607 ASSERT (Status !=
NULL);
613 Result = UsbIo->UsbGetInterfaceDescriptor (
617 if (EFI_ERROR (Result)) {
621 for (Index = 0; Index < InterfaceDescriptor.NumEndpoints; Index++) {
622 Result = UsbIo->UsbGetEndpointDescriptor (
627 if (EFI_ERROR (Result)) {
631 if (EndpointDescriptor.EndpointAddress == Endpoint) {
636 if (Index == InterfaceDescriptor.NumEndpoints) {
640 return EFI_NOT_FOUND;
646 USB_FEATURE_ENDPOINT_HALT,
647 EndpointDescriptor.EndpointAddress,
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define PcdGet32(TokenName)
EFI_STATUS EFIAPI UsbGetConfiguration(IN EFI_USB_IO_PROTOCOL *UsbIo, OUT UINT16 *ConfigurationValue, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbSetDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Value, IN UINT16 Index, IN UINT16 DescriptorLength, IN VOID *Descriptor, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbClearFeature(IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_TYPES_DEFINITION Recipient, IN UINT16 Value, IN UINT16 Target, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbSetInterface(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Interface, IN UINT16 AlternateSetting, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbClearEndpointHalt(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Endpoint, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbGetInterface(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Interface, OUT UINT16 *AlternateSetting, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbSetConfiguration(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 ConfigurationValue, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbSetFeature(IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_TYPES_DEFINITION Recipient, IN UINT16 Value, IN UINT16 Target, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbGetStatus(IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_TYPES_DEFINITION Recipient, IN UINT16 Target, OUT UINT16 *DeviceStatus, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbGetDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Value, IN UINT16 Index, IN UINT16 DescriptorLength, OUT VOID *Descriptor, OUT UINT32 *Status)