Retired macro value TIME_OUT in UefiUsbLib and introduce a new PCD entry PcdUsbTransferTimeoutValue for it.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7467 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2009-02-06 08:30:34 +00:00
parent 2f5c655aae
commit 6544297832
6 changed files with 27 additions and 22 deletions

View File

@ -20,11 +20,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/UsbIo.h> #include <Protocol/UsbIo.h>
#include <IndustryStandard/Usb.h> #include <IndustryStandard/Usb.h>
///
/// define the timeout time as 3ms
///
#define TIMEOUT_VALUE 3 * 1000
/** /**
Get the descriptor of the specified USB HID interface. Get the descriptor of the specified USB HID interface.

View File

@ -73,7 +73,7 @@ UsbGetHidDescriptor (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
HidDescriptor, HidDescriptor,
sizeof (EFI_USB_HID_DESCRIPTOR), sizeof (EFI_USB_HID_DESCRIPTOR),
&Status &Status
@ -133,7 +133,7 @@ UsbGetReportDescriptor (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
DescriptorBuffer, DescriptorBuffer,
DescriptorLength, DescriptorLength,
&Status &Status
@ -188,7 +188,7 @@ UsbGetProtocolRequest (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
Protocol, Protocol,
sizeof (UINT8), sizeof (UINT8),
&Status &Status
@ -242,7 +242,7 @@ UsbSetProtocolRequest (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbNoData, EfiUsbNoData,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
NULL, NULL,
0, 0,
&Status &Status
@ -295,7 +295,7 @@ UsbSetIdleRequest (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbNoData, EfiUsbNoData,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
NULL, NULL,
0, 0,
&Status &Status
@ -350,7 +350,7 @@ UsbGetIdleRequest (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
Duration, Duration,
1, 1,
&Status &Status
@ -413,7 +413,7 @@ UsbSetReportRequest (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbDataOut, EfiUsbDataOut,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
Report, Report,
ReportLen, ReportLen,
&Status &Status
@ -478,7 +478,7 @@ UsbGetReportRequest (
UsbIo, UsbIo,
&Request, &Request,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
Report, Report,
ReportLen, ReportLen,
&Status &Status

View File

@ -40,4 +40,7 @@
[LibraryClasses] [LibraryClasses]
DebugLib DebugLib
BaseMemoryLib BaseMemoryLib
PcdLib
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdUsbTransferTimeoutValue

View File

@ -21,6 +21,7 @@
#include <Library/UefiUsbLib.h> #include <Library/UefiUsbLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <IndustryStandard/Usb.h> #include <IndustryStandard/Usb.h>

View File

@ -73,7 +73,7 @@ UsbGetDescriptor (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
Descriptor, Descriptor,
DescriptorLength, DescriptorLength,
Status Status
@ -133,7 +133,7 @@ UsbSetDescriptor (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbDataOut, EfiUsbDataOut,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
Descriptor, Descriptor,
DescriptorLength, DescriptorLength,
Status Status
@ -188,7 +188,7 @@ UsbGetInterface (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
AlternateSetting, AlternateSetting,
2, 2,
Status Status
@ -241,7 +241,7 @@ UsbSetInterface (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbNoData, EfiUsbNoData,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
NULL, NULL,
0, 0,
Status Status
@ -293,7 +293,7 @@ UsbGetConfiguration (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
ConfigurationValue, ConfigurationValue,
2, 2,
Status Status
@ -343,7 +343,7 @@ UsbSetConfiguration (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbNoData, EfiUsbNoData,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
NULL, NULL,
0, 0,
Status Status
@ -420,7 +420,7 @@ UsbSetFeature (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbNoData, EfiUsbNoData,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
NULL, NULL,
0, 0,
Status Status
@ -498,7 +498,7 @@ UsbClearFeature (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbNoData, EfiUsbNoData,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
NULL, NULL,
0, 0,
Status Status
@ -577,7 +577,7 @@ UsbGetStatus (
UsbIo, UsbIo,
&DevReq, &DevReq,
EfiUsbDataIn, EfiUsbDataIn,
TIMEOUT_VALUE, PcdGet32 (PcdUsbTransferTimeoutValue),
DeviceStatus, DeviceStatus,
2, 2,
Status Status

View File

@ -518,6 +518,9 @@
## Indicates the allowable maximum number in extract handler table ## Indicates the allowable maximum number in extract handler table
gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10|UINT32|0x00000025 gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10|UINT32|0x00000025
## Indicates the default timeouts for USB transfers in milliseconds
gEfiMdePkgTokenSpaceGuid.PcdUsbTransferTimeoutValue|3000|UINT32|0x00000026
## Default current ISO 639-2 language: English ## Default current ISO 639-2 language: English
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d
@ -612,6 +615,9 @@
## Indicates the allowable maximum number in extract handler table ## Indicates the allowable maximum number in extract handler table
gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10|UINT32|0x00000025 gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10|UINT32|0x00000025
## Indicates the default timeouts for USB transfers in milliseconds
gEfiMdePkgTokenSpaceGuid.PcdUsbTransferTimeoutValue|3000|UINT32|0x00000026
[PcdsDynamic.common] [PcdsDynamic.common]
## Default current ISO 639-2 language: English & French ## Default current ISO 639-2 language: English & French
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c