TianoCore EDK2
master
Loading...
Searching...
No Matches
SnpShutdown.c
Go to the documentation of this file.
1
13
#include <
Library/UefiBootServicesTableLib.h
>
14
15
#include "
VirtioNet.h
"
16
33
EFI_STATUS
34
EFIAPI
35
VirtioNetShutdown
(
36
IN
EFI_SIMPLE_NETWORK_PROTOCOL
*This
37
)
38
{
39
VNET_DEV
*Dev;
40
EFI_TPL
OldTpl;
41
EFI_STATUS
Status;
42
43
if
(This ==
NULL
) {
44
return
EFI_INVALID_PARAMETER;
45
}
46
47
Dev = VIRTIO_NET_FROM_SNP (This);
48
OldTpl =
gBS
->RaiseTPL (TPL_CALLBACK);
49
switch
(Dev->Snm.
State
) {
50
case
EfiSimpleNetworkStopped:
51
Status = EFI_NOT_STARTED;
52
goto
Exit
;
53
case
EfiSimpleNetworkStarted:
54
Status = EFI_DEVICE_ERROR;
55
goto
Exit
;
56
default
:
57
break
;
58
}
59
60
Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
61
VirtioNetShutdownRx
(Dev);
62
VirtioNetShutdownTx (Dev);
63
VirtioNetUninitRing
(Dev, &Dev->TxRing, Dev->TxRingMap);
64
VirtioNetUninitRing
(Dev, &Dev->RxRing, Dev->RxRingMap);
65
66
Dev->Snm.
State
= EfiSimpleNetworkStarted;
67
Status =
EFI_SUCCESS
;
68
69
Exit
:
70
gBS
->RestoreTPL (OldTpl);
71
return
Status;
72
}
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
VirtioNetShutdownRx
VOID EFIAPI VirtioNetShutdownRx(IN OUT VNET_DEV *Dev)
Definition:
SnpSharedHelpers.c:41
VirtioNetUninitRing
VOID EFIAPI VirtioNetUninitRing(IN OUT VNET_DEV *Dev, IN OUT VRING *Ring, IN VOID *RingMap)
Definition:
SnpSharedHelpers.c:96
VirtioNetShutdown
EFI_STATUS EFIAPI VirtioNetShutdown(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
Definition:
SnpShutdown.c:35
Exit
VOID EFIAPI Exit(IN EFI_STATUS Status)
Definition:
ApplicationEntryPoint.c:83
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_TPL
UINTN EFI_TPL
Definition:
UefiBaseType.h:41
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
UefiBootServicesTableLib.h
gBS
EFI_BOOT_SERVICES * gBS
Definition:
UefiBootServicesTableLib.c:17
VirtioNet.h
_EFI_SIMPLE_NETWORK_PROTOCOL
Definition:
SimpleNetwork.h:643
EFI_SIMPLE_NETWORK_MODE::State
UINT32 State
Definition:
SimpleNetwork.h:166
VNET_DEV
Definition:
VirtioNet.h:64
OvmfPkg
VirtioNetDxe
SnpShutdown.c
Generated on Fri Nov 15 2024 18:01:22 for TianoCore EDK2 by
1.9.6