/** @file\r
Main file for support of shell consist mapping.\r
\r
- Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2005 - 2015, 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
#include <Library/SortLib.h>\r
#include <Library/UefiLib.h>\r
#include <Protocol/UsbIo.h>\r
+#include <Protocol/BlockIo.h>\r
+#include <Protocol/SimpleFileSystem.h>\r
+\r
+\r
\r
typedef enum {\r
MTDTypeUnknown,\r
CHAR16 *Name;\r
} MTD_NAME;\r
\r
-typedef VOID (EFIAPI *SerialDecodeFucntion) (EFI_DEVICE_PATH_PROTOCOL *DevPath, DEVICE_CONSIST_MAPPING_INFO *MapInfo,EFI_DEVICE_PATH_PROTOCOL *);\r
+/**\r
+ Serial Decode function.\r
+\r
+ @param DevPath The Device path info.\r
+ @param MapInfo The map info.\r
+ @param OrigDevPath The original device path protocol.\r
+\r
+**/\r
+typedef \r
+VOID \r
+(EFIAPI *SERIAL_DECODE_FUNCTION) (\r
+ EFI_DEVICE_PATH_PROTOCOL *DevPath, \r
+ DEVICE_CONSIST_MAPPING_INFO *MapInfo,\r
+ EFI_DEVICE_PATH_PROTOCOL *OrigDevPath\r
+ );\r
\r
typedef struct {\r
UINT8 Type;\r
UINT8 SubType;\r
- SerialDecodeFucntion SerialFun;\r
+ SERIAL_DECODE_FUNCTION SerialFun;\r
INTN (EFIAPI *CompareFun) (EFI_DEVICE_PATH_PROTOCOL *DevPath, EFI_DEVICE_PATH_PROTOCOL *DevPath2);\r
} DEV_PATH_CONSIST_MAPPING_TABLE;\r
\r
ASSERT (Str->Str != NULL);\r
}\r
\r
- StrnCat (Str->Str, AppendStr, StringSize/sizeof(CHAR16) - 1 - StrLen(Str->Str));\r
+ StrCatS (Str->Str, StringSize/sizeof(CHAR16), AppendStr);\r
Str->Len = StringSize;\r
\r
FreePool (AppendStr);\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
\r
**/\r
VOID\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
+\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
+\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode The node to get info on.\r
@param[in] MappingItem The info item to populate.\r
+ @param[in] DevicePath Ignored.\r
**/\r
VOID\r
EFIAPI\r
\r
@param[in] DevicePathNode Ignored.\r
@param[in] MappingItem Ignored.\r
+ @param[in] DevicePath Ignored.\r
\r
Does nothing.\r
**/\r
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
)\r
{\r
- SerialDecodeFucntion SerialFun;\r
+ SERIAL_DECODE_FUNCTION SerialFun;\r
UINTN Index;\r
EFI_DEVICE_PATH_PROTOCOL *OriginalDevicePath;\r
\r
OUT EFI_DEVICE_PATH_PROTOCOL ***Table\r
)\r
{\r
- EFI_HANDLE *HandleBuffer;\r
- UINTN HandleNum;\r
- UINTN HandleLoop;\r
- EFI_DEVICE_PATH_PROTOCOL **TempTable;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
- EFI_DEVICE_PATH_PROTOCOL *HIDevicePath;\r
- UINTN Index;\r
- EFI_STATUS Status;\r
+ EFI_HANDLE *HandleBuffer;\r
+ UINTN HandleNum;\r
+ UINTN HandleLoop;\r
+ EFI_DEVICE_PATH_PROTOCOL **TempTable;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+ EFI_DEVICE_PATH_PROTOCOL *HIDevicePath;\r
+ EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;\r
+ UINTN Index;\r
+ EFI_STATUS Status;\r
\r
HandleBuffer = NULL;\r
\r
Status = gBS->LocateHandleBuffer (\r
- AllHandles,\r
- NULL,\r
+ ByProtocol,\r
+ &gEfiDevicePathProtocolGuid,\r
NULL,\r
&HandleNum,\r
&HandleBuffer\r
continue;\r
}\r
\r
+ Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], \r
+ &gEfiBlockIoProtocolGuid, \r
+ (VOID **)&BlockIo\r
+ );\r
+ if (EFI_ERROR(Status)) {\r
+ Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], \r
+ &gEfiSimpleFileSystemProtocolGuid, \r
+ (VOID **)&SimpleFileSystem\r
+ );\r
+ if (EFI_ERROR(Status)) {\r
+ continue;\r
+ }\r
+ }\r
+\r
for (Index = 0; TempTable[Index] != NULL; Index++) {\r
if (DevicePathCompare (&TempTable[Index], &HIDevicePath) == 0) {\r
FreePool (HIDevicePath);\r