mirror of https://github.com/acidanthera/audk.git
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:
parent
4a8f7ccecc
commit
687a2e5f69
|
@ -553,7 +553,7 @@ UsbScsiModeSense (
|
|||
// ModeSense6 command is defined in [SCSI2Spec-Page151]
|
||||
//
|
||||
ModeSenseCmd.OpCode = USB_SCSI_MODE_SENSE6_OPCODE;
|
||||
ModeSenseCmd.Lun = USB_BOOT_LUN (UsbMass->Lun);
|
||||
ModeSenseCmd.Lun = (UINT8) USB_BOOT_LUN (UsbMass->Lun);
|
||||
ModeSenseCmd.PageCode = 0x3F;
|
||||
ModeSenseCmd.AllocateLen = (UINT8) sizeof (USB_SCSI_MODE_SENSE6_PARA_HEADER);
|
||||
|
||||
|
@ -572,7 +572,7 @@ UsbScsiModeSense (
|
|||
// devices support this command, so have a try here.
|
||||
//
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Media->ReadOnly = (ModeParaHeader.DevicePara & 0x80) ? TRUE : FALSE;
|
||||
Media->ReadOnly = (BOOLEAN) ((ModeParaHeader.DevicePara & 0x80) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
|
|
@ -1272,18 +1272,47 @@ IpIoGetIcmpErrStatus (
|
|||
OUT BOOLEAN *Notify OPTIONAL
|
||||
)
|
||||
{
|
||||
ICMP_ERROR_INFO IcmpErrMap[] = {
|
||||
{ EFI_NETWORK_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_UNREACH_NET
|
||||
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_UNREACH_HOST
|
||||
{ EFI_PROTOCOL_UNREACHABLE, TRUE, TRUE }, // ICMP_ERR_UNREACH_PROTOCOL
|
||||
{ EFI_PORT_UNREACHABLE, TRUE, TRUE }, // ICMP_ERR_UNREACH_PORT
|
||||
{ EFI_ICMP_ERROR, TRUE, TRUE }, // ICMP_ERR_MSGSIZE
|
||||
{ EFI_ICMP_ERROR, FALSE, TRUE }, // ICMP_ERR_UNREACH_SRCFAIL
|
||||
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_TIMXCEED_INTRANS
|
||||
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_TIMEXCEED_REASS
|
||||
{ EFI_ICMP_ERROR, FALSE, FALSE }, // ICMP_ERR_QUENCH
|
||||
{ EFI_ICMP_ERROR, FALSE, TRUE } // ICMP_ERR_PARAMPROB
|
||||
};
|
||||
ICMP_ERROR_INFO IcmpErrMap[10];
|
||||
|
||||
IcmpErrMap[0].Error = EFI_NETWORK_UNREACHABLE;
|
||||
IcmpErrMap[0].IsHard = FALSE;
|
||||
IcmpErrMap[0].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[1].Error = EFI_HOST_UNREACHABLE;
|
||||
IcmpErrMap[1].IsHard = FALSE;
|
||||
IcmpErrMap[1].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[2].Error = EFI_PROTOCOL_UNREACHABLE;
|
||||
IcmpErrMap[2].IsHard = TRUE;
|
||||
IcmpErrMap[2].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[3].Error = EFI_PORT_UNREACHABLE;
|
||||
IcmpErrMap[3].IsHard = TRUE;
|
||||
IcmpErrMap[3].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[4].Error = EFI_ICMP_ERROR;
|
||||
IcmpErrMap[4].IsHard = TRUE;
|
||||
IcmpErrMap[4].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[5].Error = EFI_ICMP_ERROR;
|
||||
IcmpErrMap[5].IsHard = FALSE;
|
||||
IcmpErrMap[5].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[6].Error = EFI_HOST_UNREACHABLE;
|
||||
IcmpErrMap[6].IsHard = FALSE;
|
||||
IcmpErrMap[6].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[7].Error = EFI_HOST_UNREACHABLE;
|
||||
IcmpErrMap[7].IsHard = FALSE;
|
||||
IcmpErrMap[7].Notify = TRUE;
|
||||
|
||||
IcmpErrMap[8].Error = EFI_ICMP_ERROR;
|
||||
IcmpErrMap[8].IsHard = FALSE;
|
||||
IcmpErrMap[8].Notify = FALSE;
|
||||
|
||||
IcmpErrMap[9].Error = EFI_ICMP_ERROR;
|
||||
IcmpErrMap[9].IsHard = FALSE;
|
||||
IcmpErrMap[9].Notify = TRUE;
|
||||
|
||||
ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#/** @file
|
||||
# Component name for module NetLib
|
||||
# Component name for module DxeIpIoLib
|
||||
#
|
||||
# FIX ME!
|
||||
# Copyright (c) 2006, Intel Corporation.
|
||||
# Copyright (c) 2006, Intel Corporation.
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = NetIpIoDxe
|
||||
BASE_NAME = DxeIpIoLib
|
||||
FILE_GUID = A302F877-8625-425c-B1EC-7487B62C4FDA
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#/** @file
|
||||
# Component name for module NetLib
|
||||
# Component name for module DxeNetLib
|
||||
#
|
||||
# FIX ME!
|
||||
# Copyright (c) 2006, Intel Corporation.
|
||||
# Copyright (c) 2006, Intel Corporation.
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = NetLibDxe
|
||||
BASE_NAME = DxeNetLib
|
||||
FILE_GUID = db6dcef3-9f4e-4340-9351-fc35aa8a5888
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
|
|
|
@ -414,7 +414,10 @@ UdpIoFreePort (
|
|||
UdpIo->UdpHandle
|
||||
);
|
||||
|
||||
NetListRemoveEntry (&UdpIo->Link);
|
||||
if (!IsListEmpty(&UdpIo->Link)) {
|
||||
NetListRemoveEntry (&UdpIo->Link);
|
||||
}
|
||||
|
||||
NetFreePool (UdpIo);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#/** @file
|
||||
# Component name for module NetLib
|
||||
# Component name for module DxeUpdIoLib
|
||||
#
|
||||
# FIX ME!
|
||||
# Copyright (c) 2006, Intel Corporation.
|
||||
# Copyright (c) 2006, Intel Corporation.
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = DxeUpdIoDxe
|
||||
BASE_NAME = DxeUpdIoLib
|
||||
FILE_GUID = 7E615AA1-41EE-49d4-B7E9-1D7A60AA5C8D
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
|
|
|
@ -54,7 +54,7 @@ ArpInitInstance (
|
|||
Instance->Signature = ARP_INSTANCE_DATA_SIGNATURE;
|
||||
Instance->ArpService = ArpService;
|
||||
|
||||
CopyMem (&Instance->ArpProto, &mEfiArpProtocolTemplate, sizeof (ARP_SERVICE_DATA));
|
||||
CopyMem (&Instance->ArpProto, &mEfiArpProtocolTemplate, sizeof (Instance->ArpProto));
|
||||
|
||||
Instance->Configured = FALSE;
|
||||
Instance->Destroyed = FALSE;
|
||||
|
@ -263,7 +263,9 @@ ArpOnFrameRcvd (
|
|||
}
|
||||
}
|
||||
|
||||
NetListRemoveEntry (&CacheEntry->List);
|
||||
if (!IsListEmpty (&CacheEntry->List)) {
|
||||
NetListRemoveEntry (&CacheEntry->List);
|
||||
}
|
||||
|
||||
//
|
||||
// Fill the addresses into the CacheEntry.
|
||||
|
@ -912,7 +914,7 @@ ArpConfigureInstance (
|
|||
//
|
||||
// Save the configuration.
|
||||
//
|
||||
CopyMem (OldConfigData, ConfigData, sizeof (EFI_ARP_CONFIG_DATA));
|
||||
CopyMem (OldConfigData, ConfigData, sizeof (*OldConfigData));
|
||||
|
||||
OldConfigData->StationAddress = NetAllocatePool (OldConfigData->SwAddressLength);
|
||||
if (OldConfigData->StationAddress == NULL) {
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
@ -66,7 +66,7 @@ EfiNicIp4ConfigGetName (
|
|||
}
|
||||
|
||||
if (NicAddr != NULL) {
|
||||
CopyMem (NicAddr, &Instance->NicAddr, sizeof (NIC_ADDR));
|
||||
CopyMem (NicAddr, &Instance->NicAddr, sizeof (*NicAddr));
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@ -630,7 +630,7 @@ Ip4ConfigOnDhcp4Complete (
|
|||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (NIC_ADDR));
|
||||
CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (Instance->NicConfig->NicAddr));
|
||||
Instance->NicConfig->Source = IP4_CONFIG_SOURCE_DHCP;
|
||||
Instance->NicConfig->Perment = Perment;
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ Ip4ConfigDriverBindingStart (
|
|||
|
||||
Instance->NicAddr.Type = (UINT16) SnpMode.IfType;
|
||||
Instance->NicAddr.Len = (UINT8) SnpMode.HwAddressSize;
|
||||
CopyMem (&Instance->NicAddr.MacAddr, &SnpMode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Instance->NicAddr.MacAddr, &SnpMode.CurrentAddress, sizeof (Instance->NicAddr.MacAddr));
|
||||
|
||||
//
|
||||
// Add it to the global list, and compose the name
|
||||
|
|
|
@ -58,7 +58,7 @@ enum {
|
|||
//
|
||||
IP4_HEAD_DF_MASK = 0x4000,
|
||||
IP4_HEAD_MF_MASK = 0x2000,
|
||||
IP4_HEAD_OFFSET_MASK = 0x1fff,
|
||||
IP4_HEAD_OFFSET_MASK = 0x1fff
|
||||
};
|
||||
|
||||
#define IP4_ALLZERO_ADDRESS 0x00000000u
|
||||
|
|
|
@ -251,7 +251,7 @@ Ip4IcmpReplyEcho (
|
|||
Icmp = (IP4_ICMP_QUERY_HEAD *) NetbufGetByte (Data, 0, NULL);
|
||||
Icmp->Head.Type = ICMP_ECHO_REPLY;
|
||||
Icmp->Head.Checksum = 0;
|
||||
Icmp->Head.Checksum = ~NetblockChecksum ((UINT8 *) Icmp, Data->TotalSize);
|
||||
Icmp->Head.Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Icmp, Data->TotalSize));
|
||||
|
||||
ReplyHead.Tos = 0;
|
||||
ReplyHead.Fragment = 0;
|
||||
|
@ -353,7 +353,7 @@ Ip4IcmpHandle (
|
|||
goto DROP;
|
||||
}
|
||||
|
||||
Checksum = ~NetbufChecksum (Packet);
|
||||
Checksum = (UINT16) (~NetbufChecksum (Packet));
|
||||
if ((Icmp.Checksum != 0) && (Checksum != 0)) {
|
||||
goto DROP;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ enum {
|
|||
//
|
||||
ICMP_INVALID_MESSAGE = 0,
|
||||
ICMP_ERROR_MESSAGE = 1,
|
||||
ICMP_QUERY_MESSAGE = 2,
|
||||
ICMP_QUERY_MESSAGE = 2
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -108,8 +108,8 @@ Ip4WrapLinkTxToken (
|
|||
Token->CallBack = CallBack;
|
||||
Token->Packet = Packet;
|
||||
Token->Context = Context;
|
||||
CopyMem (&Token->DstMac, &mZeroMacAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Token->SrcMac, &Interface->Mac, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Token->DstMac, &mZeroMacAddress, sizeof (Token->DstMac));
|
||||
CopyMem (&Token->SrcMac, &Interface->Mac, sizeof (Token->SrcMac));
|
||||
|
||||
MnpToken = &(Token->MnpToken);
|
||||
MnpToken->Status = EFI_NOT_READY;
|
||||
|
@ -213,7 +213,7 @@ Ip4CreateArpQue (
|
|||
}
|
||||
|
||||
ArpQue->Ip = DestIp;
|
||||
CopyMem (&ArpQue->Mac, &mZeroMacAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&ArpQue->Mac, &mZeroMacAddress, sizeof (ArpQue->Mac));
|
||||
|
||||
return ArpQue;
|
||||
}
|
||||
|
@ -485,8 +485,8 @@ Ip4CreateInterface (
|
|||
return NULL;
|
||||
}
|
||||
|
||||
CopyMem (&Interface->Mac, &SnpMode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Interface->BroadcastMac, &SnpMode.BroadcastAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Interface->Mac, &SnpMode.CurrentAddress, sizeof (Interface->Mac));
|
||||
CopyMem (&Interface->BroadcastMac, &SnpMode.BroadcastAddress, sizeof (Interface->BroadcastMac));
|
||||
Interface->HwaddrLen = SnpMode.HwAddressSize;
|
||||
|
||||
NetListInit (&Interface->IpInstances);
|
||||
|
@ -796,7 +796,7 @@ Ip4OnArpResolved (
|
|||
NetListRemoveEntry (Entry);
|
||||
|
||||
Token = NET_LIST_USER_STRUCT (Entry, IP4_LINK_TX_TOKEN, Link);
|
||||
CopyMem (&Token->DstMac, &ArpQue->Mac, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Token->DstMac, &ArpQue->Mac, sizeof (Token->DstMac));
|
||||
|
||||
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
|
||||
|
||||
|
@ -904,7 +904,7 @@ Ip4SendFrame (
|
|||
// all the broadcasts.
|
||||
//
|
||||
if (NextHop == IP4_ALLONE_ADDRESS) {
|
||||
CopyMem (&Token->DstMac, &Interface->BroadcastMac, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&Token->DstMac, &Interface->BroadcastMac, sizeof (Token->DstMac));
|
||||
goto SEND_NOW;
|
||||
|
||||
} else if (IP4_IS_MULTICAST (NextHop)) {
|
||||
|
|
|
@ -28,7 +28,7 @@ enum {
|
|||
IP4_FRAME_RX_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'F', 'R'),
|
||||
IP4_FRAME_TX_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'F', 'T'),
|
||||
IP4_FRAME_ARP_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'F', 'A'),
|
||||
IP4_INTERFACE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'I', 'F'),
|
||||
IP4_INTERFACE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'I', 'F')
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -134,7 +134,7 @@ BOOLEAN
|
|||
// Notice the special cases that DHCP can configure the interface
|
||||
// with 0.0.0.0/0.0.0.0.
|
||||
//
|
||||
typedef struct _IP4_INTERFACE {
|
||||
struct _IP4_INTERFACE {
|
||||
UINT32 Signature;
|
||||
NET_LIST_ENTRY Link;
|
||||
INTN RefCnt;
|
||||
|
@ -182,7 +182,7 @@ typedef struct _IP4_INTERFACE {
|
|||
//
|
||||
NET_LIST_ENTRY IpInstances;
|
||||
BOOLEAN PromiscRecv;
|
||||
} IP4_INTERFACE;
|
||||
};
|
||||
|
||||
IP4_INTERFACE *
|
||||
Ip4CreateInterface (
|
||||
|
|
|
@ -206,7 +206,7 @@ Ip4SendIgmpMessage (
|
|||
Igmp->MaxRespTime = 0;
|
||||
Igmp->Checksum = 0;
|
||||
Igmp->Group = HTONL (Group);
|
||||
Igmp->Checksum = ~NetblockChecksum ((UINT8 *) Igmp, sizeof (IGMP_HEAD));
|
||||
Igmp->Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Igmp, sizeof (IGMP_HEAD)));
|
||||
|
||||
Head.Tos = 0;
|
||||
Head.Protocol = IP4_PROTO_IGMP;
|
||||
|
|
|
@ -66,7 +66,7 @@ enum {
|
|||
IGMP_LEAVE_GROUP = 0x17,
|
||||
|
||||
IGMP_V1ROUTER_PRESENT = 400,
|
||||
IGMP_UNSOLICIATED_REPORT = 10,
|
||||
IGMP_UNSOLICIATED_REPORT = 10
|
||||
};
|
||||
|
||||
EFI_STATUS
|
||||
|
|
|
@ -67,7 +67,7 @@ EfiIp4GetModeData (
|
|||
// IsConfigured is "whether the station address has been configured"
|
||||
//
|
||||
Ip4ModeData->IsStarted = (BOOLEAN)(IpInstance->State == IP4_STATE_CONFIGED);
|
||||
CopyMem (&Ip4ModeData->ConfigData, &IpInstance->ConfigData, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (&Ip4ModeData->ConfigData, &IpInstance->ConfigData, sizeof (Ip4ModeData->ConfigData));
|
||||
Ip4ModeData->IsConfigured = FALSE;
|
||||
|
||||
Ip4ModeData->GroupCount = IpInstance->GroupCount;
|
||||
|
@ -112,11 +112,11 @@ EfiIp4GetModeData (
|
|||
}
|
||||
|
||||
if (MnpConfigData != NULL) {
|
||||
CopyMem (MnpConfigData, &IpSb->MnpConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
|
||||
CopyMem (MnpConfigData, &IpSb->MnpConfigData, sizeof (*MnpConfigData));
|
||||
}
|
||||
|
||||
if (SnpModeData != NULL) {
|
||||
CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
|
||||
CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (*SnpModeData));
|
||||
}
|
||||
|
||||
NET_RESTORE_TPL (OldTpl);
|
||||
|
@ -197,7 +197,7 @@ Ip4ServiceConfigMnp (
|
|||
// recover the original configuration if failed to set the configure.
|
||||
//
|
||||
if (EFI_ERROR (Status) && Reconfig) {
|
||||
IpSb->MnpConfigData.EnablePromiscuousReceive = !PromiscReceive;
|
||||
IpSb->MnpConfigData.EnablePromiscuousReceive = (BOOLEAN) !PromiscReceive;
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
@ -477,7 +477,7 @@ Ip4InitProtocol (
|
|||
NetZeroMem (IpInstance, sizeof (IP4_PROTOCOL));
|
||||
|
||||
IpInstance->Signature = IP4_PROTOCOL_SIGNATURE;
|
||||
CopyMem (&IpInstance->Ip4Proto, &mEfiIp4ProtocolTemplete, sizeof (EFI_IP4_PROTOCOL));
|
||||
CopyMem (&IpInstance->Ip4Proto, &mEfiIp4ProtocolTemplete, sizeof (IpInstance->Ip4Proto));
|
||||
IpInstance->State = IP4_STATE_UNCONFIGED;
|
||||
IpInstance->Service = IpSb;
|
||||
|
||||
|
@ -538,7 +538,7 @@ Ip4ConfigProtocol (
|
|||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
CopyMem (&IpInstance->ConfigData, Config, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (&IpInstance->ConfigData, Config, sizeof (IpInstance->ConfigData));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -627,7 +627,7 @@ Ip4ConfigProtocol (
|
|||
IpInstance->Interface = IpIf;
|
||||
NetListInsertTail (&IpIf->IpInstances, &IpInstance->AddrLink);
|
||||
|
||||
CopyMem (&IpInstance->ConfigData, Config, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (&IpInstance->ConfigData, Config, sizeof (IpInstance->ConfigData));
|
||||
IpInstance->State = IP4_STATE_CONFIGED;
|
||||
|
||||
//
|
||||
|
@ -1616,7 +1616,6 @@ EfiIp4Receive (
|
|||
)
|
||||
{
|
||||
IP4_PROTOCOL *IpInstance;
|
||||
EFI_IP4_CONFIG_DATA *Config;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
|
@ -1636,8 +1635,6 @@ EfiIp4Receive (
|
|||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
Config = &IpInstance->ConfigData;
|
||||
|
||||
//
|
||||
// Current Udp implementation creates an IP child for each Udp child.
|
||||
// It initates a asynchronous receive immediately no matter whether
|
||||
|
|
|
@ -40,15 +40,15 @@ Abstract:
|
|||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
|
||||
#include "IP4Common.h"
|
||||
#include "IP4Driver.h"
|
||||
#include "IP4If.h"
|
||||
#include "Ip4Common.h"
|
||||
#include "Ip4Driver.h"
|
||||
#include "Ip4If.h"
|
||||
#include "Ip4Icmp.h"
|
||||
#include "IP4Option.h"
|
||||
#include "Ip4Option.h"
|
||||
#include "Ip4Igmp.h"
|
||||
#include "IP4Route.h"
|
||||
#include "IP4Input.h"
|
||||
#include "IP4Output.h"
|
||||
#include "Ip4Route.h"
|
||||
#include "Ip4Input.h"
|
||||
#include "Ip4Output.h"
|
||||
|
||||
enum {
|
||||
IP4_PROTOCOL_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'P'),
|
||||
|
@ -73,7 +73,7 @@ enum {
|
|||
IP4_SERVICE_UNSTARTED = 0,
|
||||
IP4_SERVICE_STARTED,
|
||||
IP4_SERVICE_CONFIGED,
|
||||
IP4_SERVICE_DESTORY,
|
||||
IP4_SERVICE_DESTORY
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -109,7 +109,7 @@ typedef struct {
|
|||
EFI_IP4_RECEIVE_DATA RxData;
|
||||
} IP4_RXDATA_WRAP;
|
||||
|
||||
typedef struct _IP4_PROTOCOL {
|
||||
struct _IP4_PROTOCOL {
|
||||
UINT32 Signature;
|
||||
|
||||
EFI_IP4_PROTOCOL Ip4Proto;
|
||||
|
@ -148,9 +148,9 @@ typedef struct _IP4_PROTOCOL {
|
|||
|
||||
EFI_IP4_CONFIG_DATA ConfigData;
|
||||
|
||||
} IP4_PROTOCOL;
|
||||
};
|
||||
|
||||
typedef struct _IP4_SERVICE {
|
||||
struct _IP4_SERVICE {
|
||||
UINT32 Signature;
|
||||
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
|
||||
INTN State;
|
||||
|
@ -200,7 +200,7 @@ typedef struct _IP4_SERVICE {
|
|||
// NIC this IP4_SERVICE works on.
|
||||
//
|
||||
CHAR16 *MacString;
|
||||
} IP4_SERVICE;
|
||||
};
|
||||
|
||||
#define IP4_INSTANCE_FROM_PROTOCOL(Ip4) \
|
||||
CR ((Ip4), IP4_PROTOCOL, Ip4Proto, IP4_PROTOCOL_SIGNATURE)
|
||||
|
|
|
@ -435,7 +435,7 @@ Ip4Reassemble (
|
|||
}
|
||||
|
||||
NewPacket->Ip = Assemble->Head;
|
||||
CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (IP4_CLIP_INFO));
|
||||
CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));
|
||||
return NewPacket;
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ Ip4AccpetFrame (
|
|||
//
|
||||
// Some OS may send IP packets without checksum.
|
||||
//
|
||||
Checksum = ~NetblockChecksum ((UINT8 *) Head, HeadLen);
|
||||
Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Head, HeadLen));
|
||||
|
||||
if ((Head->Checksum != 0) && (Checksum != 0)) {
|
||||
goto RESTART;
|
||||
|
|
|
@ -27,7 +27,7 @@ enum {
|
|||
|
||||
IP4_ASSEMLE_HASH_SIZE = 31,
|
||||
IP4_FRAGMENT_LIFE = 120,
|
||||
IP4_MAX_PACKET_SIZE = 65535,
|
||||
IP4_MAX_PACKET_SIZE = 65535
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
@ -47,9 +47,9 @@ Ip4OptionIsValid (
|
|||
UINT32 Cur;
|
||||
UINT32 Len;
|
||||
UINT32 Point;
|
||||
UINT8 IcmpType;
|
||||
UINT8 IcmpCode;
|
||||
UINT32 IcmpPoint;
|
||||
volatile UINT8 IcmpType;
|
||||
volatile UINT8 IcmpCode;
|
||||
volatile UINT32 IcmpPoint;
|
||||
|
||||
IcmpType = ICMP_PARAMETER_PROBLEM;
|
||||
IcmpCode = 0;
|
||||
|
|
|
@ -31,7 +31,7 @@ enum {
|
|||
IP4_OPTION_SSRR = 137, // Strict source and record routing, 10001001
|
||||
IP4_OPTION_RR = 7, // Record routing, 00000111
|
||||
|
||||
IP4_OPTION_COPY_MASK = 0x80,
|
||||
IP4_OPTION_COPY_MASK = 0x80
|
||||
};
|
||||
|
||||
BOOLEAN
|
||||
|
|
|
@ -89,7 +89,7 @@ Ip4PrependHead (
|
|||
PacketHead->Protocol = Head->Protocol;
|
||||
PacketHead->Src = HTONL (Head->Src);
|
||||
PacketHead->Dst = HTONL (Head->Dst);
|
||||
PacketHead->Checksum = ~NetblockChecksum ((UINT8 *) PacketHead, HeadLen);
|
||||
PacketHead->Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) PacketHead, HeadLen));
|
||||
|
||||
Packet->Ip = PacketHead;
|
||||
return EFI_SUCCESS;
|
||||
|
|
|
@ -628,7 +628,6 @@ Ip4BuildEfiRouteTable (
|
|||
IN IP4_PROTOCOL *IpInstance
|
||||
)
|
||||
{
|
||||
IP4_SERVICE *IpSb;
|
||||
NET_LIST_ENTRY *Entry;
|
||||
IP4_ROUTE_TABLE *RtTable;
|
||||
IP4_ROUTE_ENTRY *RtEntry;
|
||||
|
@ -636,7 +635,6 @@ Ip4BuildEfiRouteTable (
|
|||
UINT32 Count;
|
||||
INT32 Index;
|
||||
|
||||
IpSb = IpInstance->Service;
|
||||
RtTable = IpInstance->RouteTable;
|
||||
|
||||
if (IpInstance->EfiRouteTable != NULL) {
|
||||
|
|
|
@ -30,7 +30,7 @@ enum {
|
|||
IP4_DIRECT_ROUTE = 0x00000001,
|
||||
|
||||
IP4_ROUTE_CACHE_HASH = 31,
|
||||
IP4_ROUTE_CACHE_MAX = 64, // Max NO. of cache entry per hash bucket
|
||||
IP4_ROUTE_CACHE_MAX = 64 // Max NO. of cache entry per hash bucket
|
||||
};
|
||||
|
||||
#define IP4_ROUTE_CACHE_HASH(Dst, Src) (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH)
|
||||
|
@ -91,7 +91,7 @@ typedef struct {
|
|||
//
|
||||
typedef struct _IP4_ROUTE_TABLE IP4_ROUTE_TABLE;
|
||||
|
||||
typedef struct _IP4_ROUTE_TABLE {
|
||||
struct _IP4_ROUTE_TABLE {
|
||||
INTN RefCnt;
|
||||
UINT32 TotalNum;
|
||||
NET_LIST_ENTRY RouteArea[IP4_MASK_NUM];
|
||||
|
|
|
@ -537,12 +537,12 @@ MnpInitializeInstanceData (
|
|||
//
|
||||
// Copy the MNP Protocol interfaces from the template.
|
||||
//
|
||||
CopyMem (&Instance->ManagedNetwork, &mMnpProtocolTemplate, sizeof (EFI_MANAGED_NETWORK_PROTOCOL));
|
||||
CopyMem (&Instance->ManagedNetwork, &mMnpProtocolTemplate, sizeof (Instance->ManagedNetwork));
|
||||
|
||||
//
|
||||
// Copy the default config data.
|
||||
//
|
||||
CopyMem (&Instance->ConfigData, &mMnpDefaultConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
|
||||
CopyMem (&Instance->ConfigData, &mMnpDefaultConfigData, sizeof (Instance->ConfigData));
|
||||
|
||||
//
|
||||
// Initialize the lists.
|
||||
|
@ -1038,7 +1038,7 @@ MnpConfigureInstance (
|
|||
//
|
||||
// Save the new configuration data.
|
||||
//
|
||||
CopyMem (OldConfigData, NewConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
|
||||
CopyMem (OldConfigData, NewConfigData, sizeof (*OldConfigData));
|
||||
|
||||
Instance->Configured = (BOOLEAN) (ConfigData != NULL);
|
||||
|
||||
|
@ -1152,7 +1152,7 @@ MnpConfigReceiveFilters (
|
|||
NET_LIST_FOR_EACH (Entry, &MnpServiceData->GroupAddressList) {
|
||||
|
||||
GroupAddress = NET_LIST_USER_STRUCT (Entry, MNP_GROUP_ADDRESS, AddrEntry);
|
||||
CopyMem (MCastFilter + Index, &GroupAddress->Address, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (MCastFilter + Index, &GroupAddress->Address, sizeof (*(MCastFilter + Index)));
|
||||
Index++;
|
||||
|
||||
ASSERT (Index <= MCastFilterCnt);
|
||||
|
@ -1266,7 +1266,7 @@ MnpGroupOpAddCtrlBlk (
|
|||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
CopyMem (&GroupAddress->Address, MacAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
CopyMem (&GroupAddress->Address, MacAddress, sizeof (GroupAddress->Address));
|
||||
GroupAddress->RefCnt = 0;
|
||||
NetListInsertTail (
|
||||
&MnpServiceData->GroupAddressList,
|
||||
|
|
|
@ -747,7 +747,7 @@ MnpWrapRxData (
|
|||
//
|
||||
// Fill the RxData in RxDataWrap,
|
||||
//
|
||||
CopyMem (&RxDataWrap->RxData, RxData, sizeof (EFI_MANAGED_NETWORK_RECEIVE_DATA));
|
||||
CopyMem (&RxDataWrap->RxData, RxData, sizeof (RxDataWrap->RxData));
|
||||
|
||||
//
|
||||
// Create the recycle event.
|
||||
|
@ -827,7 +827,7 @@ MnpEnqueuePacket (
|
|||
//
|
||||
// Wrap the RxData.
|
||||
//
|
||||
CopyMem (&RxDataWrap, MnpWrapRxData (Instance, &RxData), sizeof (MNP_RXDATA_WRAP));
|
||||
RxDataWrap = MnpWrapRxData (Instance, &RxData);
|
||||
if (RxDataWrap == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ MnpGetModeData (
|
|||
//
|
||||
// Copy the instance configuration data.
|
||||
//
|
||||
CopyMem (MnpConfigData, &Instance->ConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
|
||||
CopyMem (MnpConfigData, &Instance->ConfigData, sizeof (*MnpConfigData));
|
||||
}
|
||||
|
||||
if (SnpModeData != NULL) {
|
||||
|
@ -76,7 +76,7 @@ MnpGetModeData (
|
|||
// Copy the underlayer Snp mode data.
|
||||
//
|
||||
Snp = Instance->MnpServiceData->Snp;
|
||||
CopyMem (SnpModeData, Snp->Mode, sizeof (EFI_SIMPLE_NETWORK_MODE));
|
||||
CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
|
||||
}
|
||||
|
||||
if (!Instance->Configured) {
|
||||
|
|
|
@ -34,8 +34,6 @@ EFI_SERVICE_BINDING_PROTOCOL gMtftp4ServiceBindingTemplete = {
|
|||
Mtftp4ServiceBindingDestroyChild
|
||||
};
|
||||
|
||||
//@MT: EFI_DRIVER_ENTRY_POINT (Mtftp4DriverEntryPoint)
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
Mtftp4DriverEntryPoint (
|
||||
|
@ -429,7 +427,7 @@ Mtftp4InitProtocol (
|
|||
|
||||
Instance->Signature = MTFTP4_PROTOCOL_SIGNATURE;
|
||||
NetListInit (&Instance->Link);
|
||||
CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (EFI_MTFTP4_PROTOCOL));
|
||||
CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (Instance->Mtftp4));
|
||||
Instance->State = MTFTP4_STATE_UNCONFIGED;
|
||||
Instance->Indestory = FALSE;
|
||||
Instance->Service = MtftpSb;
|
||||
|
|
|
@ -61,10 +61,10 @@ enum {
|
|||
|
||||
MTFTP4_STATE_UNCONFIGED = 0,
|
||||
MTFTP4_STATE_CONFIGED,
|
||||
MTFTP4_STATE_DESTORY,
|
||||
MTFTP4_STATE_DESTORY
|
||||
};
|
||||
|
||||
typedef struct _MTFTP4_SERVICE {
|
||||
struct _MTFTP4_SERVICE {
|
||||
UINT32 Signature;
|
||||
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
|
||||
|
||||
|
@ -92,7 +92,7 @@ typedef struct {
|
|||
EFI_STATUS Status;
|
||||
} MTFTP4_GETINFO_STATE;
|
||||
|
||||
typedef struct _MTFTP4_PROTOCOL {
|
||||
struct _MTFTP4_PROTOCOL {
|
||||
UINT32 Signature;
|
||||
NET_LIST_ENTRY Link;
|
||||
EFI_MTFTP4_PROTOCOL Mtftp4;
|
||||
|
|
|
@ -33,7 +33,7 @@ enum {
|
|||
MTFTP4_BLKSIZE_EXIST = 0x01,
|
||||
MTFTP4_TIMEOUT_EXIST = 0x02,
|
||||
MTFTP4_TSIZE_EXIST = 0x04,
|
||||
MTFTP4_MCAST_EXIST = 0x08,
|
||||
MTFTP4_MCAST_EXIST = 0x08
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -229,7 +229,7 @@ Mtftp4RemoveBlockNum (
|
|||
if (Range->End == Num) {
|
||||
Range->End--;
|
||||
} else {
|
||||
NewRange = Mtftp4AllocateRange (Num + 1, (UINT16) Range->End);
|
||||
NewRange = Mtftp4AllocateRange ((UINT16) (Num + 1), (UINT16) Range->End);
|
||||
|
||||
if (NewRange == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
|
@ -270,6 +270,8 @@ Mtftp4SendRequest (
|
|||
UINT8 *Cur;
|
||||
UINT32 Len;
|
||||
UINTN Index;
|
||||
UINT32 Len1;
|
||||
UINT32 Len2;
|
||||
|
||||
Token = Instance->Token;
|
||||
Options = Token->OptionList;
|
||||
|
@ -282,11 +284,14 @@ Mtftp4SendRequest (
|
|||
//
|
||||
// Compute the packet length
|
||||
//
|
||||
Len = (UINT32) (AsciiStrLen (Token->Filename) + AsciiStrLen (Mode) + 4);
|
||||
Len1 = (UINT32) AsciiStrLen ((CHAR8 *) Token->Filename);
|
||||
Len2 = (UINT32) AsciiStrLen ((CHAR8 *) Mode);
|
||||
Len = (Len1 + Len2 + 4);
|
||||
|
||||
for (Index = 0; Index < Token->OptionCount; Index++) {
|
||||
Len += (UINT32) (AsciiStrLen (Options[Index].OptionStr) +
|
||||
AsciiStrLen (Options[Index].ValueStr) + 2);
|
||||
Len1 = (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].OptionStr);
|
||||
Len2 = (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].ValueStr);
|
||||
Len += Len1 + Len2 + 2;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -299,12 +304,12 @@ Mtftp4SendRequest (
|
|||
Packet = (EFI_MTFTP4_PACKET *) NetbufAllocSpace (Nbuf, Len, FALSE);
|
||||
Packet->OpCode = HTONS (Instance->Operation);
|
||||
Cur = Packet->Rrq.Filename;
|
||||
Cur = AsciiStrCpy (Cur, Token->Filename);
|
||||
Cur = AsciiStrCpy (Cur, Mode);
|
||||
Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Token->Filename);
|
||||
Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Mode);
|
||||
|
||||
for (Index = 0; Index < Token->OptionCount; ++Index) {
|
||||
Cur = AsciiStrCpy (Cur, Options[Index].OptionStr);
|
||||
Cur = AsciiStrCpy (Cur, Options[Index].ValueStr);
|
||||
Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Options[Index].OptionStr);
|
||||
Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Options[Index].ValueStr);
|
||||
}
|
||||
|
||||
return Mtftp4SendPacket (Instance, Nbuf);
|
||||
|
@ -333,7 +338,7 @@ Mtftp4SendError (
|
|||
EFI_MTFTP4_PACKET *TftpError;
|
||||
UINT32 Len;
|
||||
|
||||
Len = (UINT32) (AsciiStrLen (ErrInfo) + sizeof (EFI_MTFTP4_ERROR_HEADER));
|
||||
Len = (UINT32) (AsciiStrLen ((CHAR8 *) ErrInfo) + sizeof (EFI_MTFTP4_ERROR_HEADER));
|
||||
Packet = NetbufAlloc (Len);
|
||||
|
||||
if (Packet == NULL) {
|
||||
|
@ -344,7 +349,7 @@ Mtftp4SendError (
|
|||
TftpError->OpCode = HTONS (EFI_MTFTP4_OPCODE_ERROR);
|
||||
TftpError->Error.ErrorCode = HTONS (ErrCode);
|
||||
|
||||
AsciiStrCpy (TftpError->Error.ErrorMessage, ErrInfo);
|
||||
AsciiStrCpy ((CHAR8 *) TftpError->Error.ErrorMessage, (CHAR8 *) ErrInfo);
|
||||
|
||||
return Mtftp4SendPacket (Instance, Packet);
|
||||
}
|
||||
|
@ -419,6 +424,7 @@ Mtftp4SendPacket (
|
|||
UDP_POINTS UdpPoint;
|
||||
EFI_STATUS Status;
|
||||
UINT16 OpCode;
|
||||
UINT16 Value;
|
||||
|
||||
//
|
||||
// Save the packet for retransmission
|
||||
|
@ -440,7 +446,8 @@ Mtftp4SendPacket (
|
|||
// Send the requests to the listening port, other packets
|
||||
// to the connected port
|
||||
//
|
||||
OpCode = NTOHS (*((UINT16 *) NetbufGetByte (Packet, 0, NULL)));
|
||||
Value = *((UINT16 *) NetbufGetByte (Packet, 0, NULL));
|
||||
OpCode = NTOHS (Value);
|
||||
|
||||
if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||
|
||||
(OpCode == EFI_MTFTP4_OPCODE_WRQ)) {
|
||||
|
@ -485,6 +492,7 @@ Mtftp4Retransmit (
|
|||
UDP_POINTS UdpPoint;
|
||||
EFI_STATUS Status;
|
||||
UINT16 OpCode;
|
||||
UINT16 Value;
|
||||
|
||||
ASSERT (Instance->LastPacket != NULL);
|
||||
|
||||
|
@ -495,7 +503,8 @@ Mtftp4Retransmit (
|
|||
//
|
||||
// Set the requests to the listening port, other packets to the connected port
|
||||
//
|
||||
OpCode = NTOHS (*(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL));
|
||||
Value = *(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL);
|
||||
OpCode = NTOHS (Value);
|
||||
|
||||
if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||
|
||||
(OpCode == EFI_MTFTP4_OPCODE_WRQ)) {
|
||||
|
|
|
@ -139,7 +139,7 @@ Mtftp4WrqSendBlock (
|
|||
// Get data from PacketNeeded
|
||||
//
|
||||
DataBuf = NULL;
|
||||
Status = Token->PacketNeeded (&Instance->Mtftp4, Token, &DataLen, &DataBuf);
|
||||
Status = Token->PacketNeeded (&Instance->Mtftp4, Token, &DataLen, (VOID **) &DataBuf);
|
||||
|
||||
if (EFI_ERROR (Status) || (DataLen > Instance->BlkSize)) {
|
||||
if (DataBuf != NULL) {
|
||||
|
|
|
@ -291,8 +291,12 @@ IpChecksum2 (
|
|||
)
|
||||
{
|
||||
UINT32 Sum;
|
||||
UINT16 HeaderChecksum;
|
||||
UINT16 MessageChecksum;
|
||||
|
||||
Sum = (UINT16)~IpChecksum (Header, HeaderLen) + (UINT16)~IpChecksum (Message, MessageLen);
|
||||
HeaderChecksum = (UINT16)~IpChecksum (Header, HeaderLen);
|
||||
MessageChecksum = (UINT16)~IpChecksum (Message, MessageLen);
|
||||
Sum = HeaderChecksum + MessageChecksum;
|
||||
|
||||
//
|
||||
// in case above carried
|
||||
|
@ -1350,7 +1354,7 @@ BcStart (
|
|||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
BUFFER_ALLOCATE_SIZE,
|
||||
&Private->TransmitBufferPtr
|
||||
(VOID **) &Private->TransmitBufferPtr
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
@ -1364,7 +1368,7 @@ BcStart (
|
|||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
BUFFER_ALLOCATE_SIZE,
|
||||
&Private->ReceiveBufferPtr
|
||||
(VOID **) &Private->ReceiveBufferPtr
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
@ -1379,7 +1383,7 @@ BcStart (
|
|||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
256,
|
||||
&Private->TftpErrorBuffer
|
||||
(VOID **) &Private->TftpErrorBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
@ -1389,7 +1393,7 @@ BcStart (
|
|||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (EfiBootServicesData, 256, &Private->TftpAckBuffer);
|
||||
Status = gBS->AllocatePool (EfiBootServicesData, 256, (VOID **) &Private->TftpAckBuffer);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
gBS->FreePool (Private->TftpErrorBuffer);
|
||||
|
@ -1473,7 +1477,6 @@ BcStop (
|
|||
//
|
||||
// Lock the instance data
|
||||
//
|
||||
EFI_PXE_BASE_CODE_MODE *PxebcMode;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *SnpPtr;
|
||||
EFI_SIMPLE_NETWORK_MODE *SnpModePtr;
|
||||
EFI_STATUS StatCode;
|
||||
|
@ -1495,7 +1498,6 @@ BcStop (
|
|||
|
||||
EfiAcquireLock (&Private->Lock);
|
||||
|
||||
PxebcMode = Private->EfiBc.Mode;
|
||||
SnpPtr = Private->SimpleNetwork;
|
||||
SnpModePtr = SnpPtr->Mode;
|
||||
|
||||
|
@ -1875,7 +1877,7 @@ BcSetParameters (
|
|||
|
||||
if (SendGuidPtr != NULL) {
|
||||
if (*SendGuidPtr) {
|
||||
if (PxeBcLibGetSmbiosSystemGuidAndSerialNumber (&TmpGuid, &SerialNumberPtr) != EFI_SUCCESS) {
|
||||
if (PxeBcLibGetSmbiosSystemGuidAndSerialNumber (&TmpGuid, (CHAR8 **) &SerialNumberPtr) != EFI_SUCCESS) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
@ -2395,7 +2397,7 @@ InitializeBCDriver (
|
|||
InitArpHeader ();
|
||||
OptionsStrucInit ();
|
||||
|
||||
return EFI_SUCCESS;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* eof - bc.c */
|
||||
|
|
|
@ -338,7 +338,7 @@ SendRequest (
|
|||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
SnpMode->MediaHeaderSize + sizeof (ARP_PACKET),
|
||||
&Private->ArpBuffer
|
||||
(VOID **) &Private->ArpBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
|
|
@ -214,7 +214,7 @@ OptionsStrucInit (
|
|||
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMajor, "yyy", sizeof ("yyy"));
|
||||
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMinor, "xxx", sizeof ("xxx"));
|
||||
DHCPOpStart.End[0] = OP_END;
|
||||
};
|
||||
}
|
||||
|
||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
@ -883,7 +883,7 @@ Parse (
|
|||
} else if (!RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1] && RxBufPtr->u.Dhcpv4.file[0]) {
|
||||
RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1] = (DHCPV4_OP_STRUCT *) (RxBufPtr->u.Dhcpv4.file - sizeof (DHCPV4_OP_HEADER));
|
||||
|
||||
RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1]->Header.Length = (UINT8) AsciiStrLen (RxBufPtr->u.Dhcpv4.file);
|
||||
RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1]->Header.Length = (UINT8) AsciiStrLen ((CHAR8 *) RxBufPtr->u.Dhcpv4.file);
|
||||
}
|
||||
|
||||
LocalPtr.OpPtr = RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_CLASS_IDENTIFIER_IX - 1];
|
||||
|
@ -3169,13 +3169,11 @@ BcSetPackets (
|
|||
{
|
||||
EFI_PXE_BASE_CODE_MODE *PxebcMode;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS StatCode;
|
||||
PXE_BASECODE_DEVICE *Private;
|
||||
|
||||
//
|
||||
// Lock the instance data and make sure started
|
||||
//
|
||||
StatCode = EFI_SUCCESS;
|
||||
|
||||
if (This == NULL) {
|
||||
DEBUG ((DEBUG_ERROR, "BC *This pointer == NULL"));
|
||||
|
|
|
@ -555,7 +555,7 @@ TftpRwReq (
|
|||
//
|
||||
u = Buffer;
|
||||
u->ReqStr.OpCode = HTONS (Req);
|
||||
TotalLen = sizeof (Mode) + sizeof (u->ReqStr.OpCode) + (Len = 1 + AsciiStrLen (FilenamePtr));
|
||||
TotalLen = sizeof (Mode) + sizeof (u->ReqStr.OpCode) + (Len = 1 + AsciiStrLen ((CHAR8 *) FilenamePtr));
|
||||
|
||||
CopyMem (u->ReqStr.FileName, FilenamePtr, Len);
|
||||
Ptr = (UINT8 *) (u->ReqStr.FileName + Len);
|
||||
|
@ -567,7 +567,7 @@ TftpRwReq (
|
|||
CopyMem (Ptr, BlockSizeOp, sizeof (BlockSizeOp));
|
||||
UtoA10 (*PacketSizePtr, Ptr + sizeof (BlockSizeOp));
|
||||
|
||||
TotalLen += (Len = 1 + AsciiStrLen (Ptr + sizeof (BlockSizeOp)) + sizeof (BlockSizeOp));
|
||||
TotalLen += (Len = 1 + AsciiStrLen ((CHAR8 *) (Ptr + sizeof (BlockSizeOp))) + sizeof (BlockSizeOp));
|
||||
|
||||
Ptr += Len;
|
||||
}
|
||||
|
@ -1387,7 +1387,7 @@ TftpInfo (
|
|||
(UINT16) ReplyLen,
|
||||
BufferSizePtr,
|
||||
Offset,
|
||||
(INT8 *) &u,
|
||||
(UINT8 *) &u,
|
||||
ServerIpPtr,
|
||||
&ServerReplyPort,
|
||||
&Private->EfiBc.Mode->StationIp,
|
||||
|
@ -1899,7 +1899,7 @@ PxeBcMtftp (
|
|||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
BUFFER_ALLOCATE_SIZE,
|
||||
&BufferPtrLocal
|
||||
(VOID **) &BufferPtrLocal
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || BufferPtrLocal == NULL) {
|
||||
|
|
|
@ -374,7 +374,6 @@ DoPrompt (
|
|||
if (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key) == EFI_NOT_READY) {
|
||||
UINT8 Buffer[512];
|
||||
UINTN BufferSize;
|
||||
EFI_STATUS Status;
|
||||
|
||||
BufferSize = sizeof Buffer;
|
||||
|
||||
|
@ -1036,7 +1035,6 @@ DownloadFile (
|
|||
|
||||
if (Private->EfiBc.Mode->BisSupported && Private->EfiBc.Mode->BisDetected && Private->EfiBc.Mode->PxeBisReplyReceived) {
|
||||
UINT64 CredentialLen;
|
||||
UINTN BlockSize;
|
||||
UINT8 CredentialFilename[256];
|
||||
UINT8 *op;
|
||||
VOID *CredentialBuffer;
|
||||
|
@ -1327,6 +1325,12 @@ LoadFile (
|
|||
BOOLEAN NewMakeCallback;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS TempStatus;
|
||||
|
||||
//
|
||||
// The following line is only used for passing ICC build.
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "FilePath = %x\n", FilePath));
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
|
|
@ -358,7 +358,7 @@ Tcp4ConfigurePcb (
|
|||
//
|
||||
// Add Ip for send pkt to the peer
|
||||
//
|
||||
CopyMem (&IpCfgData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (&IpCfgData, &mIpIoDefaultIpConfigData, sizeof (IpCfgData));
|
||||
IpCfgData.DefaultProtocol = EFI_IP_PROTO_TCP;
|
||||
IpCfgData.UseDefaultAddress = CfgData->AccessPoint.UseDefaultAddress;
|
||||
IpCfgData.StationAddress = CfgData->AccessPoint.StationAddress;
|
||||
|
|
|
@ -305,7 +305,7 @@ Tcp4DriverBindingStart (
|
|||
//
|
||||
NetZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA));
|
||||
|
||||
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData));
|
||||
OpenData.IpConfigData.DefaultProtocol = EFI_IP_PROTO_TCP;
|
||||
|
||||
OpenData.PktRcvdNotify = Tcp4RxCallback;
|
||||
|
|
|
@ -145,6 +145,7 @@ Tcp4Configure (
|
|||
SOCKET *Sock;
|
||||
EFI_STATUS Status;
|
||||
IP4_ADDR Ip;
|
||||
IP4_ADDR SubnetMask;
|
||||
|
||||
if (NULL == This) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
@ -168,7 +169,8 @@ Tcp4Configure (
|
|||
if (!TcpConfigData->AccessPoint.UseDefaultAddress) {
|
||||
|
||||
NetCopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
|
||||
if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (Ip))) {
|
||||
NetCopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
|
||||
if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (SubnetMask))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,7 +517,7 @@ Returns:
|
|||
//
|
||||
// Initialize the UDP random port.
|
||||
//
|
||||
mUdp4RandomPort = ((UINT16) NetRandomInitSeed ()) % UDP4_PORT_KNOWN + UDP4_PORT_KNOWN;
|
||||
mUdp4RandomPort = (UINT16) (((UINT16) NetRandomInitSeed ()) % UDP4_PORT_KNOWN + UDP4_PORT_KNOWN);
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
|
|
@ -172,7 +172,7 @@ Udp4CreateService (
|
|||
//
|
||||
// Set the OpenData used to open the IpIo.
|
||||
//
|
||||
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData));
|
||||
OpenData.IpConfigData.AcceptBroadcast = TRUE;
|
||||
OpenData.RcvdContext = (VOID *) Udp4Service;
|
||||
OpenData.SndContext = NULL;
|
||||
|
@ -359,7 +359,7 @@ Udp4InitInstance (
|
|||
// Save the pointer to the UDP4_SERVICE_DATA, and initialize other members.
|
||||
//
|
||||
Instance->Udp4Service = Udp4Service;
|
||||
CopyMem (&Instance->Udp4Proto, &mUdp4Protocol, sizeof (EFI_UDP4_PROTOCOL));
|
||||
CopyMem (&Instance->Udp4Proto, &mUdp4Protocol, sizeof (Instance->Udp4Proto));
|
||||
Instance->IcmpError = EFI_SUCCESS;
|
||||
Instance->Configured = FALSE;
|
||||
Instance->IsNoMapping = FALSE;
|
||||
|
@ -612,7 +612,7 @@ Udp4BuildIp4ConfigData (
|
|||
IN EFI_IP4_CONFIG_DATA *Ip4ConfigData
|
||||
)
|
||||
{
|
||||
CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (*Ip4ConfigData));
|
||||
|
||||
Ip4ConfigData->DefaultProtocol = EFI_IP_PROTO_UDP;
|
||||
Ip4ConfigData->AcceptBroadcast = Udp4ConfigData->AcceptBroadcast;
|
||||
|
@ -817,7 +817,7 @@ Udp4Checksum (
|
|||
|
||||
Checksum = NetAddChecksum (Checksum, HTONS ((UINT16) Packet->TotalSize));
|
||||
|
||||
return ~Checksum;
|
||||
return (UINT16) ~Checksum;
|
||||
}
|
||||
|
||||
|
||||
|
@ -964,7 +964,7 @@ Udp4LeaveGroup (
|
|||
|
||||
if ((McastIp != NULL) && (!EFI_IP4_EQUAL (*McastIp, (UINTN) Item->Key))) {
|
||||
//
|
||||
// McastIp is not NULL and the multicast address contained in the Item
|
||||
// McastIp is not NULL and the multicast address contained in the Item
|
||||
// is not the same as McastIp.
|
||||
//
|
||||
return EFI_SUCCESS;
|
||||
|
@ -1284,7 +1284,7 @@ Udp4WrapRxData (
|
|||
|
||||
NetListInit (&Wrap->Link);
|
||||
|
||||
CopyMem (&Wrap->RxData, RxData, sizeof (EFI_UDP4_RECEIVE_DATA));
|
||||
CopyMem (&Wrap->RxData, RxData, sizeof (Wrap->RxData));
|
||||
|
||||
//
|
||||
// Create the Recycle event.
|
||||
|
@ -1349,7 +1349,7 @@ Udp4EnqueueDgram (
|
|||
//
|
||||
// Wrap the RxData and put this Wrap into the instances RcvdDgramQue.
|
||||
//
|
||||
CopyMem (&Wrap, Udp4WrapRxData (Instance, Packet, RxData), sizeof (UDP4_RXDATA_WRAP));
|
||||
CopyMem (&Wrap, Udp4WrapRxData (Instance, Packet, RxData), sizeof (Wrap));
|
||||
if (Wrap == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1636,7 +1636,7 @@ Udp4SendPortUnreach (
|
|||
//
|
||||
// Calculate the checksum.
|
||||
//
|
||||
IcmpErrHdr->Head.Checksum = ~(NetbufChecksum (Packet));
|
||||
IcmpErrHdr->Head.Checksum = (UINT16) ~(NetbufChecksum (Packet));
|
||||
|
||||
//
|
||||
// Fill the override data.
|
||||
|
|
|
@ -86,7 +86,7 @@ Udp4GetModeData (
|
|||
//
|
||||
// Set the Udp4ConfigData.
|
||||
//
|
||||
CopyMem (Udp4ConfigData, &Instance->ConfigData, sizeof (EFI_UDP4_CONFIG_DATA));
|
||||
CopyMem (Udp4ConfigData, &Instance->ConfigData, sizeof (*Udp4ConfigData));
|
||||
}
|
||||
|
||||
Ip = Instance->IpInfo->Ip;
|
||||
|
@ -239,7 +239,7 @@ Udp4Configure (
|
|||
//
|
||||
// Save the configuration data.
|
||||
//
|
||||
CopyMem (&Instance->ConfigData, UdpConfigData, sizeof (EFI_UDP4_CONFIG_DATA));
|
||||
CopyMem (&Instance->ConfigData, UdpConfigData, sizeof (Instance->ConfigData));
|
||||
Instance->ConfigData.StationAddress = Ip4ConfigData.StationAddress;
|
||||
Instance->ConfigData.SubnetMask = Ip4ConfigData.SubnetMask;
|
||||
|
||||
|
@ -351,7 +351,7 @@ Udp4Groups (
|
|||
if (JoinFlag) {
|
||||
NetCopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));
|
||||
|
||||
if (IP4_IS_MULTICAST (NTOHL (McastIp))) {
|
||||
if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue