ShellPkg: Add DiskIO2, and fix GUID from string check to be case insensitive

- Add DiskIO2 to list of known protocols
- Fix string check to be case insensitive for commands like ‘dh –p protocolname’

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Phillips <chrisp@hp.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14851 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Chris Phillips
2013-11-15 18:44:29 +00:00
committed by jcarsey
parent 13acebbdef
commit 28cdb62bcd
4 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,7 @@
/** @file /** @file
Provides interface to advanced shell functionality for parsing both handle and protocol database. Provides interface to advanced shell functionality for parsing both handle and protocol database.
Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -620,6 +621,11 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
{STRING_TOKEN(STR_SSC), &gEfiStorageSecurityCommandProtocolGuid, NULL}, {STRING_TOKEN(STR_SSC), &gEfiStorageSecurityCommandProtocolGuid, NULL},
{STRING_TOKEN(STR_UC2), &gEfiUserCredential2ProtocolGuid, NULL}, {STRING_TOKEN(STR_UC2), &gEfiUserCredential2ProtocolGuid, NULL},
//
// UEFI 2.4
//
{STRING_TOKEN(STR_DISK_IO2), &gEfiDiskIo2ProtocolGuid, NULL},
// //
// terminator // terminator
// //
@ -753,7 +759,7 @@ GetGuidFromStringName(
if (PcdGetBool(PcdShellIncludeNtGuids)) { if (PcdGetBool(PcdShellIncludeNtGuids)) {
for (ListWalker = mGuidStringListNT ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) { for (ListWalker = mGuidStringListNT ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) {
String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang); String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang);
if (Name != NULL && String != NULL && StrCmp(Name, String)==0) { if (Name != NULL && String != NULL && StringNoCaseCompare (&Name, &String) == 0) {
*Guid = ListWalker->GuidId; *Guid = ListWalker->GuidId;
} }
SHELL_FREE_NON_NULL(String); SHELL_FREE_NON_NULL(String);
@ -764,7 +770,7 @@ GetGuidFromStringName(
} }
for (ListWalker = mGuidStringList ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) { for (ListWalker = mGuidStringList ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) {
String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang); String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang);
if (Name != NULL && String != NULL && StrCmp(Name, String)==0) { if (Name != NULL && String != NULL && StringNoCaseCompare (&Name, &String) == 0) {
*Guid = ListWalker->GuidId; *Guid = ListWalker->GuidId;
} }
SHELL_FREE_NON_NULL(String); SHELL_FREE_NON_NULL(String);

View File

@ -1,6 +1,7 @@
/** @file /** @file
Provides interface to advanced shell functionality for parsing both handle and protocol database. Provides interface to advanced shell functionality for parsing both handle and protocol database.
Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -130,6 +131,7 @@
#include <Protocol/BlockIo2.h> #include <Protocol/BlockIo2.h>
#include <Protocol/StorageSecurityCommand.h> #include <Protocol/StorageSecurityCommand.h>
#include <Protocol/UserCredential2.h> #include <Protocol/UserCredential2.h>
#include <Protocol/DiskIo2.h>
#include <Library/HandleParsingLib.h> #include <Library/HandleParsingLib.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
@ -143,6 +145,7 @@
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
#include <Library/HiiLib.h> #include <Library/HiiLib.h>
#include <Library/ShellLib.h> #include <Library/ShellLib.h>
#include <Library/SortLib.h>
typedef struct { typedef struct {
LIST_ENTRY Link; LIST_ENTRY Link;

View File

@ -1,5 +1,6 @@
## @file ## @file
# Provides interface to advanced shell functionality for parsing both handle and protocol database. # Provides interface to advanced shell functionality for parsing both handle and protocol database.
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved. <BR> # Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved. <BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
@ -47,6 +48,7 @@
PrintLib PrintLib
UefiLib UefiLib
HiiLib HiiLib
SortLib
[Protocols] [Protocols]
gEfiSimpleFileSystemProtocolGuid ##CONSUMES gEfiSimpleFileSystemProtocolGuid ##CONSUMES
@ -167,6 +169,7 @@
gEfiTcgProtocolGuid ##UNDEFINED gEfiTcgProtocolGuid ##UNDEFINED
gEfiHiiPackageListProtocolGuid ##UNDEFINED gEfiHiiPackageListProtocolGuid ##UNDEFINED
gEfiDriverFamilyOverrideProtocolGuid ##UNDEFINED gEfiDriverFamilyOverrideProtocolGuid ##UNDEFINED
gEfiDiskIo2ProtocolGuid ##UNDEFINED
[Guids] [Guids]
gEfiFileInfoGuid ##CONSUMES gEfiFileInfoGuid ##CONSUMES