X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4If.c;h=224244164e41a7b1b5385036b3372157debd05c9;hp=d5a46082277a1a0f01340fa40b98bb427345ccdc;hb=75dce340624dba5e4a79b2e5b2dbe943bae0d0e9;hpb=3e8c18da0441069591e5aa218f378001b29512dd diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c index d5a4608227..224244164e 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c @@ -1,8 +1,8 @@ /** @file Implement IP4 pesudo interface. -Copyright (c) 2005 - 2007, Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2005 - 2012, 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 which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -123,7 +123,7 @@ VOID Ip4CancelFrameArp ( IN IP4_ARP_QUE *ArpQue, IN EFI_STATUS IoStatus, - IN IP4_FRAME_TO_CANCEL FrameToCancel, OPTIONAL + IN IP4_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context ); @@ -146,7 +146,7 @@ Ip4CancelFrameArp ( IP4_LINK_TX_TOKEN * Ip4WrapLinkTxToken ( IN IP4_INTERFACE *Interface, - IN IP4_PROTOCOL *IpInstance, OPTIONAL + IN IP4_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN IP4_FRAME_CALLBACK CallBack, IN VOID *Context @@ -188,7 +188,7 @@ Ip4WrapLinkTxToken ( ); if (EFI_ERROR (Status)) { - gBS->FreePool (Token); + FreePool (Token); return NULL; } @@ -225,7 +225,7 @@ Ip4FreeLinkTxToken ( NET_CHECK_SIGNATURE (Token, IP4_FRAME_TX_SIGNATURE); gBS->CloseEvent (Token->MnpToken.Event); - gBS->FreePool (Token); + FreePool (Token); } @@ -269,7 +269,7 @@ Ip4CreateArpQue ( ); if (EFI_ERROR (Status)) { - gBS->FreePool (ArpQue); + FreePool (ArpQue); return NULL; } @@ -302,7 +302,7 @@ Ip4FreeArpQue ( Ip4CancelFrameArp (ArpQue, IoStatus, NULL, NULL); gBS->CloseEvent (ArpQue->OnResolved); - gBS->FreePool (ArpQue); + FreePool (ArpQue); } @@ -353,7 +353,7 @@ Ip4CreateLinkRxToken ( ); if (EFI_ERROR (Status)) { - gBS->FreePool (Token); + FreePool (Token); return NULL; } @@ -378,7 +378,7 @@ Ip4FreeFrameRxToken ( NET_CHECK_SIGNATURE (Token, IP4_FRAME_RX_SIGNATURE); gBS->CloseEvent (Token->MnpToken.Event); - gBS->FreePool (Token); + FreePool (Token); } @@ -397,7 +397,7 @@ VOID Ip4CancelFrameArp ( IN IP4_ARP_QUE *ArpQue, IN EFI_STATUS IoStatus, - IN IP4_FRAME_TO_CANCEL FrameToCancel, OPTIONAL + IN IP4_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context ) { @@ -435,7 +435,7 @@ VOID Ip4CancelFrames ( IN IP4_INTERFACE *Interface, IN EFI_STATUS IoStatus, - IN IP4_FRAME_TO_CANCEL FrameToCancel, OPTIONAL + IN IP4_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context ) { @@ -523,7 +523,7 @@ Ip4CreateInterface ( // Get the interface's Mac address and broadcast mac address from SNP // if (EFI_ERROR (Mnp->GetModeData (Mnp, NULL, &SnpMode))) { - gBS->FreePool (Interface); + FreePool (Interface); return NULL; } @@ -582,7 +582,7 @@ Ip4SetAddress ( Type = NetGetIpClass (IpAddr); Len = NetGetMaskLength (SubnetMask); - Netmask = gIp4AllMasks[MIN (Len, Type << 3)]; + Netmask = gIp4AllMasks[MIN ((Len - 1), Type << 3)]; Interface->NetBrdcast = (IpAddr | ~Netmask); // @@ -745,10 +745,10 @@ Ip4FreeInterface ( } // - // Destory the interface if this is the last IP instance that + // Destroy the interface if this is the last IP instance that // has the address. Remove all the system transmitted packets // from this interface, cancel the receive request if there is - // one, and destory the ARP requests. + // one, and destroy the ARP requests. // Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL); Ip4CancelReceive (Interface); @@ -774,7 +774,7 @@ Ip4FreeInterface ( } RemoveEntryList (&Interface->Link); - gBS->FreePool (Interface); + FreePool (Interface); return EFI_SUCCESS; } @@ -871,7 +871,7 @@ Ip4OnArpResolved ( // // Request Ip4OnArpResolvedDpc as a DPC at TPL_CALLBACK // - NetLibQueueDpc (TPL_CALLBACK, Ip4OnArpResolvedDpc, Context); + QueueDpc (TPL_CALLBACK, Ip4OnArpResolvedDpc, Context); } @@ -924,7 +924,7 @@ Ip4OnFrameSent ( // // Request Ip4OnFrameSentDpc as a DPC at TPL_CALLBACK // - NetLibQueueDpc (TPL_CALLBACK, Ip4OnFrameSentDpc, Context); + QueueDpc (TPL_CALLBACK, Ip4OnFrameSentDpc, Context); } @@ -954,7 +954,7 @@ Ip4OnFrameSent ( EFI_STATUS Ip4SendFrame ( IN IP4_INTERFACE *Interface, - IN IP4_PROTOCOL *IpInstance, OPTIONAL + IN IP4_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN IP4_ADDR NextHop, IN IP4_FRAME_CALLBACK CallBack, @@ -1088,6 +1088,7 @@ ON_ERROR: **/ VOID +EFIAPI Ip4RecycleFrame ( IN VOID *Context ) @@ -1187,7 +1188,7 @@ Ip4OnFrameReceived ( // // Request Ip4OnFrameReceivedDpc as a DPC at TPL_CALLBACK // - NetLibQueueDpc (TPL_CALLBACK, Ip4OnFrameReceivedDpc, Context); + QueueDpc (TPL_CALLBACK, Ip4OnFrameReceivedDpc, Context); } @@ -1209,7 +1210,7 @@ Ip4OnFrameReceived ( EFI_STATUS Ip4ReceiveFrame ( IN IP4_INTERFACE *Interface, - IN IP4_PROTOCOL *IpInstance, OPTIONAL + IN IP4_PROTOCOL *IpInstance OPTIONAL, IN IP4_FRAME_CALLBACK CallBack, IN VOID *Context )