1. Import UsbKbDxe and UsbMouseDxe into MdeModulePkg

2. Updated UefiUsbLib

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3216 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-07-12 17:31:28 +00:00
parent 1e5e792546
commit ed838d0c5e
21 changed files with 5097 additions and 575 deletions

View File

@@ -1,13 +1,13 @@
/*++
/** @file
Copyright (c) 2006, 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.
Copyright (c) 2004, 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.
Module Name:
@@ -19,36 +19,34 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Revision History
--*/
#include "UefiUsbLibInternal.h"
**/
#include <PiDxe.h>
#include <Library/UsbLib.h>
//
// Function to get HID descriptor
//
/**
Get Hid Descriptor
@param UsbIo EFI_USB_IO_PROTOCOL
@param InterfaceNum Hid interface number
@param HidDescriptor Caller allocated buffer to store Usb hid descriptor if
successfully returned.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbGetHidDescriptor (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT8 InterfaceNum,
OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor
)
/*++
Routine Description:
Get Hid Descriptor
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
InterfaceNum - Hid interface number
HidDescriptor - Caller allocated buffer to store Usb hid descriptor
if successfully returned.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -76,6 +74,21 @@ UsbGetHidDescriptor (
//
// Function to get Report Class descriptor
//
/**
get Report Class descriptor
@param UsbIo EFI_USB_IO_PROTOCOL.
@param InterfaceNum Report interface number.
@param DescriptorSize Length of DescriptorBuffer.
@param DescriptorBuffer Caller allocated buffer to store Usb report descriptor
if successfully returned.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbGetReportDescriptor (
IN EFI_USB_IO_PROTOCOL *UsbIo,
@@ -83,24 +96,6 @@ UsbGetReportDescriptor (
IN UINT16 DescriptorSize,
OUT UINT8 *DescriptorBuffer
)
/*++
Routine Description:
get Report Class descriptor
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL.
InterfaceNum - Report interface number.
DescriptorSize - Length of DescriptorBuffer.
DescriptorBuffer - Caller allocated buffer to store Usb report descriptor
if successfully returned.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -131,28 +126,25 @@ UsbGetReportDescriptor (
//
// Following are HID class request
//
/**
Get Hid Protocol Request
@param UsbIo EFI_USB_IO_PROTOCOL
@param Interface Which interface the caller wants to get protocol
@param Protocol Protocol value returned.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbGetProtocolRequest (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT8 Interface,
IN UINT8 *Protocol
)
/*++
Routine Description:
Get Hid Protocol Request
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
Interface - Which interface the caller wants to get protocol
Protocol - Protocol value returned.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -184,28 +176,25 @@ UsbGetProtocolRequest (
}
/**
Set Hid Protocol Request
@param UsbIo EFI_USB_IO_PROTOCOL
@param Interface Which interface the caller wants to set protocol
@param Protocol Protocol value the caller wants to set.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbSetProtocolRequest (
IN EFI_USB_IO_PROTOCOL *UsbIo,
IN UINT8 Interface,
IN UINT8 Protocol
)
/*++
Routine Description:
Set Hid Protocol Request
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
Interface - Which interface the caller wants to set protocol
Protocol - Protocol value the caller wants to set.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -236,6 +225,20 @@ UsbSetProtocolRequest (
}
/**
Set Idel request.
@param UsbIo EFI_USB_IO_PROTOCOL
@param Interface Which interface the caller wants to set.
@param ReportId Which report the caller wants to set.
@param Duration Idle rate the caller wants to set.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbSetIdleRequest (
IN EFI_USB_IO_PROTOCOL *UsbIo,
@@ -243,23 +246,6 @@ UsbSetIdleRequest (
IN UINT8 ReportId,
IN UINT8 Duration
)
/*++
Routine Description:
Set Idel request.
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
Interface - Which interface the caller wants to set.
ReportId - Which report the caller wants to set.
Duration - Idle rate the caller wants to set.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -289,6 +275,20 @@ UsbSetIdleRequest (
return Result;
}
/**
Get Idel request.
@param UsbIo EFI_USB_IO_PROTOCOL
@param Interface Which interface the caller wants to get.
@param ReportId Which report the caller wants to get.
@param Duration Idle rate the caller wants to get.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbGetIdleRequest (
IN EFI_USB_IO_PROTOCOL *UsbIo,
@@ -296,23 +296,6 @@ UsbGetIdleRequest (
IN UINT8 ReportId,
OUT UINT8 *Duration
)
/*++
Routine Description:
Get Idel request.
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
Interface - Which interface the caller wants to get.
ReportId - Which report the caller wants to get.
Duration - Idle rate the caller wants to get.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -344,6 +327,22 @@ UsbGetIdleRequest (
}
/**
Hid Set Report request.
@param UsbIo EFI_USB_IO_PROTOCOL
@param Interface Which interface the caller wants to set.
@param ReportId Which report the caller wants to set.
@param ReportType Type of report.
@param ReportLen Length of report descriptor.
@param Report Report Descriptor buffer.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbSetReportRequest (
IN EFI_USB_IO_PROTOCOL *UsbIo,
@@ -353,25 +352,6 @@ UsbSetReportRequest (
IN UINT16 ReportLen,
IN UINT8 *Report
)
/*++
Routine Description:
Hid Set Report request.
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
Interface - Which interface the caller wants to set.
ReportId - Which report the caller wants to set.
ReportType - Type of report.
ReportLen - Length of report descriptor.
Report - Report Descriptor buffer.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;
@@ -402,6 +382,22 @@ UsbSetReportRequest (
return Result;
}
/**
Hid Set Report request.
@param UsbIo EFI_USB_IO_PROTOCOL
@param Interface Which interface the caller wants to set.
@param ReportId Which report the caller wants to set.
@param ReportType Type of report.
@param ReportLen Length of report descriptor.
@param Report Caller allocated buffer to store Report Descriptor.
@return EFI_SUCCESS
@return EFI_DEVICE_ERROR
@return EFI_TIMEOUT
**/
EFI_STATUS
UsbGetReportRequest (
IN EFI_USB_IO_PROTOCOL *UsbIo,
@@ -411,25 +407,6 @@ UsbGetReportRequest (
IN UINT16 ReportLen,
IN UINT8 *Report
)
/*++
Routine Description:
Hid Set Report request.
Arguments:
UsbIo - EFI_USB_IO_PROTOCOL
Interface - Which interface the caller wants to set.
ReportId - Which report the caller wants to set.
ReportType - Type of report.
ReportLen - Length of report descriptor.
Report - Caller allocated buffer to store Report Descriptor.
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
EFI_TIMEOUT
--*/
{
UINT32 Status;
EFI_STATUS Result;