1. Enable Network stack to pass SCT, currently MNP, ARP, IP4, TCP4 and DHCP4 have passed SCT.
2. Enable Network stack to pass ICC build. 3. Sync Network library instances' module names with their filenames. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3692 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -36,7 +36,6 @@ EFI_SERVICE_BINDING_PROTOCOL mDhcp4ServiceBindingTemplete = {
|
||||
Dhcp4ServiceBindingDestroyChild
|
||||
};
|
||||
|
||||
//@MT: EFI_DRIVER_ENTRY_POINT (Dhcp4DriverEntryPoint)
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@@ -250,7 +249,7 @@ Dhcp4CreateService (
|
||||
|
||||
DhcpSb->HwLen = (UINT8) DhcpSb->UdpIo->SnpMode.HwAddressSize;
|
||||
DhcpSb->HwType = DhcpSb->UdpIo->SnpMode.IfType;
|
||||
CopyMem (&DhcpSb->Mac, &DhcpSb->UdpIo->SnpMode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&DhcpSb->Mac, &DhcpSb->UdpIo->SnpMode.CurrentAddress, sizeof (DhcpSb->Mac));
|
||||
|
||||
*Service = DhcpSb;
|
||||
return EFI_SUCCESS;
|
||||
@@ -454,7 +453,7 @@ DhcpInitProtocol (
|
||||
)
|
||||
{
|
||||
Instance->Signature = DHCP_PROTOCOL_SIGNATURE;
|
||||
CopyMem (&Instance->Dhcp4Protocol, &mDhcp4ProtocolTemplate, sizeof (EFI_DHCP4_PROTOCOL));
|
||||
CopyMem (&Instance->Dhcp4Protocol, &mDhcp4ProtocolTemplate, sizeof (Instance->Dhcp4Protocol));
|
||||
NetListInit (&Instance->Link);
|
||||
Instance->Handle = NULL;
|
||||
Instance->Service = DhcpSb;
|
||||
|
@@ -69,9 +69,9 @@ EfiDhcp4GetModeData (
|
||||
// Caller can use GetModeData to retrieve current DHCP states
|
||||
// no matter whether it is the active child or not.
|
||||
//
|
||||
Dhcp4ModeData->State = DhcpSb->DhcpState;
|
||||
CopyMem (&Dhcp4ModeData->ConfigData, &DhcpSb->ActiveConfig, sizeof (EFI_DHCP4_CONFIG_DATA));
|
||||
CopyMem (&Dhcp4ModeData->ClientMacAddress, &DhcpSb->Mac, sizeof (EFI_MAC_ADDRESS));
|
||||
Dhcp4ModeData->State = (EFI_DHCP4_STATE) DhcpSb->DhcpState;
|
||||
CopyMem (&Dhcp4ModeData->ConfigData, &DhcpSb->ActiveConfig, sizeof (Dhcp4ModeData->ConfigData));
|
||||
CopyMem (&Dhcp4ModeData->ClientMacAddress, &DhcpSb->Mac, sizeof (Dhcp4ModeData->ClientMacAddress));
|
||||
|
||||
Ip = HTONL (DhcpSb->ClientAddr);
|
||||
NetCopyMem (&Dhcp4ModeData->ClientAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
@@ -161,7 +161,7 @@ DhcpCopyConfigure (
|
||||
INTN Len;
|
||||
UINT32 Index;
|
||||
|
||||
CopyMem (Dst, Src, sizeof (EFI_DHCP4_CONFIG_DATA));
|
||||
CopyMem (Dst, Src, sizeof (Dst));
|
||||
Dst->DiscoverTimeout = NULL;
|
||||
Dst->RequestTimeout = NULL;
|
||||
Dst->OptionList = NULL;
|
||||
@@ -250,9 +250,7 @@ DhcpYieldControl (
|
||||
)
|
||||
{
|
||||
EFI_DHCP4_CONFIG_DATA *Config;
|
||||
DHCP_PROTOCOL *Instance;
|
||||
|
||||
Instance = DhcpSb->ActiveChild;
|
||||
Config = &DhcpSb->ActiveConfig;
|
||||
|
||||
DhcpSb->ServiceState = DHCP_UNCONFIGED;
|
||||
|
@@ -61,10 +61,10 @@ enum {
|
||||
//
|
||||
DHCP_UNCONFIGED = 0,
|
||||
DHCP_CONFIGED,
|
||||
DHCP_DESTORY,
|
||||
DHCP_DESTORY
|
||||
};
|
||||
|
||||
typedef struct _DHCP_PROTOCOL {
|
||||
struct _DHCP_PROTOCOL {
|
||||
UINT32 Signature;
|
||||
EFI_DHCP4_PROTOCOL Dhcp4Protocol;
|
||||
NET_LIST_ENTRY Link;
|
||||
@@ -83,7 +83,7 @@ typedef struct _DHCP_PROTOCOL {
|
||||
// DHCP driver is specical in that it is a singleton. Although it
|
||||
// has a service binding, there can be only one active child.
|
||||
//
|
||||
typedef struct _DHCP_SERVICE {
|
||||
struct _DHCP_SERVICE {
|
||||
UINT32 Signature;
|
||||
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
|
||||
|
||||
|
@@ -120,7 +120,7 @@ DhcpCallUser (
|
||||
Status = Config->Dhcp4Callback (
|
||||
&DhcpSb->ActiveChild->Dhcp4Protocol,
|
||||
Config->CallbackContext,
|
||||
DhcpSb->DhcpState,
|
||||
(EFI_DHCP4_STATE) DhcpSb->DhcpState,
|
||||
Event,
|
||||
Packet,
|
||||
NewPacket
|
||||
@@ -948,7 +948,7 @@ DhcpHandleReboot (
|
||||
}
|
||||
|
||||
DhcpSb->Selected = Packet;
|
||||
CopyMem (DhcpSb->Para, Para, sizeof (DHCP_PARAMETER));
|
||||
CopyMem (DhcpSb->Para, Para, sizeof (*DhcpSb->Para));
|
||||
|
||||
Status = DhcpLeaseAcquired (DhcpSb);
|
||||
|
||||
@@ -1214,7 +1214,7 @@ DhcpSendMessage (
|
||||
Len = sizeof (EFI_DHCP4_PACKET) + 128 + DhcpSb->UserOptionLen;
|
||||
|
||||
if (Msg != NULL) {
|
||||
Len += (UINT32)AsciiStrLen (Msg);
|
||||
Len += (UINT32)AsciiStrLen ((CHAR8 *) Msg);
|
||||
}
|
||||
|
||||
Packet = NetAllocatePool (Len);
|
||||
@@ -1310,7 +1310,7 @@ DhcpSendMessage (
|
||||
// Append the user's message if it isn't NULL
|
||||
//
|
||||
if (Msg != NULL) {
|
||||
Len = NET_MIN ((UINT32) AsciiStrLen (Msg), 255);
|
||||
Len = NET_MIN ((UINT32) AsciiStrLen ((CHAR8 *) Msg), 255);
|
||||
Buf = DhcpAppendOption (Buf, DHCP_TAG_MESSAGE, (UINT16) Len, Msg);
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,7 @@ enum {
|
||||
//
|
||||
DHCP_NOTIFY_COMPLETION = 1,
|
||||
DHCP_NOTIFY_RENEWREBIND,
|
||||
DHCP_NOTIFY_ALL,
|
||||
DHCP_NOTIFY_ALL
|
||||
};
|
||||
|
||||
#define DHCP_IS_BOOTP(Parameter) (((Parameter) == NULL) || ((Parameter)->DhcpType == 0))
|
||||
|
@@ -424,7 +424,7 @@ DhcpIterateOptions (
|
||||
|
||||
if ((Overload == DHCP_OVERLOAD_FILENAME) || (Overload == DHCP_OVERLOAD_BOTH)) {
|
||||
Status = DhcpIterateBufferOptions (
|
||||
Packet->Dhcp4.Header.BootFileName,
|
||||
(UINT8 *) Packet->Dhcp4.Header.BootFileName,
|
||||
128,
|
||||
Check,
|
||||
Context,
|
||||
@@ -438,7 +438,7 @@ DhcpIterateOptions (
|
||||
|
||||
if ((Overload == DHCP_OVERLOAD_SVRNAME) || (Overload == DHCP_OVERLOAD_BOTH)) {
|
||||
Status = DhcpIterateBufferOptions (
|
||||
Packet->Dhcp4.Header.ServerName,
|
||||
(UINT8 *) Packet->Dhcp4.Header.ServerName,
|
||||
64,
|
||||
Check,
|
||||
Context,
|
||||
@@ -480,7 +480,7 @@ DhcpGetOptionLen (
|
||||
DHCP_OPTION_COUNT *OpCount;
|
||||
|
||||
OpCount = (DHCP_OPTION_COUNT *) Context;
|
||||
OpCount[Tag].Offset = OpCount[Tag].Offset + Len;
|
||||
OpCount[Tag].Offset = (UINT16) (OpCount[Tag].Offset + Len);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -528,8 +528,8 @@ DhcpFillOption (
|
||||
|
||||
NetCopyMem (Buf + OptCount[Tag].Offset, Data, Len);
|
||||
|
||||
OptCount[Tag].Offset = OptCount[Tag].Offset + Len;
|
||||
Options[Index].Len = Options[Index].Len + Len;
|
||||
OptCount[Tag].Offset = (UINT16) (OptCount[Tag].Offset + Len);
|
||||
Options[Index].Len = (UINT16) (Options[Index].Len + Len);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -606,8 +606,8 @@ DhcpParseOption (
|
||||
if (OptCount[Index].Offset != 0) {
|
||||
OptCount[Index].Index = (UINT8) OptNum;
|
||||
|
||||
TotalLen = TotalLen + OptCount[Index].Offset;
|
||||
OptCount[Index].Offset = TotalLen - OptCount[Index].Offset;
|
||||
TotalLen = (UINT16) (TotalLen + OptCount[Index].Offset);
|
||||
OptCount[Index].Offset = (UINT16) (TotalLen - OptCount[Index].Offset);
|
||||
|
||||
OptNum++;
|
||||
}
|
||||
@@ -727,7 +727,7 @@ DhcpValidateOptions (
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
CopyMem (*Para, &Parameter, sizeof (DHCP_PARAMETER));
|
||||
CopyMem (*Para, &Parameter, sizeof (**Para));
|
||||
}
|
||||
|
||||
ON_EXIT:
|
||||
@@ -879,7 +879,7 @@ DhcpBuild (
|
||||
|
||||
Packet->Size = Len;
|
||||
Packet->Length = 0;
|
||||
CopyMem (&Packet->Dhcp4.Header, &SeedPacket->Dhcp4.Header, sizeof (EFI_DHCP4_HEADER));
|
||||
CopyMem (&Packet->Dhcp4.Header, &SeedPacket->Dhcp4.Header, sizeof (Packet->Dhcp4.Header));
|
||||
Packet->Dhcp4.Magik = DHCP_OPTION_MAGIC;
|
||||
Buf = Packet->Dhcp4.Option;
|
||||
|
||||
|
@@ -131,7 +131,7 @@ enum {
|
||||
DHCP_TAG_T1 = 58, // Renewal (T1) Time Value
|
||||
DHCP_TAG_T2 = 59, // Rebinding (T2) Time Value
|
||||
DHCP_TAG_VENDOR_CLASS = 60, // Vendor class identifier
|
||||
DHCP_TAG_CLIENT_ID = 61, // Client-identifier
|
||||
DHCP_TAG_CLIENT_ID = 61 // Client-identifier
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -153,7 +153,7 @@ enum {
|
||||
//
|
||||
DHCP_OVERLOAD_FILENAME = 1,
|
||||
DHCP_OVERLOAD_SVRNAME = 2,
|
||||
DHCP_OVERLOAD_BOTH = 3,
|
||||
DHCP_OVERLOAD_BOTH = 3
|
||||
};
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user