VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpStart.c@ 108198

Last change on this file since 108198 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.Start() 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 "stopped" to "started".
19
20 @param This Protocol instance pointer.
21
22 @retval EFI_SUCCESS The network interface was started.
23 @retval EFI_ALREADY_STARTED The network interface is already in the started
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
33EFI_STATUS
34EFIAPI
35E1kNetStart (
36 IN EFI_SIMPLE_NETWORK_PROTOCOL *This
37 )
38{
39 E1K_NET_DEV *Dev;
40 EFI_TPL OldTpl;
41 EFI_STATUS Status;
42
43 if (This == NULL) {
44 return EFI_INVALID_PARAMETER;
45 }
46
47 Dev = E1K_NET_FROM_SNP (This);
48 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
49 if (Dev->Snm.State != EfiSimpleNetworkStopped) {
50 Status = EFI_ALREADY_STARTED;
51 }
52 else {
53 Dev->Snm.State = EfiSimpleNetworkStarted;
54 Status = EFI_SUCCESS;
55 }
56
57 gBS->RestoreTPL (OldTpl);
58 return Status;
59}
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