1. Add the GLOBAL_REMOVE_IF_UNREFERENCED to globe variables which are used only in debug version;
2. Use ZeroMem to replace gBS->SetMem; 3. Remove marked code; 4. Add IsHub judgement in UsbPortReset function to following EFI1.1 spec; 5. Add brackets for macro definition git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1740 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -696,7 +696,7 @@ UsbSetConfiguration (
|
||||
|
||||
--*/
|
||||
{
|
||||
LIST_ENTRY *NextEntry;
|
||||
LIST_ENTRY *NextEntry;
|
||||
CONFIG_DESC_LIST_ENTRY *ConfigEntry;
|
||||
UINT32 Status;
|
||||
EFI_STATUS Result;
|
||||
@@ -752,7 +752,7 @@ UsbSetDefaultConfiguration (
|
||||
{
|
||||
CONFIG_DESC_LIST_ENTRY *ConfigEntry;
|
||||
UINT16 ConfigValue;
|
||||
LIST_ENTRY *NextEntry;
|
||||
LIST_ENTRY *NextEntry;
|
||||
|
||||
if (IsListEmpty (&UsbIoDev->ConfigDescListHead)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
|
@@ -23,8 +23,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include "usbbus.h"
|
||||
|
||||
UINTN gUSBDebugLevel = EFI_D_INFO;
|
||||
UINTN gUSBErrorLevel = EFI_D_ERROR;
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINTN gUSBDebugLevel = EFI_D_INFO;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINTN gUSBErrorLevel = EFI_D_ERROR;
|
||||
|
||||
//
|
||||
// The UsbBusProtocol is just used to locate USB_BUS_CONTROLLER
|
||||
@@ -2328,17 +2329,18 @@ UsbPortReset (
|
||||
--*/
|
||||
{
|
||||
USB_IO_CONTROLLER_DEVICE *UsbIoController;
|
||||
EFI_STATUS Status;
|
||||
|
||||
UsbIoController = USB_IO_CONTROLLER_DEVICE_FROM_USB_IO_THIS (This);
|
||||
|
||||
if (IsHub (UsbIoController)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Since at this time, this device has already been configured,
|
||||
// it needs to be re-configured.
|
||||
//
|
||||
Status = ParentPortReset (UsbIoController, TRUE, 0);
|
||||
|
||||
return Status;
|
||||
return ParentPortReset (UsbIoController, TRUE, 0);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
|
@@ -30,8 +30,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include "hub.h"
|
||||
#include "usbutil.h"
|
||||
|
||||
extern UINTN gUSBDebugLevel;
|
||||
extern UINTN gUSBErrorLevel;
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED extern UINTN gUSBDebugLevel;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED extern UINTN gUSBErrorLevel;
|
||||
|
||||
|
||||
#define MICROSECOND 10000
|
||||
#define ONESECOND (1000 * MICROSECOND)
|
||||
|
@@ -181,6 +181,19 @@ VOID
|
||||
InitializeUsbIoInstance (
|
||||
IN USB_IO_CONTROLLER_DEVICE *UsbIoController
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Initialize the instance of UsbIo controller
|
||||
|
||||
Arguments:
|
||||
|
||||
UsbIoController - A pointer to controller structure of UsbIo
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Copy EFI_USB_IO protocol instance
|
||||
@@ -349,11 +362,10 @@ UsbBulkTransfer (
|
||||
UINT8 DataToggle;
|
||||
UINT8 OldToggle;
|
||||
EFI_STATUS RetStatus;
|
||||
|
||||
USB_IO_CONTROLLER_DEVICE *UsbIoController;
|
||||
ENDPOINT_DESC_LIST_ENTRY *EndPointListEntry;
|
||||
UINT32 TransferResult;
|
||||
UINT8 DataBuffersNumber;
|
||||
UINT32 TransferResult;
|
||||
|
||||
DataBuffersNumber = 1;
|
||||
UsbIoController = USB_IO_CONTROLLER_DEVICE_FROM_USB_IO_THIS (This);
|
||||
|
Reference in New Issue
Block a user