📄 usblib.h
字号:
/*++
Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
usblib.h
Abstract:
Common Libarary for USB
Revision History
--*/
#ifndef _USB_LIB_H
#define _USB_LIB_H
//
// Get Device Descriptor
//
EFI_STATUS
UsbGetDescriptor (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 Value,
IN UINT16 Index,
IN UINT16 DescriptorLength,
IN VOID *Descriptor,
OUT UINT32 *Status
);
//
// Set Device Descriptor
//
EFI_STATUS
UsbSetDescriptor (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 Value,
IN UINT16 Index,
IN UINT16 DescriptorLength,
IN VOID *Descriptor,
OUT UINT32 *Status
);
//
// Set device address;
//
EFI_STATUS
UsbSetDeviceAddress (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 AddressValue,
OUT UINT32 *Status
);
//
// Get device Interface
//
EFI_STATUS
UsbGetDeviceInterface (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 Index,
OUT UINT8 *AltSetting,
OUT UINT32 *Status
);
//
// Set device interface
//
EFI_STATUS
UsbSetDeviceInterface (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 InterfaceNo,
IN UINT16 AltSetting,
OUT UINT32 *Status
);
//
// Get device configuration
//
EFI_STATUS
UsbGetDeviceConfiguration (
IN EFI_USB_IO_PROTOCOL *UsbIo,
OUT UINT8 *ConfigValue,
OUT UINT32 *Status
);
//
// Set device configuration
//
EFI_STATUS
UsbSetDeviceConfiguration (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 Value,
OUT UINT32 *Status
);
//
// Set Device Feature
//
EFI_STATUS
UsbSetDeviceFeature (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN EFI_USB_RECIPIENT Recipient,
IN UINT16 Value,
IN UINT16 Target,
OUT UINT32 *Status
) ;
//
// Clear Device Feature
//
EFI_STATUS
UsbClearDeviceFeature (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN EFI_USB_RECIPIENT Recipient,
IN UINT16 Value,
IN UINT16 Target,
OUT UINT32 *Status
) ;
//
// Get Device Status
//
EFI_STATUS
UsbGetDeviceStatus (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN EFI_USB_RECIPIENT Recipient,
IN UINT16 Target,
OUT UINT16 *DevStatus,
OUT UINT32 *Status
) ;
//
// The following APIs are not basic library, but they are common used.
//
//
// Usb Get String
//
EFI_STATUS
UsbGetString(
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT16 LangID,
IN UINT8 Index,
IN VOID *Buf,
IN UINTN BufSize,
OUT UINT32 *Status
) ;
//
// Clear endpoint stall
//
EFI_STATUS
UsbClearEndpointHalt (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT8 EndpointNo,
OUT UINT32 *Status
);
//
// Get the descriptor stored in the UsbIoController Device structure
//
EFI_STATUS
UsbGetDeviceDescriptor (
IN struct _EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_DEVICE_DESCRIPTOR **DeviceDescriptor
);
EFI_STATUS
UsbGetActiveConfigDescriptor (
IN struct _EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_CONFIG_DESCRIPTOR **ConfigurationDescriptor
);
EFI_STATUS
UsbGetInterfaceDescriptor (
IN struct _EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_INTERFACE_DESCRIPTOR **InterfaceDescriptor
);
EFI_STATUS
UsbGetEndpointDescriptor (
IN struct _EFI_USB_IO_PROTOCOL *This,
IN UINT8 EndpointIndex,
OUT EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptor
);
EFI_USB_ENDPOINT_DESCRIPTOR *
GetEndpointDescriptor (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT8 EndpointAddr
);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -