Skip to content

Commit

Permalink
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c: Add debug
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Żygowski <[email protected]>
  • Loading branch information
miczyg1 committed Feb 22, 2024
1 parent 7022ff9 commit 24250e8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,12 @@ TerminalDriverBindingStart (
// Do not create any child for END remaining device path.
//
if ((RemainingDevicePath != NULL) && IsDevicePathEnd (RemainingDevicePath)) {
DEBUG ((EFI_D_INFO, "TerminalDxe: Not creating children\n"));
return EFI_SUCCESS;
}

if (Status == EFI_ALREADY_STARTED) {

DEBUG ((EFI_D_INFO, "TerminalDxe: Already started\n"));
if (RemainingDevicePath == NULL) {
//
// If RemainingDevicePath is NULL or is the End of Device Path Node
Expand Down Expand Up @@ -563,7 +564,9 @@ TerminalDriverBindingStart (
TerminalDevice = TERMINAL_CON_IN_DEV_FROM_THIS (SimpleTextInput);
TerminalType = TerminalTypeFromGuid (&((VENDOR_DEVICE_PATH *) RemainingDevicePath)->Guid);
ASSERT (TerminalType < ARRAY_SIZE (mTerminalType));
DEBUG ((EFI_D_INFO, "TerminalDxe: Terminal type %s\n", mTerminalType[TerminalType]));
if (TerminalDevice->TerminalType != TerminalType) {
DEBUG ((EFI_D_INFO, "TerminalDxe: Terminal type mismatch\n"));
Status = InitializeControllerNameTable (TerminalType, &ControllerNameTable);
if (!EFI_ERROR (Status)) {
StopTerminalStateMachine (TerminalDevice);
Expand Down Expand Up @@ -617,6 +620,7 @@ TerminalDriverBindingStart (
// If RemainingDevicePath is NULL, use default terminal type
//
TerminalDevice->TerminalType = PcdGet8 (PcdDefaultTerminalType);
DEBUG ((EFI_D_INFO, "TerminalDxe: Appending terminal type %s\n", mTerminalType[TerminalDevice->TerminalType]));
} else {
//
// End of Device Path Node is handled in above.
Expand All @@ -627,6 +631,7 @@ TerminalDriverBindingStart (
// Use the RemainingDevicePath to determine the terminal type
//
TerminalDevice->TerminalType = TerminalTypeFromGuid (&((VENDOR_DEVICE_PATH *) RemainingDevicePath)->Guid);
DEBUG ((EFI_D_INFO, "TerminalDxe: using remaining path terminal type %s\n", mTerminalType[TerminalDevice->TerminalType]));
}
ASSERT (TerminalDevice->TerminalType < ARRAY_SIZE (mTerminalType));
TerminalDevice->SerialIo = SerialIo;
Expand Down Expand Up @@ -1277,13 +1282,22 @@ SetTerminalDevicePath (
)
{
VENDOR_DEVICE_PATH Node;
CHAR16* DevPathStr;

ASSERT (TerminalType < ARRAY_SIZE (mTerminalType));
Node.Header.Type = MESSAGING_DEVICE_PATH;
Node.Header.SubType = MSG_VENDOR_DP;
SetDevicePathNodeLength (&Node.Header, sizeof (VENDOR_DEVICE_PATH));
CopyGuid (&Node.Guid, mTerminalType[TerminalType]);

DevPathStr = ConvertDevicePathToText (ParentDevicePath, FALSE, FALSE);
if (DevPathStr != NULL) {
DEBUG ((EFI_D_INFO, "SetTerminalDevicePath: %s (%s)\n", DevPathStr, mTerminalType[TerminalType]));
FreePool(DevPathStr);
} else {
DEBUG ((EFI_D_INFO, "SetTerminalDevicePath: %s\n", mTerminalType[TerminalType]));
}

//
// Append the terminal node onto parent device path
// to generate a complete terminal device path.
Expand Down

0 comments on commit 24250e8

Please sign in to comment.