/** @file
Main file for Disconnect shell Driver1 function.
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "UefiShellDriver1CommandsLib.h"
{L"-r", TypeFlag},
};
/**
Disconnect everything.
@retval EFI_SUCCESS The operation was successful.
**/
)
{
//
// Stolen from UEFI 2.3 spec (May 2009 version)
// Pages 171/172
// Removed gBS local definition
//
//
// Disconnect All Handles Example
// The following example recusively disconnects all drivers from all
// controllers in a platform.
//
// EFI_BOOT_SERVICES *gBS;
//
// Retrieve the list of all handles from the handle database
//
NULL,
NULL,
);
NULL,
);
}
//
// end of stealing
//
}
return (EFI_SUCCESS);
}
/**
Function for 'disconnect' command.
@param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
**/
)
{
//
// initialize the shell lib (we must be in non-auto-init...)
//
Status = ShellInitialize();
Status = CommandInit();
//
// parse the command line
//
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
} else {
}
} else {
} else {
Status = DisconnectAll();
}
} else {
} else {
//
// must have between 1 and 3 handles passed in ...
//
} else if (EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiDevicePathProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, ShellStrToUintn(Param1), L"controller handle");
} else if (Handle2 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, ShellStrToUintn(Param2), L"driver handle");
} else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_3P_RESULT), gShellDriver1HiiHandle, L"Disconnect", (UINTN)Intermediate1, (UINTN)Intermediate2, (UINTN)Intermediate3, Status);
}
}
}
}
if (ShellStatus == SHELL_SUCCESS) {
if (Status == EFI_SECURITY_VIOLATION) {
} else if (Status == EFI_INVALID_PARAMETER) {
}
}
return (ShellStatus);
}