MdePkg: Add WiFi device path definition and its node/text conversion

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17476 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hao Wu
2015-05-20 05:21:19 +00:00
committed by hwu1225
parent 0d2aa2b196
commit 3bafd562b7
3 changed files with 73 additions and 0 deletions

View File

@@ -2769,6 +2769,36 @@ DevPathFromTextBluetooth (
return (EFI_DEVICE_PATH_PROTOCOL *) BluetoothDp;
}
/**
Converts a text device path node to Wi-Fi device path structure.
@param TextDeviceNode The input Text device path node.
@return A pointer to the newly-created Wi-Fi device path structure.
**/
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextWiFi (
IN CHAR16 *TextDeviceNode
)
{
CHAR16 *SSIdStr;
CHAR8 *AsciiStr;
WIFI_DEVICE_PATH *WiFiDp;
SSIdStr = GetNextParamStr (&TextDeviceNode);
WiFiDp = (WIFI_DEVICE_PATH *) CreateDeviceNode (
MESSAGING_DEVICE_PATH,
MSG_WIFI_DP,
(UINT16) sizeof (WIFI_DEVICE_PATH)
);
AsciiStr = WiFiDp->SSId;
StrToAscii (SSIdStr, &AsciiStr);
return (EFI_DEVICE_PATH_PROTOCOL *) WiFiDp;
}
/**
Converts a text device path node to URI device path structure.
@@ -3244,6 +3274,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"Vlan", DevPathFromTextVlan },
{L"Uri", DevPathFromTextUri },
{L"Bluetooth", DevPathFromTextBluetooth },
{L"WiFi", DevPathFromTextWiFi },
{L"MediaPath", DevPathFromTextMediaPath },
{L"HD", DevPathFromTextHD },
{L"CDROM", DevPathFromTextCDROM },