/** @file
Main file for Drivers 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"-sfo", TypeFlag},
{L"-l", TypeValue},
};
/**
Get a device path (in text format) for a given handle.
@param[in] TheHandle The handle to get the device path for.
@retval NULL An error occured.
@return A pointer to the driver path as a string. The callee must
free this memory.
**/
)
{
(VOID**)&LoadedImage,
NULL,
);
(VOID**)&ImageDevicePath,
NULL,
);
NULL);
}
NULL);
}
return (NULL);
}
}
return (RetVal);
}
/**
Determine if the given handle has Driver Configuration protocol.
@param[in] TheHandle The handle to the driver to test.
@retval TRUE The driver does have Driver Configuration.
@retval FALSE The driver does not have Driver Configuration.
**/
)
{
Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverConfigurationProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL);
return (FALSE);
}
return (TRUE);
}
/**
Determine if the given handle has DriverDiagnostics protocol.
@param[in] TheHandle The handle to the driver to test.
@retval TRUE The driver does have Driver Diasgnostics.
@retval FALSE The driver does not have Driver Diagnostics.
**/
)
{
Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverDiagnostics2ProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL);
Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverDiagnosticsProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL);
return (FALSE);
}
}
return (TRUE);
}
/**
Finds and returns the version of the driver specified by TheHandle.
@param[in] TheHandle The driver handle to get the version of.
@return The version of the driver.
@retval 0xFFFFFFFF An error ocurred.
**/
)
{
Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverBindingProtocolGuid, (VOID**)&DriverBinding, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
}
return (RetVal);
}
/**
Function for 'drivers' command.
@param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
**/
)
{
FormatString = NULL;
//
// 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 {
// Language = AllocateZeroPool(10);
// AsciiSPrint(Language, 10, "en-us");
} else {
return (SHELL_INVALID_PARAMETER);
}
FormatString = HiiGetString(gShellDriver1HiiHandle, STRING_TOKEN(STR_DRIVERS_ITEM_LINE_SFO), Language);
} else {
//
// print the header row
//
-1,
-1,
}
ChildCount = 0;
DeviceCount = 0;
-1,
-1,
Lang,
);
}
}
}
}
return (ShellStatus);
}