VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/VirtioNetDxe/SnpStart.c@ 99396

最後變更 在這個檔案從99396是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.5 KB
 
1/** @file
2
3 Implementation of the SNP.Start() function and its private helpers if any.
4
5 Copyright (C) 2013, Red Hat, Inc.
6 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#include <Library/UefiBootServicesTableLib.h>
13
14#include "VirtioNet.h"
15
16/**
17 Changes the state of a network interface from "stopped" to "started".
18
19 @param This Protocol instance pointer.
20
21 @retval EFI_SUCCESS The network interface was started.
22 @retval EFI_ALREADY_STARTED The network interface is already in the started
23 state.
24 @retval EFI_INVALID_PARAMETER One or more of the parameters has an
25 unsupported value.
26 @retval EFI_DEVICE_ERROR The command could not be sent to the network
27 interface.
28 @retval EFI_UNSUPPORTED This function is not supported by the network
29 interface.
30**/
31
32EFI_STATUS
33EFIAPI
34VirtioNetStart (
35 IN EFI_SIMPLE_NETWORK_PROTOCOL *This
36 )
37{
38 VNET_DEV *Dev;
39 EFI_TPL OldTpl;
40 EFI_STATUS Status;
41
42 if (This == NULL) {
43 return EFI_INVALID_PARAMETER;
44 }
45
46 Dev = VIRTIO_NET_FROM_SNP (This);
47 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
48 if (Dev->Snm.State != EfiSimpleNetworkStopped) {
49 Status = EFI_ALREADY_STARTED;
50 }
51 else {
52 Dev->Snm.State = EfiSimpleNetworkStarted;
53 Status = EFI_SUCCESS;
54 }
55
56 gBS->RestoreTPL (OldTpl);
57 return Status;
58}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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