Sync USB modules with main trunk.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3423 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-07-24 09:54:50 +00:00
parent d19862fe4f
commit 50fa1b3a86
6 changed files with 332 additions and 141 deletions

View File

@@ -645,11 +645,16 @@ UsbIoGetEndpointDescriptor (
UsbIf = USB_INTERFACE_FROM_USBIO (This);
if ((Descriptor == NULL) || (Index >= UsbIf->IfSetting->Desc.NumEndpoints)) {
if ((Descriptor == NULL) || (Index > 15)) {
gBS->RestoreTPL (OldTpl);
return EFI_INVALID_PARAMETER;
}
if (Index >= UsbIf->IfSetting->Desc.NumEndpoints) {
gBS->RestoreTPL (OldTpl);
return EFI_NOT_FOUND;
}
CopyMem (
Descriptor,
&(UsbIf->IfSetting->Endpoints[Index]->Desc),
@@ -813,6 +818,11 @@ UsbIoPortReset (
UsbIf = USB_INTERFACE_FROM_USBIO (This);
Dev = UsbIf->Device;
if (UsbIf->IsHub == TRUE) {
Status = EFI_INVALID_PARAMETER;
goto ON_EXIT;
}
HubIf = Dev->ParentIf;
Status = HubIf->HubApi->ResetPort (HubIf, Dev->ParentPort);
@@ -875,7 +885,6 @@ EFI_USB_IO_PROTOCOL mUsbIoProtocol = {
UsbIoPortReset
};
//@MT: EFI_DRIVER_ENTRY_POINT (UsbBusDriverEntryPoint)
EFI_STATUS
EFIAPI