3 Implementation of the SNP.Stop() function and its private helpers if any.
5 Copyright (C) 2013, Red Hat, Inc.
6 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <Library/UefiBootServicesTableLib.h>
14 #include "VirtioNet.h"
17 Changes the state of a network interface from "started" to "stopped".
19 @param This Protocol instance pointer.
21 @retval EFI_SUCCESS The network interface was stopped.
22 @retval EFI_ALREADY_STARTED The network interface is already in the stopped
24 @retval EFI_INVALID_PARAMETER One or more of the parameters has an
26 @retval EFI_DEVICE_ERROR The command could not be sent to the network
28 @retval EFI_UNSUPPORTED This function is not supported by the network
35 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
43 return EFI_INVALID_PARAMETER
;
46 Dev
= VIRTIO_NET_FROM_SNP (This
);
47 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
48 if (Dev
->Snm
.State
!= EfiSimpleNetworkStarted
) {
49 Status
= EFI_NOT_STARTED
;
51 Dev
->Snm
.State
= EfiSimpleNetworkStopped
;
55 gBS
->RestoreTPL (OldTpl
);