VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpStop.c

Last change on this file was 106066, checked in by vboxsync, 5 months ago

Manual copyright year updates.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1/** @file
2
3 Implementation of the SNP.Stop() function and its private helpers if any.
4
5 Copyright (c) 2021 - 2024, Oracle and/or its affiliates.
6 Copyright (C) 2013, Red Hat, Inc.
7 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
8
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11**/
12
13#include <Library/UefiBootServicesTableLib.h>
14
15#include "E1kNet.h"
16
17/**
18 Changes the state of a network interface from "started" to "stopped".
19
20 @param This Protocol instance pointer.
21
22 @retval EFI_SUCCESS The network interface was stopped.
23 @retval EFI_ALREADY_STARTED The network interface is already in the stopped
24 state.
25 @retval EFI_INVALID_PARAMETER One or more of the parameters has an
26 unsupported value.
27 @retval EFI_DEVICE_ERROR The command could not be sent to the network
28 interface.
29 @retval EFI_UNSUPPORTED This function is not supported by the network
30 interface.
31
32**/
33
34EFI_STATUS
35EFIAPI
36E1kNetStop (
37 IN EFI_SIMPLE_NETWORK_PROTOCOL *This
38 )
39{
40 E1K_NET_DEV *Dev;
41 EFI_TPL OldTpl;
42 EFI_STATUS Status;
43
44 if (This == NULL) {
45 return EFI_INVALID_PARAMETER;
46 }
47
48 Dev = E1K_NET_FROM_SNP (This);
49 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
50 if (Dev->Snm.State != EfiSimpleNetworkStarted) {
51 Status = EFI_NOT_STARTED;
52 }
53 else {
54 Dev->Snm.State = EfiSimpleNetworkStopped;
55 Status = EFI_SUCCESS;
56 }
57
58 gBS->RestoreTPL (OldTpl);
59 return Status;
60}
Note: See TracBrowser for help on using the repository browser.

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