Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MdePkg, MdeModulePkg, ShellPkg: Drop efi 1.10 usb hc protocol #10761

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,8 +1330,7 @@ UhciDriverEntryPoint (
}

/**
Test to see if this driver supports ControllerHandle. Any
ControllerHandle that has UsbHcProtocol installed will be supported.
Test to see if this driver supports ControllerHandle.

@param This Protocol instance pointer.
@param Controller Handle of device to test.
Expand Down
4 changes: 1 addition & 3 deletions MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Uefi.h>

#include <Protocol/Usb2HostController.h>
#include <Protocol/UsbHostController.h>
#include <Protocol/PciIo.h>

#include <Guid/EventGroup.h>
Expand Down Expand Up @@ -148,8 +147,7 @@ extern EFI_COMPONENT_NAME_PROTOCOL gUhciComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gUhciComponentName2;

/**
Test to see if this driver supports ControllerHandle. Any
ControllerHandle that has UsbHcProtocol installed will be supported.
Test to see if this driver supports ControllerHandle.

@param This Protocol instance pointer.
@param Controller Handle of device to test.
Expand Down
82 changes: 13 additions & 69 deletions MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,6 @@ UsbBusBuildProtocol (
USB_DEVICE *RootHub;
USB_INTERFACE *RootIf;
EFI_STATUS Status;
EFI_STATUS Status2;

UsbBus = AllocateZeroPool (sizeof (USB_BUS));

Expand Down Expand Up @@ -993,17 +992,8 @@ UsbBusBuildProtocol (
EFI_OPEN_PROTOCOL_BY_DRIVER
);

Status2 = gBS->OpenProtocol (
Controller,
&gEfiUsbHcProtocolGuid,
(VOID **)&(UsbBus->UsbHc),
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);

if (EFI_ERROR (Status) && EFI_ERROR (Status2)) {
DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open USB_HC/USB2_HC - %r\n", Status));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open USB2_HC - %r\n", Status));

Status = EFI_DEVICE_ERROR;
goto CLOSE_HC;
Expand Down Expand Up @@ -1110,15 +1100,6 @@ UsbBusBuildProtocol (
);
}

if (UsbBus->UsbHc != NULL) {
gBS->CloseProtocol (
Controller,
&gEfiUsbHcProtocolGuid,
This->DriverBindingHandle,
Controller
);
}

gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
Expand Down Expand Up @@ -1180,7 +1161,6 @@ UsbBusControllerDriverSupported (
EFI_DEV_PATH_PTR DevicePathNode;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_USB2_HC_PROTOCOL *Usb2Hc;
EFI_USB_HC_PROTOCOL *UsbHc;
EFI_STATUS Status;

//
Expand Down Expand Up @@ -1225,46 +1205,19 @@ UsbBusControllerDriverSupported (
}

if (EFI_ERROR (Status)) {
//
// If failed to open USB_HC2, fall back to USB_HC
//
Status = gBS->OpenProtocol (
Controller,
&gEfiUsbHcProtocolGuid,
(VOID **)&UsbHc,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (Status == EFI_ALREADY_STARTED) {
return EFI_SUCCESS;
}

if (EFI_ERROR (Status)) {
return Status;
}

//
// Close the USB_HC used to perform the supported test
//
gBS->CloseProtocol (
Controller,
&gEfiUsbHcProtocolGuid,
This->DriverBindingHandle,
Controller
);
} else {
//
// Close the USB_HC2 used to perform the supported test
//
gBS->CloseProtocol (
Controller,
&gEfiUsb2HcProtocolGuid,
This->DriverBindingHandle,
Controller
);
return Status;
}

//
// Close the USB_HC2 used to perform the supported test
//
gBS->CloseProtocol (
Controller,
&gEfiUsb2HcProtocolGuid,
This->DriverBindingHandle,
Controller
);

//
// Open the EFI Device Path protocol needed to perform the supported test
//
Expand Down Expand Up @@ -1546,15 +1499,6 @@ UsbBusControllerDriverStop (
);
}

if (Bus->UsbHc != NULL) {
Status = gBS->CloseProtocol (
Controller,
&gEfiUsbHcProtocolGuid,
This->DriverBindingHandle,
Controller
);
}

if (!EFI_ERROR (Status)) {
gBS->CloseProtocol (
Controller,
Expand Down
2 changes: 0 additions & 2 deletions MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Uefi.h>

#include <Protocol/Usb2HostController.h>
#include <Protocol/UsbHostController.h>
#include <Protocol/UsbIo.h>
#include <Protocol/DevicePath.h>

Expand Down Expand Up @@ -243,7 +242,6 @@ struct _USB_BUS {
EFI_HANDLE HostHandle;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_USB2_HC_PROTOCOL *Usb2Hc;
EFI_USB_HC_PROTOCOL *UsbHc;

//
// Recorded the max supported usb devices.
Expand Down
1 change: 0 additions & 1 deletion MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
## BY_START
gEfiDevicePathProtocolGuid
gEfiUsb2HcProtocolGuid ## TO_START
gEfiUsbHcProtocolGuid ## TO_START

# [Event]
#
Expand Down
Loading
Loading