/* Converts a text device path node to Wi-Fi device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextWiFi(CHAR16 *TextDeviceNode)
/* Converts a text device path node to Wi-Fi device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextWiFi(CHAR16 *TextDeviceNode)
{
  CHAR16                *SSIdStr;
  CHAR8                 AsciiStr[33];
  UINTN                 DataLen;
  WIFI_DEVICE_PATH      *WiFiDp;
  SSIdStr = GetNextParamStr (&TextDeviceNode);
  WiFiDp  = (WIFI_DEVICE_PATH *) CreateDeviceNode (
                                   MESSAGING_DEVICE_PATH,
                                   MSG_WIFI_DP,
                                   (UINT16) sizeof (WIFI_DEVICE_PATH)
                                   );
  if (NULL != SSIdStr) {
    DataLen = StrLen (SSIdStr);
    if (StrLen (SSIdStr) > 32) {
      SSIdStr[32] = L'\0';
      DataLen     = 32;
    }
    UnicodeStrToAsciiStrS (SSIdStr, AsciiStr, sizeof (AsciiStr));
    memcpy (WiFiDp->SSId, AsciiStr, DataLen);
  }
  return (EFI_DEVICE_PATH_PROTOCOL *) WiFiDp;
}