]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/VirtioNetDxe/SnpSharedHelpers.c
BaseTools VS Makefile: Don't include ms.common in ms.app
[mirror_edk2.git] / OvmfPkg / VirtioNetDxe / SnpSharedHelpers.c
CommitLineData
12384f9b
LE
1/** @file\r
2\r
3 Helper functions used by at least two Simple Network Protocol methods.\r
4\r
5 Copyright (C) 2013, Red Hat, Inc.\r
6\r
7 This program and the accompanying materials are licensed and made available\r
8 under the terms and conditions of the BSD License which accompanies this\r
9 distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#include <Library/MemoryAllocationLib.h>\r
18\r
19#include "VirtioNet.h"\r
20\r
21/**\r
22 Release RX and TX resources on the boundary of the\r
23 EfiSimpleNetworkInitialized state.\r
24\r
25 These functions contribute to rolling back a partial, failed initialization\r
26 of the virtio-net SNP driver instance, or to shutting down a fully\r
27 initialized, running instance.\r
28\r
29 They are only callable by the VirtioNetInitialize() and the\r
30 VirtioNetShutdown() SNP methods. See the state diagram in "VirtioNet.h".\r
31\r
32 @param[in,out] Dev The VNET_DEV driver instance being shut down, or whose\r
33 partial, failed initialization is being rolled back.\r
34*/\r
35\r
36VOID\r
37EFIAPI\r
38VirtioNetShutdownRx (\r
39 IN OUT VNET_DEV *Dev\r
40 )\r
41{\r
42 FreePool (Dev->RxBuf);\r
43}\r
44\r
45\r
46VOID\r
47EFIAPI\r
48VirtioNetShutdownTx (\r
49 IN OUT VNET_DEV *Dev\r
50 )\r
51{\r
52 FreePool (Dev->TxFreeStack);\r
53}\r