/* Converts a text device path node to MAC device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextMAC(CHAR16 *TextDeviceNode)
/* Converts a text device path node to MAC device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextMAC(CHAR16 *TextDeviceNode)
{
  CHAR16                *AddressStr;
  CHAR16                *IfTypeStr;
  UINTN                 Length;
  MAC_ADDR_DEVICE_PATH  *MACDevPath;
  AddressStr    = GetNextParamStr (&TextDeviceNode);
  IfTypeStr     = GetNextParamStr (&TextDeviceNode);
  MACDevPath    = (MAC_ADDR_DEVICE_PATH *) CreateDeviceNode (
                                              MESSAGING_DEVICE_PATH,
                                              MSG_MAC_ADDR_DP,
                                              (UINT16) sizeof (MAC_ADDR_DEVICE_PATH)
                                              );
  MACDevPath->IfType   = (UINT8) Strtoi (IfTypeStr);
  Length = sizeof (EFI_MAC_ADDRESS);
  if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {
    Length = 6;
  }
  StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length);
  return (EFI_DEVICE_PATH_PROTOCOL *) MACDevPath;
}