diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-02-14 09:40:22 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-02-14 09:40:22 +0000 |
commit | e48e37fce2611df7a52aff271835ff72ee396d9b (patch) | |
tree | f6427ba11251479c615da9b5a3e38aa8c7b0f943 /MdeModulePkg/Universal/Network/UefiPxeBcDxe | |
parent | bb8ffffd1c0ff0ee697c26d377fd9767097cc02b (diff) | |
download | edk2-platforms-e48e37fce2611df7a52aff271835ff72ee396d9b.tar.xz |
Use Mde library and definition instead of some native definitions in NetLib, to simply network library.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4693 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/UefiPxeBcDxe')
4 files changed, 77 insertions, 90 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index b76461a70d..ee17ea358d 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -62,11 +62,11 @@ PxeBcInitSeedPacket ( Header = &Seed->Dhcp4.Header;
- NetZeroMem (Header, sizeof (EFI_DHCP4_HEADER));
+ ZeroMem (Header, sizeof (EFI_DHCP4_HEADER));
Header->OpCode = PXEBC_DHCP4_OPCODE_REQUEST;
Header->HwType = Mode.IfType;
Header->HwAddrLen = (UINT8) Mode.HwAddressSize;
- NetCopyMem (Header->ClientHwAddr, &Mode.CurrentAddress, Header->HwAddrLen);
+ CopyMem (Header->ClientHwAddr, &Mode.CurrentAddress, Header->HwAddrLen);
Seed->Dhcp4.Magik = PXEBC_DHCP4_MAGIC;
Seed->Dhcp4.Option[0] = PXEBC_DHCP4_TAG_EOP;
@@ -90,7 +90,7 @@ PxeBcCopyEfiDhcp4Packet ( {
ASSERT (Dst->Size >= Src->Length);
- NetCopyMem (&Dst->Dhcp4, &Src->Dhcp4, Src->Length);
+ CopyMem (&Dst->Dhcp4, &Src->Dhcp4, Src->Length);
Dst->Length = Src->Length;
}
@@ -119,7 +119,7 @@ PxeBcCopyProxyOffer ( Offer = &Private->Dhcp4Offers[OfferIndex].Packet.Offer;
PxeBcCopyEfiDhcp4Packet (&Private->ProxyOffer.Packet.Offer, Offer);
- NetCopyMem (&Mode->ProxyOffer, &Offer->Dhcp4, Offer->Length);
+ CopyMem (&Mode->ProxyOffer, &Offer->Dhcp4, Offer->Length);
Mode->ProxyOfferReceived = TRUE;
PxeBcParseCachedDhcpPacket (&Private->ProxyOffer);
@@ -147,8 +147,8 @@ PxeBcParseCachedDhcpPacket ( UINTN Index;
CachedPacket->IsPxeOffer = FALSE;
- NetZeroMem (CachedPacket->Dhcp4Option, sizeof (CachedPacket->Dhcp4Option));
- NetZeroMem (&CachedPacket->PxeVendorOption, sizeof (CachedPacket->PxeVendorOption));
+ ZeroMem (CachedPacket->Dhcp4Option, sizeof (CachedPacket->Dhcp4Option));
+ ZeroMem (&CachedPacket->PxeVendorOption, sizeof (CachedPacket->PxeVendorOption));
Offer = &CachedPacket->Packet.Offer;
Options = CachedPacket->Dhcp4Option;
@@ -169,7 +169,7 @@ PxeBcParseCachedDhcpPacket ( //
Option = Options[PXEBC_DHCP4_TAG_INDEX_CLASS_ID];
if ((Option != NULL) && (Option->Length >= 9) &&
- (NetCompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) {
+ (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) {
CachedPacket->IsPxeOffer = TRUE;
}
@@ -241,19 +241,6 @@ PxeBcParseCachedDhcpPacket ( // return false since mtftp not supported currently.
//
return FALSE;
-#if 0
- //
- // WFM11A, make sure bootfile is present
- //
- if (CachedPacket->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) {
- //
- // Discard this offer.
- //
- return ;
- }
-
- OfferType = DHCP4_PACKET_TYPE_WFM11A;
-#endif
} else {
//
// If the binl offer with only PXEClient.
@@ -296,7 +283,7 @@ PxeBcTryBinl ( //
// next server ip address is zero, use server id option instead.
//
- NetCopyMem (
+ CopyMem (
&ServerIp.Addr[0],
Private->Dhcp4Offers[Index].Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
sizeof (EFI_IPv4_ADDRESS)
@@ -305,7 +292,7 @@ PxeBcTryBinl ( //
// use next server ip address.
//
- NetCopyMem (&ServerIp.Addr[0], &Offer->Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ServerIp.Addr[0], &Offer->Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
}
CachedPacket = &Private->ProxyOffer;
@@ -340,7 +327,7 @@ PxeBcTryBinl ( }
Private->PxeBc.Mode->ProxyOfferReceived = TRUE;
- NetCopyMem (&Private->PxeBc.Mode->ProxyOffer, &Reply->Dhcp4, Reply->Length);
+ CopyMem (&Private->PxeBc.Mode->ProxyOffer, &Reply->Dhcp4, Reply->Length);
return TRUE;
}
@@ -511,7 +498,7 @@ PxeBcCheckSelectedOffer ( //
// Copy the dhcp ack.
//
- NetCopyMem (&Mode->DhcpAck, &Ack->Dhcp4, Ack->Length);
+ CopyMem (&Mode->DhcpAck, &Ack->Dhcp4, Ack->Length);
}
return Status;
@@ -789,7 +776,7 @@ PxeBcDhcpCallBack ( );
if (MaxMsgSize != NULL) {
Value = HTONS (PXEBC_DHCP4_MAX_PACKET_SIZE);
- NetCopyMem (MaxMsgSize->Data, &Value, sizeof (Value));
+ CopyMem (MaxMsgSize->Data, &Value, sizeof (Value));
}
if ((Dhcp4Event != Dhcp4SelectOffer) && (Callback != NULL)) {
@@ -814,7 +801,7 @@ PxeBcDhcpCallBack ( //
// Cache the dhcp discover packet, of which some information will be used later.
//
- NetCopyMem (Mode->DhcpDiscover.Raw, &Packet->Dhcp4, Packet->Length);
+ CopyMem (Mode->DhcpDiscover.Raw, &Packet->Dhcp4, Packet->Length);
break;
@@ -901,7 +888,7 @@ PxeBcBuildDhcpOptions ( OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE);
OptEnt.MaxMesgSize = (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE *) OptList[Index]->Data;
Value = NTOHS (PXEBC_DHCP4_MAX_PACKET_SIZE);
- NetCopyMem (&OptEnt.MaxMesgSize->Size, &Value, sizeof (UINT16));
+ CopyMem (&OptEnt.MaxMesgSize->Size, &Value, sizeof (UINT16));
Index++;
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);
}
@@ -988,7 +975,7 @@ PxeBcBuildDhcpOptions ( OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_ARCH);
OptEnt.Arch = (PXEBC_DHCP4_OPTION_ARCH *) OptList[Index]->Data;
Value = HTONS (SYS_ARCH);
- NetCopyMem (&OptEnt.Arch->Type, &Value, sizeof (UINT16));
+ CopyMem (&OptEnt.Arch->Type, &Value, sizeof (UINT16));
Index++;
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);
@@ -998,9 +985,9 @@ PxeBcBuildDhcpOptions ( OptList[Index]->OpCode = PXEBC_DHCP4_TAG_CLASS_ID;
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_CLID);
OptEnt.Clid = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;
- NetCopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));
+ CopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));
CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));
- NetCopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));
+ CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));
CvtNum (Private->Nii->MajorVer, OptEnt.Clid->UndiMajor, sizeof (OptEnt.Clid->UndiMajor));
CvtNum (Private->Nii->MinorVer, OptEnt.Clid->UndiMinor, sizeof (OptEnt.Clid->UndiMinor));
Index++;
@@ -1080,7 +1067,7 @@ PxeBcDiscvBootService ( // Add vendor option of PXE_BOOT_ITEM
//
VendorOptLen = (sizeof (EFI_DHCP4_PACKET_OPTION) - 1) * 2 + sizeof (PXEBC_OPTION_BOOT_ITEM) + 1;
- OptList[OptCount] = NetAllocatePool (VendorOptLen);
+ OptList[OptCount] = AllocatePool (VendorOptLen);
if (OptList[OptCount] == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1101,7 +1088,7 @@ PxeBcDiscvBootService ( Status = Dhcp4->Build (Dhcp4, &Private->SeedPacket, 0, NULL, OptCount, OptList, &Token.Packet);
if (IsDiscv) {
- NetFreePool (OptList[OptCount - 1]);
+ gBS->FreePool (OptList[OptCount - 1]);
}
if (EFI_ERROR (Status)) {
@@ -1110,24 +1097,24 @@ PxeBcDiscvBootService ( Token.Packet->Dhcp4.Header.Xid = NET_RANDOM (NetRandomInitSeed ());
Token.Packet->Dhcp4.Header.Reserved = (UINT16) ((IsBCast) ? 0xf000 : 0x0);
- NetCopyMem (&Token.Packet->Dhcp4.Header.ClientAddr, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token.Packet->Dhcp4.Header.ClientAddr, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
Token.RemotePort = Sport;
if (DestIp == NULL) {
- NetSetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);
+ SetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);
} else {
- NetCopyMem (&Token.RemoteAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token.RemoteAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
}
- NetCopyMem (&Token.GatewayAddress, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token.GatewayAddress, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
if (!IsBCast) {
Token.ListenPointCount = 1;
Token.ListenPoints = &ListenPoint;
Token.ListenPoints[0].ListenPort = PXEBC_BS_DISCOVER_PORT;
- NetCopyMem (&Token.ListenPoints[0].ListenAddress, &Private->StationIp, sizeof(EFI_IPv4_ADDRESS));
- NetCopyMem (&Token.ListenPoints[0].SubnetMask, &Private->SubnetMask, sizeof(EFI_IPv4_ADDRESS));
+ CopyMem (&Token.ListenPoints[0].ListenAddress, &Private->StationIp, sizeof(EFI_IPv4_ADDRESS));
+ CopyMem (&Token.ListenPoints[0].SubnetMask, &Private->SubnetMask, sizeof(EFI_IPv4_ADDRESS));
}
//
// Send Pxe Discover
@@ -1183,10 +1170,10 @@ PxeBcDiscvBootService ( }
if (IsDiscv) {
- NetCopyMem (&(Mode->PxeDiscover), &(Token.Packet->Dhcp4), Token.Packet->Length);
+ CopyMem (&(Mode->PxeDiscover), &(Token.Packet->Dhcp4), Token.Packet->Length);
Mode->PxeDiscoverValid = TRUE;
- NetCopyMem (Mode->PxeReply.Raw, &Response->Dhcp4, Response->Length);
+ CopyMem (Mode->PxeReply.Raw, &Response->Dhcp4, Response->Length);
Mode->PxeReplyReceived = TRUE;
}
} else {
@@ -1196,12 +1183,12 @@ PxeBcDiscvBootService ( //
// free the responselist
//
- NetFreePool (Token.ResponseList);
+ gBS->FreePool (Token.ResponseList);
}
//
// Free the dhcp packet
//
- NetFreePool (Token.Packet);
+ gBS->FreePool (Token.Packet);
return Status;
}
@@ -1284,17 +1271,17 @@ PxeBcParseVendorOptions ( case PXEBC_VENDOR_TAG_MTFTP_IP:
- NetCopyMem (&VendorOption->MtftpIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&VendorOption->MtftpIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
break;
case PXEBC_VENDOR_TAG_MTFTP_CPORT:
- NetCopyMem (&VendorOption->MtftpCPort, PxeOption->Data, sizeof (VendorOption->MtftpCPort));
+ CopyMem (&VendorOption->MtftpCPort, PxeOption->Data, sizeof (VendorOption->MtftpCPort));
break;
case PXEBC_VENDOR_TAG_MTFTP_SPORT:
- NetCopyMem (&VendorOption->MtftpSPort, PxeOption->Data, sizeof (VendorOption->MtftpSPort));
+ CopyMem (&VendorOption->MtftpSPort, PxeOption->Data, sizeof (VendorOption->MtftpSPort));
break;
case PXEBC_VENDOR_TAG_MTFTP_TIMEOUT:
@@ -1314,7 +1301,7 @@ PxeBcParseVendorOptions ( case PXEBC_VENDOR_TAG_DISCOVER_MCAST:
- NetCopyMem (&VendorOption->DiscoverMcastIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&VendorOption->DiscoverMcastIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
break;
case PXEBC_VENDOR_TAG_BOOT_SERVERS:
@@ -1337,9 +1324,9 @@ PxeBcParseVendorOptions ( case PXEBC_VENDOR_TAG_MCAST_ALLOC:
- NetCopyMem (&VendorOption->McastIpBase, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&VendorOption->McastIpBlock, PxeOption->Data + 4, sizeof (VendorOption->McastIpBlock));
- NetCopyMem (&VendorOption->McastIpRange, PxeOption->Data + 6, sizeof (VendorOption->McastIpRange));
+ CopyMem (&VendorOption->McastIpBase, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&VendorOption->McastIpBlock, PxeOption->Data + 4, sizeof (VendorOption->McastIpBlock));
+ CopyMem (&VendorOption->McastIpRange, PxeOption->Data + 6, sizeof (VendorOption->McastIpRange));
break;
case PXEBC_VENDOR_TAG_CREDENTIAL_TYPES:
@@ -1350,8 +1337,8 @@ PxeBcParseVendorOptions ( case PXEBC_VENDOR_TAG_BOOT_ITEM:
- NetCopyMem (&VendorOption->BootSrvType, PxeOption->Data, sizeof (VendorOption->BootSrvType));
- NetCopyMem (&VendorOption->BootSrvLayer, PxeOption->Data + 2, sizeof (VendorOption->BootSrvLayer));
+ CopyMem (&VendorOption->BootSrvType, PxeOption->Data, sizeof (VendorOption->BootSrvType));
+ CopyMem (&VendorOption->BootSrvLayer, PxeOption->Data + 2, sizeof (VendorOption->BootSrvLayer));
break;
}
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c index b947340abc..d6907955a5 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c @@ -141,7 +141,7 @@ PxeBcDriverBindingStart ( UINTN Index;
EFI_STATUS Status;
- Private = NetAllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA));
+ Private = AllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA));
if (Private == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -246,7 +246,7 @@ PxeBcDriverBindingStart ( goto ON_ERROR;
}
- NetZeroMem (&Private->Udp4CfgData, sizeof (EFI_UDP4_CONFIG_DATA));
+ ZeroMem (&Private->Udp4CfgData, sizeof (EFI_UDP4_CONFIG_DATA));
Private->Udp4CfgData.AcceptBroadcast = TRUE;
Private->Udp4CfgData.AcceptPromiscuous = FALSE;
Private->Udp4CfgData.AcceptAnyPort = FALSE;
@@ -322,7 +322,7 @@ ON_ERROR: );
}
- NetFreePool (Private);
+ gBS->FreePool (Private);
return Status;
}
@@ -433,7 +433,7 @@ PxeBcDriverBindingStop ( Private->Mtftp4Child
);
- NetFreePool (Private);
+ gBS->FreePool (Private);
}
return Status;
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 8d7b3d03ef..85542f2b2e 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -193,7 +193,7 @@ EfiPxeBcDhcp ( //
// Set the DHCP4 config data.
//
- NetZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
+ ZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
Dhcp4CfgData.OptionCount = OptCount;
Dhcp4CfgData.OptionList = OptList;
Dhcp4CfgData.Dhcp4Callback = PxeBcDhcpCallBack;
@@ -216,8 +216,8 @@ EfiPxeBcDhcp ( //
Private->NumOffers = 0;
Private->BootpIndex = 0;
- NetZeroMem (Private->ServerCount, sizeof (Private->ServerCount));
- NetZeroMem (Private->ProxyIndex, sizeof (Private->ProxyIndex));
+ ZeroMem (Private->ServerCount, sizeof (Private->ServerCount));
+ ZeroMem (Private->ProxyIndex, sizeof (Private->ProxyIndex));
Status = Dhcp4->Start (Dhcp4, NULL);
if (EFI_ERROR (Status)) {
@@ -241,9 +241,9 @@ EfiPxeBcDhcp ( ASSERT (Dhcp4Mode.State == Dhcp4Bound);
- NetCopyMem (&Private->StationIp, &Dhcp4Mode.ClientAddress, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Private->SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Private->GatewayIp, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->StationIp, &Dhcp4Mode.ClientAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->GatewayIp, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
//
// Check the selected offer to see whether BINL is required, if no or BINL is
@@ -262,7 +262,7 @@ EfiPxeBcDhcp ( //
// Remove the previously configured option list and callback function
//
- NetZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
+ ZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
Dhcp4->Configure (Dhcp4, &Dhcp4CfgData);
Private->AddressIsOk = TRUE;
@@ -385,7 +385,7 @@ EfiPxeBcDiscover ( //
// Get the multicast discover ip address from vendor option.
//
- NetCopyMem (&DefaultInfo.ServerMCastIp.Addr, &VendorOpt->DiscoverMcastIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&DefaultInfo.ServerMCastIp.Addr, &VendorOpt->DiscoverMcastIp, sizeof (EFI_IPv4_ADDRESS));
}
DefaultInfo.IpCnt = 0;
@@ -444,7 +444,7 @@ EfiPxeBcDiscover ( if (BootSvrEntry == NULL) {
Private->ServerIp.Addr[0] = SrvList[Index].IpAddr.Addr[0];
} else {
- NetCopyMem (&Private->ServerIp, &BootSvrEntry->IpAddr[Index], sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->ServerIp, &BootSvrEntry->IpAddr[Index], sizeof (EFI_IPv4_ADDRESS));
}
Status = PxeBcDiscvBootService (
@@ -497,7 +497,7 @@ EfiPxeBcDiscover ( }
if (Mode->PxeBisReplyReceived) {
- NetCopyMem (&Private->ServerIp, &Mode->PxeReply.Dhcpv4.BootpSiAddr, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->ServerIp, &Mode->PxeReply.Dhcpv4.BootpSiAddr, sizeof (EFI_IPv4_ADDRESS));
}
return Status;
@@ -568,10 +568,10 @@ EfiPxeBcMtftp ( Mtftp4Config.TimeoutValue = PXEBC_MTFTP_TIMEOUT;
Mtftp4Config.TryCount = PXEBC_MTFTP_RETRIES;
- NetCopyMem (&Mtftp4Config.StationIp, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Mtftp4Config.SubnetMask, &Private->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Mtftp4Config.GatewayIp, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Mtftp4Config.ServerIp, ServerIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.StationIp, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.SubnetMask, &Private->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.GatewayIp, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.ServerIp, ServerIp, sizeof (EFI_IPv4_ADDRESS));
switch (Operation) {
@@ -769,13 +769,13 @@ EfiPxeBcUdpWrite ( ZeroMem (&Token, sizeof (EFI_UDP4_COMPLETION_TOKEN));
ZeroMem (&Udp4Session, sizeof (EFI_UDP4_SESSION_DATA));
- NetCopyMem (&Udp4Session.DestinationAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.DestinationAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
Udp4Session.DestinationPort = *DestPort;
- NetCopyMem (&Udp4Session.SourceAddress, SrcIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.SourceAddress, SrcIp, sizeof (EFI_IPv4_ADDRESS));
Udp4Session.SourcePort = *SrcPort;
FragCount = (HeaderSize != NULL) ? 2 : 1;
- Udp4TxData = (EFI_UDP4_TRANSMIT_DATA *) NetAllocatePool (sizeof (EFI_UDP4_TRANSMIT_DATA) + (FragCount - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA));
+ Udp4TxData = (EFI_UDP4_TRANSMIT_DATA *) AllocatePool (sizeof (EFI_UDP4_TRANSMIT_DATA) + (FragCount - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA));
if (Udp4TxData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -799,7 +799,7 @@ EfiPxeBcUdpWrite ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
PxeBcCommonNotify,
&IsDone,
&Token.Event
@@ -826,7 +826,7 @@ ON_EXIT: gBS->CloseEvent (Token.Event);
}
- NetFreePool (Udp4TxData);
+ gBS->FreePool (Udp4TxData);
return Status;
}
@@ -928,7 +928,7 @@ EfiPxeBcUdpRead ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
PxeBcCommonNotify,
&IsDone,
&Token.Event
@@ -968,7 +968,7 @@ EfiPxeBcUdpRead ( Matched = TRUE;
if (DestIp != NULL) {
- NetCopyMem (DestIp, &Session->DestinationAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (DestIp, &Session->DestinationAddress, sizeof (EFI_IPv4_ADDRESS));
}
} else {
if (DestIp != NULL) {
@@ -1006,7 +1006,7 @@ EfiPxeBcUdpRead ( if (OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) {
if (SrcIp != NULL) {
- NetCopyMem (SrcIp, &Session->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (SrcIp, &Session->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
}
} else {
@@ -1039,7 +1039,7 @@ EfiPxeBcUdpRead ( if (HeaderSize != NULL) {
CopyLen = MIN (*HeaderSize, RxData->DataLength);
- NetCopyMem (HeaderPtr, RxData->FragmentTable[0].FragmentBuffer, CopyLen);
+ CopyMem (HeaderPtr, RxData->FragmentTable[0].FragmentBuffer, CopyLen);
*HeaderSize = CopyLen;
}
@@ -1049,7 +1049,7 @@ EfiPxeBcUdpRead ( } else {
*BufferSize = RxData->DataLength - CopyLen;
- NetCopyMem (BufferPtr, (UINT8 *) RxData->FragmentTable[0].FragmentBuffer + CopyLen, *BufferSize);
+ CopyMem (BufferPtr, (UINT8 *) RxData->FragmentTable[0].FragmentBuffer + CopyLen, *BufferSize);
}
} else {
@@ -1397,27 +1397,27 @@ EfiPxeBcSetPackets ( }
if (NewDhcpDiscover != NULL) {
- NetCopyMem (&Mode->DhcpDiscover, NewDhcpDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->DhcpDiscover, NewDhcpDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewDhcpAck != NULL) {
- NetCopyMem (&Mode->DhcpAck, NewDhcpAck, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->DhcpAck, NewDhcpAck, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewProxyOffer != NULL) {
- NetCopyMem (&Mode->ProxyOffer, NewProxyOffer, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->ProxyOffer, NewProxyOffer, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewPxeDiscover != NULL) {
- NetCopyMem (&Mode->PxeDiscover, NewPxeDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->PxeDiscover, NewPxeDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewPxeReply != NULL) {
- NetCopyMem (&Mode->PxeReply, NewPxeReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->PxeReply, NewPxeReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewPxeBisReply != NULL) {
- NetCopyMem (&Mode->PxeBisReply, NewPxeBisReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->PxeBisReply, NewPxeBisReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
return EFI_SUCCESS;
@@ -1623,12 +1623,12 @@ DiscoverBootFile ( Packet = &Private->Dhcp4Ack;
}
- NetCopyMem (&Private->ServerIp, &Packet->Packet.Offer.Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->ServerIp, &Packet->Packet.Offer.Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
if (Private->ServerIp.Addr[0] == 0) {
//
// next server ip address is zero, use option 54 instead
//
- NetCopyMem (
+ CopyMem (
&Private->ServerIp,
Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
sizeof (EFI_IPv4_ADDRESS)
@@ -1646,7 +1646,7 @@ DiscoverBootFile ( //
// Already have the bootfile length option, compute the file size
//
- NetCopyMem (&Value, Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN]->Data, sizeof (Value));
+ CopyMem (&Value, Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN]->Data, sizeof (Value));
Value = NTOHS (Value);
*BufferSize = 512 * Value;
Status = EFI_BUFFER_TOO_SMALL;
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c index 08cdb31f84..495f24120d 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c @@ -184,12 +184,12 @@ PxeBcTftpGetFileSize ( OptCnt--;
}
- NetFreePool (Option);
+ gBS->FreePool (Option);
ON_ERROR:
if (Packet != NULL) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
}
Mtftp4->Configure (Mtftp4, NULL);
|