VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpShutdown.c@ 89462

Last change on this file since 89462 was 89462, checked in by vboxsync, 4 years ago

EFI: Beginnings of a e1000 network driver to support network boot with our e1000 emulation, not built right now.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1/** @file
2
3 Implementation of the SNP.Shutdown() function and its private helpers if any.
4
5 Copyright (c) 2021, Oracle and/or its affiliates.
6 Copyright (c) 2017, AMD Inc, All rights reserved.
7 Copyright (C) 2013, Red Hat, Inc.
8 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
9
10 SPDX-License-Identifier: BSD-2-Clause-Patent
11
12**/
13
14#include <Library/UefiBootServicesTableLib.h>
15
16#include "E1kNet.h"
17
18/**
19 Resets a network adapter and leaves it in a state that is safe for another
20 driver to initialize.
21
22 @param This Protocol instance pointer.
23
24 @retval EFI_SUCCESS The network interface was shutdown.
25 @retval EFI_NOT_STARTED The network interface has not been started.
26 @retval EFI_INVALID_PARAMETER One or more of the parameters has an
27 unsupported value.
28 @retval EFI_DEVICE_ERROR The command could not be sent to the network
29 interface.
30 @retval EFI_UNSUPPORTED This function is not supported by the network
31 interface.
32
33**/
34
35EFI_STATUS
36EFIAPI
37E1kNetShutdown (
38 IN EFI_SIMPLE_NETWORK_PROTOCOL *This
39 )
40{
41 E1K_NET_DEV *Dev;
42 EFI_TPL OldTpl;
43 EFI_STATUS Status;
44
45 if (This == NULL) {
46 return EFI_INVALID_PARAMETER;
47 }
48
49 Dev = E1K_NET_FROM_SNP (This);
50 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
51 switch (Dev->Snm.State) {
52 case EfiSimpleNetworkStopped:
53 Status = EFI_NOT_STARTED;
54 goto Exit;
55 case EfiSimpleNetworkStarted:
56 Status = EFI_DEVICE_ERROR;
57 goto Exit;
58 default:
59 break;
60 }
61
62#if 0
63 Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
64 VirtioNetShutdownRx (Dev);
65 VirtioNetShutdownTx (Dev);
66 VirtioNetUninitRing (Dev, &Dev->TxRing, Dev->TxRingMap);
67 VirtioNetUninitRing (Dev, &Dev->RxRing, Dev->RxRingMap);
68#endif
69
70 Dev->Snm.State = EfiSimpleNetworkStarted;
71 Status = EFI_SUCCESS;
72
73Exit:
74 gBS->RestoreTPL (OldTpl);
75 return Status;
76}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette