/** @file\r
Main file for Drivers shell Driver1 function.\r
\r
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{NULL, TypeMax}\r
};\r
\r
+/**\r
+ Get a device path (in text format) for a given handle.\r
+\r
+ @param[in] TheHandle The handle to get the device path for.\r
+\r
+ @retval NULL An error occured.\r
+ @return A pointer to the driver path as a string. The callee must \r
+ free this memory.\r
+**/\r
CHAR16*\r
EFIAPI\r
GetDevicePathTextForHandle(\r
}\r
RetVal = gEfiShellProtocol->GetFilePathFromDevicePath(FinalPath);\r
if (RetVal == NULL) {\r
- RetVal = gDevPathToText->ConvertDevicePathToText(FinalPath, TRUE, TRUE);\r
+ RetVal = ConvertDevicePathToText(FinalPath, TRUE, TRUE);\r
}\r
FreePool(FinalPath);\r
return (RetVal);\r
}\r
\r
+/**\r
+ Determine if the given handle has Driver Configuration protocol.\r
+\r
+ @param[in] TheHandle The handle to the driver to test.\r
+\r
+ @retval TRUE The driver does have Driver Configuration.\r
+ @retval FALSE The driver does not have Driver Configuration.\r
+**/\r
BOOLEAN\r
EFIAPI\r
ReturnDriverConfig(\r
return (TRUE);\r
}\r
\r
+/**\r
+ Determine if the given handle has DriverDiagnostics protocol.\r
+\r
+ @param[in] TheHandle The handle to the driver to test.\r
+\r
+ @retval TRUE The driver does have Driver Diasgnostics.\r
+ @retval FALSE The driver does not have Driver Diagnostics.\r
+**/\r
BOOLEAN\r
EFIAPI\r
ReturnDriverDiag(\r
return (TRUE);\r
}\r
\r
+/**\r
+ Finds and returns the version of the driver specified by TheHandle.\r
+\r
+ @param[in] TheHandle The driver handle to get the version of.\r
+\r
+ @return The version of the driver.\r
+ @retval 0xFFFFFFFF An error ocurred.\r
+**/\r
UINT32\r
EFIAPI\r
ReturnDriverVersion(\r
return (RetVal);\r
}\r
\r
+/**\r
+ Function for 'drivers' command.\r
+\r
+ @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
+ @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
+**/\r
SHELL_STATUS\r
EFIAPI\r
ShellCommandRunDrivers (\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
} else {\r
- Lang = ShellCommandLineGetValue(Package, L"-l");\r
- if (Lang != NULL) {\r
- Language = AllocateZeroPool(StrSize(Lang));\r
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);\r
- } else if (!ShellCommandLineGetFlag(Package, L"-l")){\r
- ASSERT(Language == NULL);\r
- // Language = AllocateZeroPool(10);\r
- // AsciiSPrint(Language, 10, "en-us");\r
- } else {\r
- ASSERT(Language == NULL);\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");\r
- ShellCommandLineFreeVarList (Package);\r
- return (SHELL_INVALID_PARAMETER);\r
+ if (ShellCommandLineGetFlag(Package, L"-l")){\r
+ Lang = ShellCommandLineGetValue(Package, L"-l");\r
+ if (Lang != NULL) {\r
+ Language = AllocateZeroPool(StrSize(Lang));\r
+ AsciiSPrint(Language, StrSize(Lang), "%S", Lang);\r
+ } else {\r
+ ASSERT(Language == NULL);\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");\r
+ ShellCommandLineFreeVarList (Package);\r
+ return (SHELL_INVALID_PARAMETER);\r
+ }\r
}\r
\r
if (ShellCommandLineGetFlag(Package, L"-sfo")) {\r
DriverVersion = ReturnDriverVersion(*HandleWalker);\r
DriverConfig = ReturnDriverConfig(*HandleWalker);\r
DriverDiag = ReturnDriverDiag (*HandleWalker);\r
- Lang = GetStringNameFromHandle(*HandleWalker, Language==NULL?"en":Language);\r
+ Lang = GetStringNameFromHandle(*HandleWalker, Language);\r
\r
ShellPrintEx(\r
-1,\r