]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h
f742db05ca3eab810d708a26648f4a3672ec52f0
[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 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EFI_WIFI_IMPL__
17 #define __EFI_WIFI_IMPL__
18
19 /**
20 Start scan operation, and send out a token to collect available networks.
21
22 @param[in] Nic Pointer to the device data of the selected NIC.
23
24 @retval EFI_SUCCESS The operation is completed.
25 @retval EFI_ALREADY_STARTED A former scan operation is already ongoing.
26 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
27 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
28 @retval Other Errors Return errors when getting networks from low layer.
29
30 **/
31 EFI_STATUS
32 WifiMgrStartScan (
33 IN WIFI_MGR_DEVICE_DATA *Nic
34 );
35
36 /**
37 Get current link state from low layer.
38
39 @param[in] Nic Pointer to the device data of the selected NIC.
40 @param[out] LinkState The pointer to buffer to retrieve link state.
41
42 @retval EFI_SUCCESS The operation is completed.
43 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
44 @retval EFI_UNSUPPORTED Adapter information protocol is not supported.
45 @retval Other Errors Returned errors when retrieving link state from low layer.
46
47 **/
48 EFI_STATUS
49 WifiMgrGetLinkState (
50 IN WIFI_MGR_DEVICE_DATA *Nic,
51 OUT EFI_ADAPTER_INFO_MEDIA_STATE *LinkState
52 );
53
54 /**
55 Start connect operation, and send out a token to connect to a target network.
56
57 @param[in] Nic Pointer to the device data of the selected NIC.
58 @param[in] Profile The target network to be connected.
59
60 @retval EFI_SUCCESS The operation is completed.
61 @retval EFI_ALREADY_STARTED Already in "connected" state, need to perform a disconnect
62 operation first.
63 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
64 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
65 @retval Other Errors Return errors when connecting network on low layer.
66
67 **/
68 EFI_STATUS
69 WifiMgrConnectToNetwork (
70 IN WIFI_MGR_DEVICE_DATA *Nic,
71 IN WIFI_MGR_NETWORK_PROFILE *Profile
72 );
73
74 /**
75 Start disconnect operation, and send out a token to disconnect from current connected
76 network.
77
78 @param[in] Nic Pointer to the device data of the selected NIC.
79
80 @retval EFI_SUCCESS The operation is completed.
81 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
82 @retval Other Errors Return errors when disconnecting a network on low layer.
83
84 **/
85 EFI_STATUS
86 WifiMgrDisconnectToNetwork (
87 IN WIFI_MGR_DEVICE_DATA *Nic
88 );
89
90 /**
91 The state machine of the connection manager, periodically check the state and
92 perform a corresponding operation.
93
94 @param[in] Event The timer event to be triggered.
95 @param[in] Context The context of the Nic device data.
96
97 **/
98 VOID
99 EFIAPI
100 WifiMgrOnTimerTick (
101 IN EFI_EVENT Event,
102 IN VOID *Context
103 );
104
105 #endif