TianoCore EDK2 master
|
#include "UefiShellCommandLib.h"
#include <Library/DevicePathLib.h>
#include <Library/SortLib.h>
#include <Library/UefiLib.h>
#include <Protocol/UsbIo.h>
#include <Protocol/BlockIo.h>
#include <Protocol/SimpleFileSystem.h>
Go to the source code of this file.
Data Structures | |
struct | POOL_PRINT |
struct | DEVICE_CONSIST_MAPPING_INFO |
struct | MTD_NAME |
struct | DEV_PATH_CONSIST_MAPPING_TABLE |
Typedefs | |
typedef EFI_STATUS(* | SERIAL_DECODE_FUNCTION) (EFI_DEVICE_PATH_PROTOCOL *DevPath, DEVICE_CONSIST_MAPPING_INFO *MapInfo, EFI_DEVICE_PATH_PROTOCOL *OrigDevPath) |
Enumerations | |
enum | MTD_TYPE { MTDTypeUnknown , MTDTypeFloppy , MTDTypeHardDisk , MTDTypeCDRom , MTDTypeEnd } |
Variables | |
MTD_NAME | mMTDName [] |
DEV_PATH_CONSIST_MAPPING_TABLE | DevPathConsistMappingTable [] |
Main file for support of shell consist mapping.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ConsistMapping.c.
typedef EFI_STATUS(* SERIAL_DECODE_FUNCTION) (EFI_DEVICE_PATH_PROTOCOL *DevPath, DEVICE_CONSIST_MAPPING_INFO *MapInfo, EFI_DEVICE_PATH_PROTOCOL *OrigDevPath) |
Serial Decode function.
DevPath | The Device path info. |
MapInfo | The map info. |
OrigDevPath | The original device path protocol. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 52 of file ConsistMapping.c.
enum MTD_TYPE |
Definition at line 16 of file ConsistMapping.c.
EFI_STATUS AppendCSDGuid | ( | DEVICE_CONSIST_MAPPING_INFO * | MappingItem, |
EFI_GUID * | Guid | ||
) |
Function to append a Guid to the mapping item.
[in,out] | MappingItem | The item to append onto. |
[in] | Guid | The guid to append. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 319 of file ConsistMapping.c.
EFI_STATUS AppendCSDNum | ( | IN OUT DEVICE_CONSIST_MAPPING_INFO * | MappingItem, |
IN UINT64 | Num | ||
) |
Function to append a 64 bit number onto the mapping info.
[in,out] | MappingItem | The mapping info object to append onto. |
[in] | Num | The info to append. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 192 of file ConsistMapping.c.
EFI_STATUS AppendCSDNum2 | ( | IN OUT POOL_PRINT * | Str, |
IN UINT64 | Num | ||
) |
Function to append a 64 bit number / 25 onto the string.
[in,out] | Str | The string so append onto. |
[in] | Num | The number to divide and append. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 159 of file ConsistMapping.c.
EFI_STATUS AppendCSDStr | ( | IN OUT DEVICE_CONSIST_MAPPING_INFO * | MappingItem, |
IN CHAR16 * | Str | ||
) |
Function to append string into the mapping info.
[in,out] | MappingItem | The mapping info object to append onto. |
[in] | Str | The info to append. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 224 of file ConsistMapping.c.
EFI_STATUS EFIAPI CatPrint | ( | IN OUT POOL_PRINT * | Str, |
IN CHAR16 * | Fmt, | ||
... | |||
) |
Concatenates a formatted unicode string to allocated pool. The caller must free the resulting buffer.
Str | Tracks the allocated pool, size in use, and amount of pool allocated. |
Fmt | The format string |
... | The data will be printed. |
EFI_SUCCESS | The string is concatenated successfully. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 80 of file ConsistMapping.c.
INTN EFIAPI DevPathCompareAcpi | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath1, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath2 | ||
) |
Function to compare 2 APCI device paths.
[in] | DevicePath1 | The first device path to compare. |
[in] | DevicePath2 | The second device path to compare. |
0 | The device paths represent the same device. |
Definition at line 349 of file ConsistMapping.c.
INTN EFIAPI DevPathCompareDefault | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath1, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath2 | ||
) |
Do a comparison on 2 device paths.
[in] | DevicePath1 | The first device path. |
[in] | DevicePath2 | The second device path. |
0 | The 2 device paths are the same. |
<0 | DevicePath2 is greater than DevicePath1. |
>0 | DevicePath1 is greater than DevicePath2. |
Definition at line 421 of file ConsistMapping.c.
INTN EFIAPI DevPathComparePci | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath1, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath2 | ||
) |
Function to compare 2 PCI device paths.
[in] | DevicePath1 | The first device path to compare. |
[in] | DevicePath2 | The second device path to compare. |
0 | The device paths represent the same device. |
Definition at line 385 of file ConsistMapping.c.
EFI_STATUS DevPathSerial1394 | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be 1394 type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 1148 of file ConsistMapping.c.
EFI_STATUS DevPathSerialAcpi | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
If the node is floppy type then populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 1176 of file ConsistMapping.c.
EFI_STATUS DevPathSerialAtapi | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialAtapi Channel type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 484 of file ConsistMapping.c.
EFI_STATUS DevPathSerialCdRom | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialCDROM Channel type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 510 of file ConsistMapping.c.
EFI_STATUS DevPathSerialDefault | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
Empty function used for unknown devices.
[in] | DevicePathNode | Ignored. |
[in] | MappingItem | Ignored. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 1209 of file ConsistMapping.c.
EFI_STATUS DevPathSerialFibre | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialFibre Channel type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 537 of file ConsistMapping.c.
EFI_STATUS DevPathSerialHardDrive | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialHDD Channel type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 454 of file ConsistMapping.c.
EFI_STATUS DevPathSerialI2O | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialI20 type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 893 of file ConsistMapping.c.
EFI_STATUS DevPathSerialInfiniBand | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be InfiniBand type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 959 of file ConsistMapping.c.
EFI_STATUS DevPathSerialIPv4 | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be IPv4 type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 1006 of file ConsistMapping.c.
EFI_STATUS DevPathSerialIPv6 | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be IPv6 type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 1065 of file ConsistMapping.c.
EFI_STATUS DevPathSerialIScsi | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialSCSI type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 825 of file ConsistMapping.c.
EFI_STATUS DevPathSerialLun | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialLun type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 763 of file ConsistMapping.c.
EFI_STATUS DevPathSerialMacAddr | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be Mac Address type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 919 of file ConsistMapping.c.
EFI_STATUS DevPathSerialSata | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialSata type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 789 of file ConsistMapping.c.
EFI_STATUS DevPathSerialScsi | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SCSI type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 1116 of file ConsistMapping.c.
EFI_STATUS DevPathSerialUart | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialUart type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 569 of file ConsistMapping.c.
EFI_STATUS DevPathSerialUsb | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialUSB type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 609 of file ConsistMapping.c.
EFI_STATUS DevPathSerialVendor | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode, |
IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
DevicePathNode must be SerialVendor type and this will populate the MappingItem.
[in] | DevicePathNode | The node to get info on. |
[in] | MappingItem | The info item to populate. |
[in] | DevicePath | Ignored. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_SUCCESS | The appending was successful. |
Definition at line 677 of file ConsistMapping.c.
EFI_STATUS GetDeviceConsistMappingInfo | ( | IN DEVICE_CONSIST_MAPPING_INFO * | MappingItem, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
Function to walk the device path looking for a dumpable node.
[in] | MappingItem | The Item to fill with data. |
[in] | DevicePath | The path of the item to get data on. |
Definition at line 1451 of file ConsistMapping.c.
EFI_DEVICE_PATH_PROTOCOL * GetHIDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Function to convert a standard device path structure into a Hi version.
[in] | DevicePath | The device path to convert. |
Definition at line 1392 of file ConsistMapping.c.
BOOLEAN IsHIDevicePathNode | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathNode | ) |
Function to determine if a device path node is Hi or not.
[in] | DevicePathNode | The node to check. |
TRUE | The node is Hi. |
FALSE | The node is not Hi. |
Definition at line 1356 of file ConsistMapping.c.
CHAR16 *EFIAPI ShellCommandConsistMappingGenMappingName | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
IN EFI_DEVICE_PATH_PROTOCOL ** | Table | ||
) |
Create a consistent mapped name for the device specified by DevicePath based on the Table.
This must be called after ShellCommandConsistMappingInitialize() and before ShellCommandConsistMappingUnInitialize() is called.
[in] | DevicePath | The pointer to the dev path for the device. |
[in] | Table | The Table of mapping information. |
NULL | A consistent mapped name could not be created. |
Definition at line 1632 of file ConsistMapping.c.
EFI_STATUS EFIAPI ShellCommandConsistMappingInitialize | ( | OUT EFI_DEVICE_PATH_PROTOCOL *** | Table | ) |
Function to initialize the table for creating consistent map names.
[out] | Table | The pointer to pointer to pointer to DevicePathProtocol object. |
EFI_SUCCESS | The table was created successfully. |
Definition at line 1506 of file ConsistMapping.c.
EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize | ( | EFI_DEVICE_PATH_PROTOCOL ** | Table | ) |
Function to uninitialize the table for creating consistent map names.
The parameter must have been received from ShellCommandConsistMappingInitialize.
[out] | Table | The pointer to pointer to DevicePathProtocol object. |
EFI_SUCCESS | The table was deleted successfully. |
Definition at line 1601 of file ConsistMapping.c.
SHELL_MAP_LIST *EFIAPI ShellCommandFindMapItem | ( | IN CONST CHAR16 * | MapKey | ) |
Function to search the list of mappings for the node on the list based on the key.
[in] | MapKey | String Key to search for on the map |
Definition at line 1712 of file ConsistMapping.c.
DEV_PATH_CONSIST_MAPPING_TABLE DevPathConsistMappingTable[] |
Definition at line 1218 of file ConsistMapping.c.
MTD_NAME mMTDName[] |
Definition at line 126 of file ConsistMapping.c.