32 gBS->LocateHandleBuffer (
40 for (Index = 0; Index < HandleCount; Index++) {
44 if (HandleBuffer !=
NULL) {
54 Status =
gDS->Dispatch ();
55 }
while (!EFI_ERROR (Status));
119 if (DevicePathToConnect ==
NULL) {
120 return EFI_INVALID_PARAMETER;
127 PreviousHandle =
NULL;
134 RemainingDevicePath = DevicePathToConnect;
135 Status =
gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle);
136 if (!EFI_ERROR (Status)) {
137 if (Handle == PreviousHandle) {
145 if (CurrentTpl == TPL_APPLICATION) {
146 Status =
gDS->Dispatch ();
152 Status = EFI_NOT_FOUND;
156 if (!EFI_ERROR (Status)) {
157 PreviousHandle = Handle;
172 Status =
gBS->ConnectController (Handle,
NULL, RemainingDevicePath,
FALSE);
173 if (Status == EFI_NOT_FOUND) {
177 if (MatchingHandle !=
NULL) {
178 *MatchingHandle = Handle;
186 }
while (!EFI_ERROR (Status) && !
IsDevicePathEnd (RemainingDevicePath));
213 gBS->LocateHandleBuffer (
220 for (Index = 0; Index < HandleCount; Index++) {
221 gBS->DisconnectController (HandleBuffer[Index],
NULL,
NULL);
224 if (HandleBuffer !=
NULL) {
255 BOOLEAN AtLeastOneConnected;
260 if (DevicePath ==
NULL) {
261 return EFI_INVALID_PARAMETER;
268 return EFI_INVALID_PARAMETER;
274 AtLeastOneConnected =
FALSE;
275 Status =
gBS->LocateHandleBuffer (
277 &gEfiPciIoProtocolGuid,
282 if (!EFI_ERROR (Status)) {
283 for (Index = 0; Index < HandleCount; Index++) {
284 Status =
gBS->HandleProtocol (
286 &gEfiPciIoProtocolGuid,
289 if (!EFI_ERROR (Status)) {
293 Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class);
294 if (!EFI_ERROR (Status) &&
295 ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1]))
298 Status =
gBS->ConnectController (
304 if (!EFI_ERROR (Status)) {
305 AtLeastOneConnected =
TRUE;
311 if (Handles !=
NULL) {
316 return AtLeastOneConnected ?
EFI_SUCCESS : EFI_NOT_FOUND;
EFI_STATUS BmConnectUsbShortFormDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS EFIAPI EfiBootManagerConnectDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect, OUT EFI_HANDLE *MatchingHandle OPTIONAL)
VOID EFIAPI EfiBootManagerConnectAll(VOID)
VOID EFIAPI EfiBootManagerDisconnectAll(VOID)
VOID BmConnectAllDriversToAllControllers(VOID)
#define MESSAGING_DEVICE_PATH
UINT8 EFIAPI DevicePathType(IN CONST VOID *Node)
UINT8 EFIAPI DevicePathSubType(IN CONST VOID *Node)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI EfiBootManagerConnectAllDefaultConsoles(VOID)
EFI_TPL EFIAPI EfiGetCurrentTpl(VOID)