diff options
Diffstat (limited to 'EdkModulePkg/Bus/Usb')
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbBus/Dxe/usb.c | 4 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c | 14 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.h | 6 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbio.c | 16 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c | 13 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c | 13 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c | 1 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageData.h | 2 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c | 1 |
9 files changed, 39 insertions, 31 deletions
diff --git a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usb.c b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usb.c index 474e38829e..272161083b 100644 --- a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usb.c +++ b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usb.c @@ -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;
diff --git a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c index 1d1f44d638..d9387a60b1 100644 --- a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c +++ b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c @@ -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
diff --git a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.h b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.h index 47f0fd804f..8dd36f35d4 100644 --- a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.h +++ b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.h @@ -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)
diff --git a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbio.c b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbio.c index eb563b8e8b..afd2e46541 100644 --- a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbio.c +++ b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbio.c @@ -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);
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c index afd4d623c3..913ac225e9 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c @@ -354,21 +354,18 @@ Cbi0DriverBindingStart ( //
if (EndpointDescriptor.Attributes == 0x02) {
if (EndpointDescriptor.EndpointAddress & 0x80) {
- CopyMem (&UsbCbiDev->BulkInEndpointDescriptor, &EndpointDescriptor, sizeof(EndpointDescriptor));
- // UsbCbiDev->BulkInEndpointDescriptor = EndpointDescriptor;
- EndpointExistMask |= bit (0);
+ CopyMem (&UsbCbiDev->BulkInEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
+ EndpointExistMask |= bit (0);
} else {
- CopyMem (&UsbCbiDev->BulkOutEndpointDescriptor, &EndpointDescriptor, sizeof(EndpointDescriptor));
- // UsbCbiDev->BulkOutEndpointDescriptor = EndpointDescriptor;
- EndpointExistMask |= bit (1);
+ CopyMem (&UsbCbiDev->BulkOutEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
+ EndpointExistMask |= bit (1);
}
}
//
// We parse interrupt endpoint
//
if (EndpointDescriptor.Attributes == 0x03) {
- CopyMem (&UsbCbiDev->InterruptEndpointDescriptor, &EndpointDescriptor, sizeof(EndpointDescriptor));
- // UsbCbiDev->InterruptEndpointDescriptor = EndpointDescriptor;
+ CopyMem (&UsbCbiDev->InterruptEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
EndpointExistMask |= bit (2);
}
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c index 3f1b02cf70..dd1c927dae 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c @@ -309,12 +309,10 @@ CBI1DriverBindingStart ( //
if (EndpointDescriptor.Attributes == 0x02) {
if (EndpointDescriptor.EndpointAddress & 0x80) {
- CopyMem (&UsbCbiDev->BulkInEndpointDescriptor, &EndpointDescriptor, sizeof(EndpointDescriptor));
- //UsbCbiDev->BulkInEndpointDescriptor = EndpointDescriptor;
- } else {
- CopyMem (&UsbCbiDev->BulkOutEndpointDescriptor, &EndpointDescriptor, sizeof(EndpointDescriptor));
- //UsbCbiDev->BulkOutEndpointDescriptor = EndpointDescriptor;
- }
+ CopyMem (&UsbCbiDev->BulkInEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
+ } else {
+ CopyMem (&UsbCbiDev->BulkOutEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
+ }
Found = TRUE;
}
@@ -322,8 +320,7 @@ CBI1DriverBindingStart ( // We parse interrupt endpoint
//
if (EndpointDescriptor.Attributes == 0x03) {
- CopyMem (&UsbCbiDev->InterruptEndpointDescriptor, &EndpointDescriptor, sizeof(EndpointDescriptor));
- //UsbCbiDev->InterruptEndpointDescriptor = EndpointDescriptor;
+ CopyMem (&UsbCbiDev->InterruptEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
Found = TRUE;
}
diff --git a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c index a9cdbc8760..a59de11998 100644 --- a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c +++ b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c @@ -297,7 +297,6 @@ USBKeyboardDriverBindingStart ( // We only care interrupt endpoint here
//
CopyMem (&UsbKeyboardDevice->IntEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
- //UsbKeyboardDevice->IntEndpointDescriptor = EndpointDescriptor;
Found = TRUE;
}
}
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageData.h b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageData.h index 598c82e220..45433edfc2 100644 --- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageData.h +++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageData.h @@ -25,7 +25,7 @@ Revision History //
// bit definition
//
-#define bit(a) 1 << (a)
+#define bit(a) (1 << (a))
//
// timeout unit is in millisecond.
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c index b8ed813ea2..3d6a6d977b 100644 --- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c +++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c @@ -924,7 +924,6 @@ UsbFloppyDetectMedia ( Status = EFI_SUCCESS;
FloppyStatus = EFI_SUCCESS;
CopyMem (&OldMediaInfo, UsbFloppyDevice->BlkIo.Media, sizeof (OldMediaInfo));
- //OldMediaInfo = *UsbFloppyDevice->BlkIo.Media;
*MediaChange = FALSE;
NeedReadCapacity = TRUE;
|