Adopt new IPv4/IPv6 device path for network modules.
Signed-off-by: tye Reviewed-by: niruiyu Adopt SasEx and new IPv6 device path for DevicePathDxe driver. Signed-off-by: niruiyu Reviewed-by: erictian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12574 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8f5e3a12a9
commit
501793fad4
|
@ -61,6 +61,8 @@ typedef UINT16 TCP_PORTNO;
|
||||||
#define IP_VERSION_4 4
|
#define IP_VERSION_4 4
|
||||||
#define IP_VERSION_6 6
|
#define IP_VERSION_6 6
|
||||||
|
|
||||||
|
#define IP6_PREFIX_LENGTH 64
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -2578,7 +2578,6 @@ ON_EXIT:
|
||||||
|
|
||||||
The header type of IPv4 device path node is MESSAGING_DEVICE_PATH.
|
The header type of IPv4 device path node is MESSAGING_DEVICE_PATH.
|
||||||
The header subtype of IPv4 device path node is MSG_IPv4_DP.
|
The header subtype of IPv4 device path node is MSG_IPv4_DP.
|
||||||
The length of the IPv4 device path node in bytes is 19.
|
|
||||||
Get other info from parameters to make up the whole IPv4 device path node.
|
Get other info from parameters to make up the whole IPv4 device path node.
|
||||||
|
|
||||||
@param[in, out] Node Pointer to the IPv4 device path node.
|
@param[in, out] Node Pointer to the IPv4 device path node.
|
||||||
|
@ -2606,7 +2605,7 @@ NetLibCreateIPv4DPathNode (
|
||||||
{
|
{
|
||||||
Node->Header.Type = MESSAGING_DEVICE_PATH;
|
Node->Header.Type = MESSAGING_DEVICE_PATH;
|
||||||
Node->Header.SubType = MSG_IPv4_DP;
|
Node->Header.SubType = MSG_IPv4_DP;
|
||||||
SetDevicePathNodeLength (&Node->Header, 19);
|
SetDevicePathNodeLength (&Node->Header, sizeof (IPv4_DEVICE_PATH));
|
||||||
|
|
||||||
CopyMem (&Node->LocalIpAddress, &LocalIp, sizeof (EFI_IPv4_ADDRESS));
|
CopyMem (&Node->LocalIpAddress, &LocalIp, sizeof (EFI_IPv4_ADDRESS));
|
||||||
CopyMem (&Node->RemoteIpAddress, &RemoteIp, sizeof (EFI_IPv4_ADDRESS));
|
CopyMem (&Node->RemoteIpAddress, &RemoteIp, sizeof (EFI_IPv4_ADDRESS));
|
||||||
|
@ -2621,6 +2620,14 @@ NetLibCreateIPv4DPathNode (
|
||||||
} else {
|
} else {
|
||||||
Node->StaticIpAddress = NetLibDefaultAddressIsStatic (Controller);
|
Node->StaticIpAddress = NetLibDefaultAddressIsStatic (Controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set the Gateway IP address to default value 0:0:0:0.
|
||||||
|
// Set the Subnet mask to default value 255:255:255:0.
|
||||||
|
//
|
||||||
|
ZeroMem (&Node->GatewayIpAddress, sizeof (EFI_IPv4_ADDRESS));
|
||||||
|
SetMem (&Node->SubnetMask, sizeof (EFI_IPv4_ADDRESS), 0xff);
|
||||||
|
Node->SubnetMask.Addr[3] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2662,7 +2669,14 @@ NetLibCreateIPv6DPathNode (
|
||||||
Node->RemotePort = RemotePort;
|
Node->RemotePort = RemotePort;
|
||||||
|
|
||||||
Node->Protocol = Protocol;
|
Node->Protocol = Protocol;
|
||||||
Node->StaticIpAddress = FALSE;
|
|
||||||
|
//
|
||||||
|
// Set default value to IPAddressOrigin, PrefixLength.
|
||||||
|
// Set the Gateway IP address to unspecified address.
|
||||||
|
//
|
||||||
|
Node->IpAddressOrigin = 0;
|
||||||
|
Node->PrefixLength = IP6_PREFIX_LENGTH;
|
||||||
|
ZeroMem (&Node->GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1684,6 +1684,74 @@ DevPathFromTextSAS (
|
||||||
return (EFI_DEVICE_PATH_PROTOCOL *) Sas;
|
return (EFI_DEVICE_PATH_PROTOCOL *) Sas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Converts a text device path node to Serial Attached SCSI Ex device path structure.
|
||||||
|
|
||||||
|
@param TextDeviceNode The input Text device path node.
|
||||||
|
|
||||||
|
@return A pointer to the newly-created Serial Attached SCSI Ex device path structure.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL *
|
||||||
|
DevPathFromTextSasEx (
|
||||||
|
IN CHAR16 *TextDeviceNode
|
||||||
|
)
|
||||||
|
{
|
||||||
|
CHAR16 *AddressStr;
|
||||||
|
CHAR16 *LunStr;
|
||||||
|
CHAR16 *RTPStr;
|
||||||
|
CHAR16 *SASSATAStr;
|
||||||
|
CHAR16 *LocationStr;
|
||||||
|
CHAR16 *ConnectStr;
|
||||||
|
CHAR16 *DriveBayStr;
|
||||||
|
UINT16 Info;
|
||||||
|
SASEX_DEVICE_PATH *SasEx;
|
||||||
|
|
||||||
|
AddressStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
LunStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
RTPStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
SASSATAStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
LocationStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
ConnectStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
DriveBayStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
Info = 0x0000;
|
||||||
|
SasEx = (SASEX_DEVICE_PATH *) CreateDeviceNode (
|
||||||
|
MESSAGING_DEVICE_PATH,
|
||||||
|
MSG_SASEX_DP,
|
||||||
|
(UINT16) sizeof (SASEX_DEVICE_PATH)
|
||||||
|
);
|
||||||
|
|
||||||
|
Strtoi64 (AddressStr, (UINT64 *) &SasEx->SasAddress);
|
||||||
|
Strtoi64 (LunStr, (UINT64 *) &SasEx->Lun);
|
||||||
|
*(UINT64 *) &SasEx->SasAddress = SwapBytes64 (*(UINT64 *) &SasEx->SasAddress);
|
||||||
|
*(UINT64 *) &SasEx->Lun = SwapBytes64 (*(UINT64 *) &SasEx->Lun);
|
||||||
|
SasEx->RelativeTargetPort = (UINT16) Strtoi (RTPStr);
|
||||||
|
if (StrCmp (SASSATAStr, L"NoTopology") != 0) {
|
||||||
|
if (StrCmp (DriveBayStr, L"0") == 0) {
|
||||||
|
Info |= 0x0001;
|
||||||
|
} else {
|
||||||
|
Info |= 0x0002;
|
||||||
|
Info = (UINT16) (Info | (Strtoi (DriveBayStr) << 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrCmp (SASSATAStr, L"SATA") == 0) {
|
||||||
|
Info |= 0x0010;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrCmp (LocationStr, L"External") == 0) {
|
||||||
|
Info |= 0x0020;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrCmp (ConnectStr, L"Expanded") == 0) {
|
||||||
|
Info |= 0x0040;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SasEx->DeviceTopology = Info;
|
||||||
|
|
||||||
|
return (EFI_DEVICE_PATH_PROTOCOL *) SasEx;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Converts a text device path node to Debug Port device path structure.
|
Converts a text device path node to Debug Port device path structure.
|
||||||
|
|
||||||
|
@ -1843,12 +1911,16 @@ DevPathFromTextIPv6 (
|
||||||
CHAR16 *ProtocolStr;
|
CHAR16 *ProtocolStr;
|
||||||
CHAR16 *TypeStr;
|
CHAR16 *TypeStr;
|
||||||
CHAR16 *LocalIPStr;
|
CHAR16 *LocalIPStr;
|
||||||
|
CHAR16 *GatewayIPStr;
|
||||||
|
CHAR16 *PrefixLengthStr;
|
||||||
IPv6_DEVICE_PATH *IPv6;
|
IPv6_DEVICE_PATH *IPv6;
|
||||||
|
|
||||||
RemoteIPStr = GetNextParamStr (&TextDeviceNode);
|
RemoteIPStr = GetNextParamStr (&TextDeviceNode);
|
||||||
ProtocolStr = GetNextParamStr (&TextDeviceNode);
|
ProtocolStr = GetNextParamStr (&TextDeviceNode);
|
||||||
TypeStr = GetNextParamStr (&TextDeviceNode);
|
TypeStr = GetNextParamStr (&TextDeviceNode);
|
||||||
LocalIPStr = GetNextParamStr (&TextDeviceNode);
|
LocalIPStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
PrefixLengthStr = GetNextParamStr (&TextDeviceNode);
|
||||||
|
GatewayIPStr = GetNextParamStr (&TextDeviceNode);
|
||||||
IPv6 = (IPv6_DEVICE_PATH *) CreateDeviceNode (
|
IPv6 = (IPv6_DEVICE_PATH *) CreateDeviceNode (
|
||||||
MESSAGING_DEVICE_PATH,
|
MESSAGING_DEVICE_PATH,
|
||||||
MSG_IPv6_DP,
|
MSG_IPv6_DP,
|
||||||
|
@ -1858,12 +1930,21 @@ DevPathFromTextIPv6 (
|
||||||
StrToIPv6Addr (&RemoteIPStr, &IPv6->RemoteIpAddress);
|
StrToIPv6Addr (&RemoteIPStr, &IPv6->RemoteIpAddress);
|
||||||
IPv6->Protocol = (UINT16) NetworkProtocolFromText (ProtocolStr);
|
IPv6->Protocol = (UINT16) NetworkProtocolFromText (ProtocolStr);
|
||||||
if (StrCmp (TypeStr, L"Static") == 0) {
|
if (StrCmp (TypeStr, L"Static") == 0) {
|
||||||
IPv6->StaticIpAddress = TRUE;
|
IPv6->IpAddressOrigin = 0;
|
||||||
|
} else if (StrCmp (TypeStr, L"StatelessAutoConfigure") == 0) {
|
||||||
|
IPv6->IpAddressOrigin = 1;
|
||||||
} else {
|
} else {
|
||||||
IPv6->StaticIpAddress = FALSE;
|
IPv6->IpAddressOrigin = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
StrToIPv6Addr (&LocalIPStr, &IPv6->LocalIpAddress);
|
StrToIPv6Addr (&LocalIPStr, &IPv6->LocalIpAddress);
|
||||||
|
if (!IS_NULL (*GatewayIPStr) && !IS_NULL (*PrefixLengthStr)) {
|
||||||
|
StrToIPv6Addr (&GatewayIPStr, &IPv6->GatewayIpAddress);
|
||||||
|
IPv6->PrefixLength = (UINT8) Strtoi (PrefixLengthStr);
|
||||||
|
} else {
|
||||||
|
ZeroMem (&IPv6->GatewayIpAddress, sizeof (IPv6->GatewayIpAddress));
|
||||||
|
IPv6->PrefixLength = 0;
|
||||||
|
}
|
||||||
|
|
||||||
IPv6->LocalPort = 0;
|
IPv6->LocalPort = 0;
|
||||||
IPv6->RemotePort = 0;
|
IPv6->RemotePort = 0;
|
||||||
|
@ -2895,6 +2976,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[]
|
||||||
{L"VenUtf8", DevPathFromTextVenUtf8},
|
{L"VenUtf8", DevPathFromTextVenUtf8},
|
||||||
{L"UartFlowCtrl", DevPathFromTextUartFlowCtrl},
|
{L"UartFlowCtrl", DevPathFromTextUartFlowCtrl},
|
||||||
{L"SAS", DevPathFromTextSAS},
|
{L"SAS", DevPathFromTextSAS},
|
||||||
|
{L"SasEx", DevPathFromTextSasEx},
|
||||||
{L"DebugPort", DevPathFromTextDebugPort},
|
{L"DebugPort", DevPathFromTextDebugPort},
|
||||||
{L"MAC", DevPathFromTextMAC},
|
{L"MAC", DevPathFromTextMAC},
|
||||||
{L"IPv4", DevPathFromTextIPv4},
|
{L"IPv4", DevPathFromTextIPv4},
|
||||||
|
|
|
@ -653,6 +653,66 @@ DevPathToTextFibreEx (
|
||||||
CatPrint (Str, L")");
|
CatPrint (Str, L")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Converts a Sas Ex 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
|
||||||
|
DevPathToTextSasEx (
|
||||||
|
IN OUT POOL_PRINT *Str,
|
||||||
|
IN VOID *DevPath,
|
||||||
|
IN BOOLEAN DisplayOnly,
|
||||||
|
IN BOOLEAN AllowShortcuts
|
||||||
|
)
|
||||||
|
{
|
||||||
|
SASEX_DEVICE_PATH *SasEx;
|
||||||
|
UINTN Index;
|
||||||
|
|
||||||
|
SasEx = DevPath;
|
||||||
|
CatPrint (Str, L"SasEx(0x");
|
||||||
|
|
||||||
|
for (Index = 0; Index < sizeof (SasEx->SasAddress) / sizeof (SasEx->SasAddress[0]); Index++) {
|
||||||
|
CatPrint (Str, L"%02x", SasEx->SasAddress[Index]);
|
||||||
|
}
|
||||||
|
CatPrint (Str, L",0x");
|
||||||
|
for (Index = 0; Index < sizeof (SasEx->Lun) / sizeof (SasEx->Lun[0]); Index++) {
|
||||||
|
CatPrint (Str, L"%02x", SasEx->Lun[Index]);
|
||||||
|
}
|
||||||
|
CatPrint (Str, L",0x%x,", SasEx->RelativeTargetPort);
|
||||||
|
|
||||||
|
if ((SasEx->DeviceTopology & 0x0f) == 0) {
|
||||||
|
CatPrint (Str, L"NoTopology,0,0,0,");
|
||||||
|
} else if (((SasEx->DeviceTopology & 0x0f) == 1) || ((SasEx->DeviceTopology & 0x0f) == 2)) {
|
||||||
|
CatPrint (
|
||||||
|
Str,
|
||||||
|
L"%s,%s,%s,",
|
||||||
|
((SasEx->DeviceTopology & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",
|
||||||
|
((SasEx->DeviceTopology & (0x1 << 5)) != 0) ? L"External" : L"Internal",
|
||||||
|
((SasEx->DeviceTopology & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"
|
||||||
|
);
|
||||||
|
if ((SasEx->DeviceTopology & 0x0f) == 1) {
|
||||||
|
CatPrint (Str, L"0,");
|
||||||
|
} else {
|
||||||
|
CatPrint (Str, L"0x%x,", (SasEx->DeviceTopology >> 8) & 0xff);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CatPrint (Str, L"0,0,0,0,");
|
||||||
|
}
|
||||||
|
|
||||||
|
CatPrint (Str, L")");
|
||||||
|
return ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Converts a 1394 device path structure to its string representative.
|
Converts a 1394 device path structure to its string representative.
|
||||||
|
|
||||||
|
@ -1205,10 +1265,21 @@ DevPathToTextIPv6 (
|
||||||
IPDevPath->Protocol
|
IPDevPath->Protocol
|
||||||
);
|
);
|
||||||
|
|
||||||
|
switch (IPDevPath->IpAddressOrigin) {
|
||||||
|
case 0:
|
||||||
|
CatPrint (Str, L",Static");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
CatPrint (Str, L",StatelessAutoConfigure");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
CatPrint (Str, L",StatefulAutoConfigure");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
CatPrint (
|
CatPrint (
|
||||||
Str,
|
Str,
|
||||||
L",%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",
|
L",%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
|
||||||
IPDevPath->StaticIpAddress ? L"Static" : L"DHCP",
|
|
||||||
IPDevPath->LocalIpAddress.Addr[0],
|
IPDevPath->LocalIpAddress.Addr[0],
|
||||||
IPDevPath->LocalIpAddress.Addr[1],
|
IPDevPath->LocalIpAddress.Addr[1],
|
||||||
IPDevPath->LocalIpAddress.Addr[2],
|
IPDevPath->LocalIpAddress.Addr[2],
|
||||||
|
@ -1226,6 +1297,31 @@ DevPathToTextIPv6 (
|
||||||
IPDevPath->LocalIpAddress.Addr[14],
|
IPDevPath->LocalIpAddress.Addr[14],
|
||||||
IPDevPath->LocalIpAddress.Addr[15]
|
IPDevPath->LocalIpAddress.Addr[15]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (DevicePathNodeLength (IPDevPath) == sizeof (IPv6_DEVICE_PATH)) {
|
||||||
|
CatPrint (
|
||||||
|
Str,
|
||||||
|
L",0x%x,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
|
||||||
|
IPDevPath->PrefixLength,
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[0],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[1],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[2],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[3],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[4],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[5],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[6],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[7],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[8],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[9],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[10],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[11],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[12],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[13],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[14],
|
||||||
|
IPDevPath->GatewayIpAddress.Addr[15]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
CatPrint (Str, L")");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1790,6 +1886,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE DevPathToTextTable
|
||||||
{MESSAGING_DEVICE_PATH, MSG_SCSI_DP, DevPathToTextScsi},
|
{MESSAGING_DEVICE_PATH, MSG_SCSI_DP, DevPathToTextScsi},
|
||||||
{MESSAGING_DEVICE_PATH, MSG_FIBRECHANNEL_DP, DevPathToTextFibre},
|
{MESSAGING_DEVICE_PATH, MSG_FIBRECHANNEL_DP, DevPathToTextFibre},
|
||||||
{MESSAGING_DEVICE_PATH, MSG_FIBRECHANNELEX_DP, DevPathToTextFibreEx},
|
{MESSAGING_DEVICE_PATH, MSG_FIBRECHANNELEX_DP, DevPathToTextFibreEx},
|
||||||
|
{MESSAGING_DEVICE_PATH, MSG_SASEX_DP, DevPathToTextSasEx},
|
||||||
{MESSAGING_DEVICE_PATH, MSG_1394_DP, DevPathToText1394},
|
{MESSAGING_DEVICE_PATH, MSG_1394_DP, DevPathToText1394},
|
||||||
{MESSAGING_DEVICE_PATH, MSG_USB_DP, DevPathToTextUsb},
|
{MESSAGING_DEVICE_PATH, MSG_USB_DP, DevPathToTextUsb},
|
||||||
{MESSAGING_DEVICE_PATH, MSG_USB_WWID_DP, DevPathToTextUsbWWID},
|
{MESSAGING_DEVICE_PATH, MSG_USB_WWID_DP, DevPathToTextUsbWWID},
|
||||||
|
|
|
@ -41,9 +41,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA {
|
typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA {
|
||||||
UINT8 CHAPType;
|
UINT8 CHAPType;
|
||||||
CHAR8 CHAPName[ISCSI_CHAP_NAME_MAX_LEN];
|
CHAR8 CHAPName[ISCSI_CHAP_NAME_STORAGE];
|
||||||
CHAR8 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
CHAR8 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
||||||
CHAR8 ReverseCHAPName[ISCSI_CHAP_NAME_MAX_LEN];
|
CHAR8 ReverseCHAPName[ISCSI_CHAP_NAME_STORAGE];
|
||||||
CHAR8 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
CHAR8 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
||||||
} ISCSI_CHAP_AUTH_CONFIG_NVDATA;
|
} ISCSI_CHAP_AUTH_CONFIG_NVDATA;
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define ISCSI_CHAP_SECRET_STORAGE 17
|
#define ISCSI_CHAP_SECRET_STORAGE 17
|
||||||
|
|
||||||
#define ISCSI_CHAP_NAME_MAX_LEN 126
|
#define ISCSI_CHAP_NAME_MAX_LEN 126
|
||||||
|
#define ISCSI_CHAP_NAME_STORAGE 127
|
||||||
|
|
||||||
#define ISID_CONFIGURABLE_MIN_LEN 6
|
#define ISID_CONFIGURABLE_MIN_LEN 6
|
||||||
#define ISID_CONFIGURABLE_MAX_LEN 12
|
#define ISID_CONFIGURABLE_MAX_LEN 12
|
||||||
|
@ -96,9 +97,9 @@ typedef struct {
|
||||||
UINT8 TargetInfoFromDhcp;
|
UINT8 TargetInfoFromDhcp;
|
||||||
|
|
||||||
UINT8 CHAPType;
|
UINT8 CHAPType;
|
||||||
CHAR16 CHAPName[ISCSI_CHAP_NAME_MAX_LEN];
|
CHAR16 CHAPName[ISCSI_CHAP_NAME_STORAGE];
|
||||||
CHAR16 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
CHAR16 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
||||||
CHAR16 ReverseCHAPName[ISCSI_CHAP_NAME_MAX_LEN];
|
CHAR16 ReverseCHAPName[ISCSI_CHAP_NAME_STORAGE];
|
||||||
CHAR16 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
CHAR16 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
|
||||||
|
|
||||||
CHAR16 IsId[ISID_CONFIGURABLE_STORAGE];
|
CHAR16 IsId[ISID_CONFIGURABLE_STORAGE];
|
||||||
|
|
|
@ -757,7 +757,19 @@ IScsiGetTcpConnDevicePath (
|
||||||
) {
|
) {
|
||||||
|
|
||||||
DPathNode->Ipv4.LocalPort = 0;
|
DPathNode->Ipv4.LocalPort = 0;
|
||||||
DPathNode->Ipv4.StaticIpAddress = (BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);
|
DPathNode->Ipv4.StaticIpAddress =
|
||||||
|
(BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (
|
||||||
|
&DPathNode->Ipv4.GatewayIpAddress,
|
||||||
|
&Session->ConfigData.NvData.Gateway
|
||||||
|
);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (
|
||||||
|
&DPathNode->Ipv4.SubnetMask,
|
||||||
|
&Session->ConfigData.NvData.SubnetMask
|
||||||
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -692,6 +692,14 @@ IScsiProcessLoginRsp (
|
||||||
LoginRsp->MaxCmdSN = NTOHL (LoginRsp->MaxCmdSN);
|
LoginRsp->MaxCmdSN = NTOHL (LoginRsp->MaxCmdSN);
|
||||||
|
|
||||||
if ((Conn->CurrentStage == ISCSI_SECURITY_NEGOTIATION) && (Conn->CHAPStep == ISCSI_CHAP_INITIAL)) {
|
if ((Conn->CurrentStage == ISCSI_SECURITY_NEGOTIATION) && (Conn->CHAPStep == ISCSI_CHAP_INITIAL)) {
|
||||||
|
//
|
||||||
|
// If the Login Request is a leading Login Request, the target MUST use
|
||||||
|
// the value presented in CmdSN as the target value for ExpCmdSN.
|
||||||
|
//
|
||||||
|
if ((Session->State == SESSION_STATE_FREE) && (Session->CmdSN != LoginRsp->ExpCmdSN)) {
|
||||||
|
return EFI_PROTOCOL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// It's the initial Login Response, initialize the local ExpStatSN, MaxCmdSN
|
// It's the initial Login Response, initialize the local ExpStatSN, MaxCmdSN
|
||||||
// and ExpCmdSN.
|
// and ExpCmdSN.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Misc support routines for tcp.
|
Misc support routines for tcp.
|
||||||
|
|
||||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
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
|
||||||
|
@ -1115,6 +1115,8 @@ TcpInstallDevicePath (
|
||||||
Tcb->UseDefaultAddr
|
Tcb->UseDefaultAddr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (&Ip4DPathNode.SubnetMask, &Tcb->SubnetMask);
|
||||||
|
|
||||||
Sock->DevicePath = AppendDevicePathNode (
|
Sock->DevicePath = AppendDevicePathNode (
|
||||||
Sock->ParentDevicePath,
|
Sock->ParentDevicePath,
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *) &Ip4DPathNode
|
(EFI_DEVICE_PATH_PROTOCOL *) &Ip4DPathNode
|
||||||
|
|
|
@ -598,10 +598,21 @@ typedef struct {
|
||||||
///
|
///
|
||||||
UINT16 Protocol;
|
UINT16 Protocol;
|
||||||
///
|
///
|
||||||
/// 0x00 - The Source IP Address was assigned though DHCP.
|
/// 0x00 - The Local IP Address was manually configured.
|
||||||
/// 0x01 - The Source IP Address is statically bound.
|
/// 0x01 - The Local IP Address is assigned through IPv6
|
||||||
|
/// stateless auto-configuration.
|
||||||
|
/// 0x02 - The Local IP Address is assigned through IPv6
|
||||||
|
/// stateful configuration.
|
||||||
///
|
///
|
||||||
BOOLEAN StaticIpAddress;
|
UINT8 IpAddressOrigin;
|
||||||
|
///
|
||||||
|
/// The prefix length
|
||||||
|
///
|
||||||
|
UINT8 PrefixLength;
|
||||||
|
///
|
||||||
|
/// The gateway IP address
|
||||||
|
///
|
||||||
|
EFI_IPv6_ADDRESS GatewayIpAddress;
|
||||||
} IPv6_DEVICE_PATH;
|
} IPv6_DEVICE_PATH;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -750,6 +761,30 @@ typedef struct {
|
||||||
UINT16 RelativeTargetPort;
|
UINT16 RelativeTargetPort;
|
||||||
} SAS_DEVICE_PATH;
|
} SAS_DEVICE_PATH;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Serial Attached SCSI (SAS) Ex Device Path SubType
|
||||||
|
///
|
||||||
|
#define MSG_SASEX_DP 0x16
|
||||||
|
typedef struct {
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||||
|
///
|
||||||
|
/// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
|
||||||
|
///
|
||||||
|
UINT8 SasAddress[8];
|
||||||
|
///
|
||||||
|
/// 8-byte array of the SAS Logical Unit Number.
|
||||||
|
///
|
||||||
|
UINT8 Lun[8];
|
||||||
|
///
|
||||||
|
/// More Information about the device and its interconnect.
|
||||||
|
///
|
||||||
|
UINT16 DeviceTopology;
|
||||||
|
///
|
||||||
|
/// Relative Target Port (RTP).
|
||||||
|
///
|
||||||
|
UINT16 RelativeTargetPort;
|
||||||
|
} SASEX_DEVICE_PATH;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// iSCSI Device Path SubType
|
/// iSCSI Device Path SubType
|
||||||
///
|
///
|
||||||
|
@ -1047,6 +1082,7 @@ typedef union {
|
||||||
UART_DEVICE_PATH Uart;
|
UART_DEVICE_PATH Uart;
|
||||||
UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
|
UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
|
||||||
SAS_DEVICE_PATH Sas;
|
SAS_DEVICE_PATH Sas;
|
||||||
|
SASEX_DEVICE_PATH SasEx;
|
||||||
HARDDRIVE_DEVICE_PATH HardDrive;
|
HARDDRIVE_DEVICE_PATH HardDrive;
|
||||||
CDROM_DEVICE_PATH CD;
|
CDROM_DEVICE_PATH CD;
|
||||||
|
|
||||||
|
@ -1095,6 +1131,7 @@ typedef union {
|
||||||
UART_DEVICE_PATH *Uart;
|
UART_DEVICE_PATH *Uart;
|
||||||
UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
|
UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
|
||||||
SAS_DEVICE_PATH *Sas;
|
SAS_DEVICE_PATH *Sas;
|
||||||
|
SASEX_DEVICE_PATH *SasEx;
|
||||||
HARDDRIVE_DEVICE_PATH *HardDrive;
|
HARDDRIVE_DEVICE_PATH *HardDrive;
|
||||||
CDROM_DEVICE_PATH *CD;
|
CDROM_DEVICE_PATH *CD;
|
||||||
|
|
||||||
|
|
|
@ -1287,11 +1287,25 @@ IScsiGetTcpConnDevicePath (
|
||||||
if (DevicePathType (&DPathNode->DevPath) == MESSAGING_DEVICE_PATH) {
|
if (DevicePathType (&DPathNode->DevPath) == MESSAGING_DEVICE_PATH) {
|
||||||
if (!Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP) {
|
if (!Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP) {
|
||||||
DPathNode->Ipv4.LocalPort = 0;
|
DPathNode->Ipv4.LocalPort = 0;
|
||||||
DPathNode->Ipv4.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;
|
|
||||||
|
DPathNode->Ipv4.StaticIpAddress =
|
||||||
|
(BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (
|
||||||
|
&DPathNode->Ipv4.GatewayIpAddress,
|
||||||
|
&Session->ConfigData->SessionConfigData.Gateway
|
||||||
|
);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (
|
||||||
|
&DPathNode->Ipv4.SubnetMask,
|
||||||
|
&Session->ConfigData->SessionConfigData.SubnetMask
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
} else if (Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv6_DP) {
|
} else if (Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv6_DP) {
|
||||||
DPathNode->Ipv6.LocalPort = 0;
|
DPathNode->Ipv6.LocalPort = 0;
|
||||||
DPathNode->Ipv6.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;
|
DPathNode->Ipv6.IpAddressOrigin = 0;
|
||||||
|
DPathNode->Ipv6.PrefixLength = IP6_PREFIX_LENGTH;
|
||||||
|
ZeroMem (&DPathNode->Ipv6.GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Misc support routines for TCP driver.
|
Misc support routines for TCP driver.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
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
|
||||||
|
@ -1245,6 +1245,8 @@ TcpInstallDevicePath (
|
||||||
Tcb->UseDefaultAddr
|
Tcb->UseDefaultAddr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (&Ip4DPathNode.SubnetMask, &Tcb->SubnetMask);
|
||||||
|
|
||||||
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) &Ip4DPathNode;
|
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) &Ip4DPathNode;
|
||||||
} else {
|
} else {
|
||||||
NetLibCreateIPv6DPathNode (
|
NetLibCreateIPv6DPathNode (
|
||||||
|
|
|
@ -949,7 +949,7 @@ PxeBcCreateIp6Children (
|
||||||
ZeroMem (&Ip6Node, sizeof (IPv6_DEVICE_PATH));
|
ZeroMem (&Ip6Node, sizeof (IPv6_DEVICE_PATH));
|
||||||
Ip6Node.Header.Type = MESSAGING_DEVICE_PATH;
|
Ip6Node.Header.Type = MESSAGING_DEVICE_PATH;
|
||||||
Ip6Node.Header.SubType = MSG_IPv6_DP;
|
Ip6Node.Header.SubType = MSG_IPv6_DP;
|
||||||
Ip6Node.StaticIpAddress = FALSE;
|
Ip6Node.PrefixLength = IP6_PREFIX_LENGTH;
|
||||||
|
|
||||||
SetDevicePathNodeLength (&Ip6Node.Header, sizeof (Ip6Node));
|
SetDevicePathNodeLength (&Ip6Node.Header, sizeof (Ip6Node));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue