34 if (DevicePathToConnect ==
NULL) {
35 return EFI_INVALID_PARAMETER;
38 PreviousHandle =
NULL;
40 RemainingDevicePath = DevicePathToConnect;
41 Status =
gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle);
43 if (!EFI_ERROR (Status) && (Handle !=
NULL)) {
44 if (PreviousHandle == Handle) {
45 Status = EFI_NOT_FOUND;
47 PreviousHandle = Handle;
48 Status =
gBS->ConnectController (Handle,
NULL, RemainingDevicePath,
FALSE);
51 }
while (!EFI_ERROR (Status) && !
IsDevicePathEnd (RemainingDevicePath));
68 UINTN RootBridgeHandleCount;
70 UINTN RootBridgeIndex;
73 RootBridgeHandleCount = 0;
75 Status =
gBS->LocateHandleBuffer (
77 &gEfiPciRootBridgeIoProtocolGuid,
79 &RootBridgeHandleCount,
80 &RootBridgeHandleBuffer
82 if (EFI_ERROR (Status)) {
86 for (RootBridgeIndex = 0; RootBridgeIndex < RootBridgeHandleCount; RootBridgeIndex++) {
87 gBS->ConnectController (RootBridgeHandleBuffer[RootBridgeIndex],
NULL,
NULL,
FALSE);
121 ControllerHandleList =
NULL;
122 Status = EFI_NOT_FOUND;
123 Status2 = EFI_NOT_FOUND;
128 if (DriverHandle ==
NULL) {
129 DriverHandleList =
NULL;
132 if (DriverHandleList ==
NULL) {
133 return (EFI_OUT_OF_RESOURCES);
136 DriverHandleList[0] = DriverHandle;
137 DriverHandleList[1] =
NULL;
144 if (ControllerHandle ==
NULL) {
146 for (HandleWalker = ControllerHandleList
147 ; HandleWalker !=
NULL && *HandleWalker !=
NULL
151 Status =
gBS->ConnectController (*HandleWalker, DriverHandleList,
NULL, Recursive);
152 if (!EFI_ERROR (Status)) {
156 if ((Output && !EFI_ERROR (Status)) || AlwaysOutput) {
161 Status =
gBS->ConnectController (ControllerHandle, DriverHandleList,
NULL, Recursive);
162 if (!EFI_ERROR (Status)) {
166 if ((Output && !EFI_ERROR (Status)) || AlwaysOutput) {
174 if (ControllerHandleList !=
NULL) {
178 if (DriverHandleList !=
NULL) {
203 UINTN HandleArrayCount;
207 BOOLEAN AtLeastOneConnected;
213 AtLeastOneConnected =
FALSE;
218 Status =
gRT->GetVariable ((CHAR16 *)Key, (
EFI_GUID *)&gEfiGlobalVariableGuid,
NULL, &Length, DevPath);
219 if (Status == EFI_BUFFER_TOO_SMALL) {
221 if (DevPath ==
NULL) {
222 return EFI_OUT_OF_RESOURCES;
225 Status =
gRT->GetVariable ((CHAR16 *)Key, (
EFI_GUID *)&gEfiGlobalVariableGuid,
NULL, &Length, DevPath);
226 if (EFI_ERROR (Status)) {
227 if (DevPath !=
NULL) {
233 }
else if (EFI_ERROR (Status)) {
237 Status = EFI_NOT_FOUND;
239 CopyOfDevPath = DevPath;
248 if (Instance ==
NULL) {
249 if (DevPath !=
NULL) {
253 return EFI_UNSUPPORTED;
271 if (EFI_ERROR (Status)) {
277 Status =
gBS->LocateHandleBuffer (
279 &gEfiPciIoProtocolGuid,
285 if (!EFI_ERROR (Status)) {
286 for (Index = 0; Index < HandleArrayCount; Index++) {
287 Status =
gBS->HandleProtocol (
289 &gEfiPciIoProtocolGuid,
293 if (!EFI_ERROR (Status)) {
294 Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class);
295 if (!EFI_ERROR (Status)) {
296 if ((PCI_CLASS_SERIAL == Class[2]) &&
297 (PCI_CLASS_SERIAL_USB == Class[1]))
299 Status =
gBS->ConnectController (
305 if (!EFI_ERROR (Status)) {
306 AtLeastOneConnected =
TRUE;
314 if (HandleArray !=
NULL) {
322 if (!EFI_ERROR (Status)) {
323 AtLeastOneConnected =
TRUE;
328 }
while (CopyOfDevPath !=
NULL);
330 if (DevPath !=
NULL) {
334 if (AtLeastOneConnected) {
337 return EFI_NOT_FOUND;
364 if ( ((Handle1 ==
NULL) && (Handle2 !=
NULL))
365 || ((Handle1 !=
NULL) && (Handle2 ==
NULL))
373 if (Handle1 ==
NULL) {
374 if (EFI_ERROR (
gBS->OpenProtocol (Handle2, &gEfiDriverBindingProtocolGuid,
NULL,
NULL,
gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
382 if (EFI_ERROR (
gBS->OpenProtocol (Handle1, &gEfiDriverBindingProtocolGuid,
NULL,
NULL,
gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
416 CHAR16 *ProblemParam;
418 CONST CHAR16 *Param1;
419 CONST CHAR16 *Param2;
439 if (EFI_ERROR (Status)) {
440 if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam !=
NULL)) {
451 Count = (gInReconnect ? 0x4 : 0x3);
469 if (EFI_ERROR (Status)) {
475 if (EFI_ERROR (Status)) {
481 if (EFI_ERROR (Status)) {
487 if (EFI_ERROR (Status)) {
493 if (EFI_ERROR (Status)) {
499 if (EFI_ERROR (Status)) {
510 if (Param1 !=
NULL) {
512 if (EFI_ERROR (Status)) {
515 if (Package !=
NULL) {
519 return (ShellStatus);
523 if (EFI_ERROR (Status)) {
531 if (Param2 !=
NULL) {
533 if (!EFI_ERROR (Status)) {
544 if ((Param1 !=
NULL) && (Handle1 ==
NULL)) {
547 }
else if ((Param2 !=
NULL) && (Handle2 ==
NULL)) {
550 }
else if ((Handle2 !=
NULL) && (Handle1 !=
NULL) && EFI_ERROR (
gBS->OpenProtocol (Handle2, &gEfiDriverBindingProtocolGuid,
NULL,
gImageHandle,
NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
555 if (EFI_ERROR (Status)) {
566 return (ShellStatus);
EFI_STATUS ShellConnectDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect)
EFI_STATUS ShellConnectFromDevPaths(IN CONST CHAR16 *Key)
EFI_STATUS ShellConnectPciRootBridge(VOID)
EFI_STATUS ConnectControllers(IN CONST EFI_HANDLE ControllerHandle OPTIONAL, IN CONST EFI_HANDLE DriverHandle OPTIONAL, IN CONST BOOLEAN Recursive, IN CONST BOOLEAN Output, IN CONST BOOLEAN AlwaysOutput)
SHELL_STATUS EFIAPI ShellCommandRunConnect(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS ConvertAndConnectControllers(IN EFI_HANDLE Handle1 OPTIONAL, IN EFI_HANDLE Handle2 OPTIONAL, IN CONST BOOLEAN Recursive, IN CONST BOOLEAN Output)
#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)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI GetNextDevicePathInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT UINTN *Size)
BOOLEAN EFIAPI IsDevicePathEndType(IN CONST VOID *Node)
VOID EFIAPI SetDevicePathEndNode(OUT VOID *Node)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_HANDLE EFIAPI ConvertHandleIndexToHandle(IN CONST UINTN TheIndex)
UINTN EFIAPI ConvertHandleToHandleIndex(IN CONST EFI_HANDLE TheHandle)
EFI_HANDLE *EFIAPI GetHandleListByProtocol(IN CONST EFI_GUID *ProtocolGuid OPTIONAL)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT_EFI_ERROR(StatusParameter)
@ SHELL_INVALID_PARAMETER
EFI_STATUS EFIAPI CommandInit(VOID)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
@ TypeFlag
A flag that is present or not present only (IE "-a").
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
CONST CHAR16 *EFIAPI ShellCommandLineGetRawValue(IN CONST LIST_ENTRY *CONST CheckPackage, IN UINTN Position)
UINTN EFIAPI ShellCommandLineGetCount(IN CONST LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellConvertStringToUint64(IN CONST CHAR16 *String, OUT UINT64 *Value, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace)