/** @file
Main file for DevTree 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"-d", TypeFlag},
{L"-l", TypeValue},
};
/**
Display a tree starting from this handle.
@param[in] TheHandle The handle to start with.
@param[in] Lang Optionally, a UEFI defined language code.
@param[in] UseDevPaths TRUE to display info from DevPath as identifiers.
FALSE will use component name protocol instead.
@param[in] IndentCharCount How many characters to indent (allows for recursion).
@param[in] HiiString The string from HII to use for output.
@retval SHELL_SUCCESS The operation was successful.
**/
)
{
ChildCount = 0;
//
// We want controller handles. they will not have LoadedImage or DriverBinding (or others...)
//
NULL,
NULL,
NULL,
);
return SHELL_SUCCESS;
}
NULL,
NULL,
NULL,
);
return SHELL_SUCCESS;
}
//
// If we are at the begining then we want root handles they have no parents and do have device path.
//
if (IndentCharCount == 0) {
NULL,
NULL,
NULL,
);
return SHELL_SUCCESS;
}
}
//
// we generate the format string on the fly so that we can control the
// number of space characters that the first (empty) string has. this
// handles the indenting.
//
UnicodeSPrint(FormatString, StrSize(HiiString) + (10)*sizeof(FormatString[0]), L"%%%ds %s", IndentCharCount, HiiString);
gEfiShellProtocol->GetDeviceName((EFI_HANDLE)TheHandle, !UseDevPaths?EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH:EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Lang, &Name);
//
// print out the information for ourselves
//
-1,
-1,
L"",
}
//
// recurse on each child handle with IndentCharCount + 2
//
ShellStatus = DoDevTreeForHandle(ChildHandleBuffer[LoopVar], Lang, UseDevPaths, IndentCharCount+2, HiiString);
}
if (ChildHandleBuffer != NULL) {
}
return (ShellStatus);
}
/**
Function for 'devtree' 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 {
return (SHELL_INVALID_PARAMETER);
}
// Language = AllocateZeroPool(10);
// AsciiSPrint(Language, 10, "en-us");
} else {
return (SHELL_INVALID_PARAMETER);
}
break;
}
}
} else {
} else {
ShellStatus = DoDevTreeForHandle(ConvertHandleIndexToHandle((UINTN)Intermediate), Language, FlagD, 0, HiiString);
}
}
}
}
return (ShellStatus);
}