Last change
on this file was 99404, checked in by vboxsync, 21 months ago |
Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643
|
-
Property svn:eol-style
set to
native
|
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) 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 "started" to "stopped".
|
---|
18 |
|
---|
19 | @param This Protocol instance pointer.
|
---|
20 |
|
---|
21 | @retval EFI_SUCCESS The network interface was stopped.
|
---|
22 | @retval EFI_ALREADY_STARTED The network interface is already in the stopped
|
---|
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 | **/
|
---|
32 | EFI_STATUS
|
---|
33 | EFIAPI
|
---|
34 | VirtioNetStop (
|
---|
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 != EfiSimpleNetworkStarted) {
|
---|
49 | Status = EFI_NOT_STARTED;
|
---|
50 | } else {
|
---|
51 | Dev->Snm.State = EfiSimpleNetworkStopped;
|
---|
52 | Status = EFI_SUCCESS;
|
---|
53 | }
|
---|
54 |
|
---|
55 | gBS->RestoreTPL (OldTpl);
|
---|
56 | return Status;
|
---|
57 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.