2007-06-28 00:53:31 +02:00
|
|
|
/** @file
|
2007-07-12 19:31:28 +02:00
|
|
|
Common Dxe Libarary for USB
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-06-28 00:53:31 +02:00
|
|
|
Copyright (c) 2006, Intel Corporation<BR>
|
|
|
|
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.
|
|
|
|
|
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
|
|
|
|
|
2007-06-28 00:53:31 +02:00
|
|
|
#ifndef __USB_DXE_LIB_H__
|
|
|
|
#define __USB_DXE_LIB_H__
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-06-22 18:22:26 +02:00
|
|
|
#include <Protocol/UsbIo.h>
|
2007-07-12 19:31:28 +02:00
|
|
|
|
2007-06-19 12:55:24 +02:00
|
|
|
//
|
|
|
|
// define the timeout time as 3ms
|
|
|
|
//
|
|
|
|
#define TIMEOUT_VALUE 3 * 1000
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbGetHidDescriptor (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 InterfaceNum,
|
|
|
|
OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbGetReportDescriptor (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 InterfaceNum,
|
|
|
|
IN UINT16 DescriptorSize,
|
|
|
|
OUT UINT8 *DescriptorBuffer
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbGetProtocolRequest (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 Interface,
|
|
|
|
IN UINT8 *Protocol
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbSetProtocolRequest (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 Interface,
|
|
|
|
IN UINT8 Protocol
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbSetIdleRequest (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 Interface,
|
|
|
|
IN UINT8 ReportId,
|
|
|
|
IN UINT8 Duration
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbGetIdleRequest (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 Interface,
|
|
|
|
IN UINT8 ReportId,
|
|
|
|
OUT UINT8 *Duration
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbSetReportRequest (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 Interface,
|
|
|
|
IN UINT8 ReportId,
|
|
|
|
IN UINT8 ReportType,
|
|
|
|
IN UINT16 ReportLen,
|
|
|
|
IN UINT8 *Report
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbGetReportRequest (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 Interface,
|
|
|
|
IN UINT8 ReportId,
|
|
|
|
IN UINT8 ReportType,
|
|
|
|
IN UINT16 ReportLen,
|
|
|
|
IN UINT8 *Report
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
UsbGetDescriptor (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT16 Value,
|
|
|
|
IN UINT16 Index,
|
|
|
|
IN UINT16 DescriptorLength,
|
|
|
|
OUT VOID *Descriptor,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbSetDescriptor (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT16 Value,
|
|
|
|
IN UINT16 Index,
|
|
|
|
IN UINT16 DescriptorLength,
|
|
|
|
IN VOID *Descriptor,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbGetInterface (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT16 Index,
|
|
|
|
OUT UINT8 *AltSetting,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbSetInterface (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT16 InterfaceNo,
|
|
|
|
IN UINT16 AltSetting,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbGetConfiguration (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
OUT UINT8 *ConfigValue,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbSetConfiguration (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT16 Value,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbSetFeature (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
2007-07-12 19:31:28 +02:00
|
|
|
IN UINTN Recipient,
|
2007-06-19 12:55:24 +02:00
|
|
|
IN UINT16 Value,
|
|
|
|
IN UINT16 Target,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbClearFeature (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
2007-07-12 19:31:28 +02:00
|
|
|
IN UINTN Recipient,
|
2007-06-19 12:55:24 +02:00
|
|
|
IN UINT16 Value,
|
|
|
|
IN UINT16 Target,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-07-12 19:31:28 +02:00
|
|
|
UsbGetStatus (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
2007-07-12 19:31:28 +02:00
|
|
|
IN UINTN Recipient,
|
2007-06-19 12:55:24 +02:00
|
|
|
IN UINT16 Target,
|
|
|
|
OUT UINT16 *DevStatus,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Clear endpoint stall
|
|
|
|
//
|
|
|
|
EFI_STATUS
|
2007-07-30 09:54:23 +02:00
|
|
|
EFIAPI
|
2007-06-19 12:55:24 +02:00
|
|
|
UsbClearEndpointHalt (
|
|
|
|
IN EFI_USB_IO_PROTOCOL *UsbIo,
|
|
|
|
IN UINT8 EndpointNo,
|
|
|
|
OUT UINT32 *Status
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|