]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h
d6b7ded8e6e427b88ea334a76a67c9f83edeac80
[mirror_edk2.git] / NetworkPkg / WifiConnectionManagerDxe / WifiConnectionMgrImpl.h
1 /** @file
2 The Mac Connection2 Protocol adapter functions for WiFi Connection Manager.
3
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __EFI_WIFI_IMPL__
11 #define __EFI_WIFI_IMPL__
12
13 /**
14 Start scan operation, and send out a token to collect available networks.
15
16 @param[in] Nic Pointer to the device data of the selected NIC.
17
18 @retval EFI_SUCCESS The operation is completed.
19 @retval EFI_ALREADY_STARTED A former scan operation is already ongoing.
20 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
21 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
22 @retval Other Errors Return errors when getting networks from low layer.
23
24 **/
25 EFI_STATUS
26 WifiMgrStartScan (
27 IN WIFI_MGR_DEVICE_DATA *Nic
28 );
29
30 /**
31 Get current link state from low layer.
32
33 @param[in] Nic Pointer to the device data of the selected NIC.
34 @param[out] LinkState The pointer to buffer to retrieve link state.
35
36 @retval EFI_SUCCESS The operation is completed.
37 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
38 @retval EFI_UNSUPPORTED Adapter information protocol is not supported.
39 @retval Other Errors Returned errors when retrieving link state from low layer.
40
41 **/
42 EFI_STATUS
43 WifiMgrGetLinkState (
44 IN WIFI_MGR_DEVICE_DATA *Nic,
45 OUT EFI_ADAPTER_INFO_MEDIA_STATE *LinkState
46 );
47
48 /**
49 Start connect operation, and send out a token to connect to a target network.
50
51 @param[in] Nic Pointer to the device data of the selected NIC.
52 @param[in] Profile The target network to be connected.
53
54 @retval EFI_SUCCESS The operation is completed.
55 @retval EFI_ALREADY_STARTED Already in "connected" state, need to perform a disconnect
56 operation first.
57 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
58 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
59 @retval Other Errors Return errors when connecting network on low layer.
60
61 **/
62 EFI_STATUS
63 WifiMgrConnectToNetwork (
64 IN WIFI_MGR_DEVICE_DATA *Nic,
65 IN WIFI_MGR_NETWORK_PROFILE *Profile
66 );
67
68 /**
69 Start disconnect operation, and send out a token to disconnect from current connected
70 network.
71
72 @param[in] Nic Pointer to the device data of the selected NIC.
73
74 @retval EFI_SUCCESS The operation is completed.
75 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
76 @retval Other Errors Return errors when disconnecting a network on low layer.
77
78 **/
79 EFI_STATUS
80 WifiMgrDisconnectToNetwork (
81 IN WIFI_MGR_DEVICE_DATA *Nic
82 );
83
84 /**
85 The state machine of the connection manager, periodically check the state and
86 perform a corresponding operation.
87
88 @param[in] Event The timer event to be triggered.
89 @param[in] Context The context of the Nic device data.
90
91 **/
92 VOID
93 EFIAPI
94 WifiMgrOnTimerTick (
95 IN EFI_EVENT Event,
96 IN VOID *Context
97 );
98
99 #endif