1. Add UEFI 2.2 VLAN device path definition to MdePkg

2. Update DevicePathDxe to support VLAN device path node
3. Update GenericBdsLib function DevicePathToStr() to support VLAN device path node

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9421 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xdu2 2009-11-12 10:40:58 +00:00
parent 3393e2915a
commit 8f97f91154
4 changed files with 99 additions and 3 deletions

View File

@ -2,7 +2,7 @@
BDS internal function define the default device path string, it can be BDS internal function define the default device path string, it can be
replaced by platform device path. replaced by platform device path.
Copyright (c) 2004 - 2008, Intel Corporation. <BR> Copyright (c) 2004 - 2009, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -984,6 +984,28 @@ DevPathiSCSI (
CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved"); CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved");
} }
/**
Convert Device Path to a Unicode string for printing.
@param Str The buffer holding the output string.
This buffer contains the length of the
string and the maixmum length reserved
for the string buffer.
@param DevPath The device path.
**/
VOID
DevPathVlan (
IN OUT POOL_PRINT *Str,
IN VOID *DevPath
)
{
VLAN_DEVICE_PATH *Vlan;
Vlan = DevPath;
CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);
}
/** /**
Convert Device Path to a Unicode string for printing. Convert Device Path to a Unicode string for printing.
@ -1390,6 +1412,11 @@ DEVICE_PATH_STRING_TABLE DevPathTable[] = {
MSG_ISCSI_DP, MSG_ISCSI_DP,
DevPathiSCSI DevPathiSCSI
}, },
{
MESSAGING_DEVICE_PATH,
MSG_VLAN_DP,
DevPathVlan
},
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_HARDDRIVE_DP, MEDIA_HARDDRIVE_DP,

View File

@ -1,7 +1,7 @@
/** @file /** @file
DevicePathFromText protocol as defined in the UEFI 2.0 specification. DevicePathFromText protocol as defined in the UEFI 2.0 specification.
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2009, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -2349,6 +2349,34 @@ DevPathFromTextiSCSI (
return (EFI_DEVICE_PATH_PROTOCOL *) ISCSIDevPath; return (EFI_DEVICE_PATH_PROTOCOL *) ISCSIDevPath;
} }
/**
Converts a text device path node to VLAN device path structure.
@param TextDeviceNode The input Text device path node.
@return A pointer to the newly-created VLAN device path structure.
**/
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVlan (
IN CHAR16 *TextDeviceNode
)
{
CHAR16 *VlanStr;
VLAN_DEVICE_PATH *Vlan;
VlanStr = GetNextParamStr (&TextDeviceNode);
Vlan = (VLAN_DEVICE_PATH *) CreateDeviceNode (
MESSAGING_DEVICE_PATH,
MSG_VLAN_DP,
sizeof (VLAN_DEVICE_PATH)
);
Vlan->VlanId = (UINT16) Strtoi (VlanStr);
return (EFI_DEVICE_PATH_PROTOCOL *) Vlan;
}
/** /**
Converts a text device path node to HD device path structure. Converts a text device path node to HD device path structure.
@ -2753,6 +2781,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[]
{L"UsbWwid", DevPathFromTextUsbWwid}, {L"UsbWwid", DevPathFromTextUsbWwid},
{L"Unit", DevPathFromTextUnit}, {L"Unit", DevPathFromTextUnit},
{L"iSCSI", DevPathFromTextiSCSI}, {L"iSCSI", DevPathFromTextiSCSI},
{L"Vlan", DevPathFromTextVlan},
{L"HD", DevPathFromTextHD}, {L"HD", DevPathFromTextHD},
{L"CDROM", DevPathFromTextCDROM}, {L"CDROM", DevPathFromTextCDROM},
{L"VenMEDIA", DevPathFromTextVenMEDIA}, {L"VenMEDIA", DevPathFromTextVenMEDIA},

View File

@ -1,7 +1,7 @@
/** @file /** @file
DevicePathToText protocol as defined in the UEFI 2.0 specification. DevicePathToText protocol as defined in the UEFI 2.0 specification.
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2009, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1311,6 +1311,33 @@ DevPathToTextiSCSI (
CatPrint (Str, L"%s)", (ISCSIDevPath->NetworkProtocol == 0) ? L"TCP" : L"reserved"); CatPrint (Str, L"%s)", (ISCSIDevPath->NetworkProtocol == 0) ? L"TCP" : L"reserved");
} }
/**
Converts a VLAN device path structure to its string representative.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
is FALSE, then the longer text representation of the display node
is used.
@param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
representation for a device node can be used, where applicable.
**/
VOID
DevPathToTextVlan (
IN OUT POOL_PRINT *Str,
IN VOID *DevPath,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortcuts
)
{
VLAN_DEVICE_PATH *Vlan;
Vlan = DevPath;
CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);
}
/** /**
Converts a Hard drive device path structure to its string representative. Converts a Hard drive device path structure to its string representative.
@ -1684,6 +1711,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE DevPathToTextTable
{MESSAGING_DEVICE_PATH, MSG_UART_DP, DevPathToTextUart}, {MESSAGING_DEVICE_PATH, MSG_UART_DP, DevPathToTextUart},
{MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, DevPathToTextVendor}, {MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, DevPathToTextVendor},
{MESSAGING_DEVICE_PATH, MSG_ISCSI_DP, DevPathToTextiSCSI}, {MESSAGING_DEVICE_PATH, MSG_ISCSI_DP, DevPathToTextiSCSI},
{MESSAGING_DEVICE_PATH, MSG_VLAN_DP, DevPathToTextVlan},
{MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, DevPathToTextHardDrive}, {MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, DevPathToTextHardDrive},
{MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, DevPathToTextCDROM}, {MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, DevPathToTextCDROM},
{MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, DevPathToTextVendor}, {MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, DevPathToTextVendor},

View File

@ -758,6 +758,18 @@ typedef struct {
#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000 #define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000 #define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
///
/// VLAN Device Path SubType
///
#define MSG_VLAN_DP 0x14
typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
///
/// VLAN identifier (0-4094)
///
UINT16 VlanId;
} VLAN_DEVICE_PATH;
// //
// Media Device Path // Media Device Path
// //