TianoCore EDK2 master
Loading...
Searching...
No Matches
WifiConnectionMgrImpl.c File Reference

Go to the source code of this file.

Functions

VOID EFIAPI WifiMgrOnScanFinished (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS WifiMgrStartScan (IN WIFI_MGR_DEVICE_DATA *Nic)
 
EFI_STATUS WifiMgrConfigPassword (IN WIFI_MGR_DEVICE_DATA *Nic, IN WIFI_MGR_NETWORK_PROFILE *Profile)
 
EFI_STATUS WifiMgrConfigEap (IN WIFI_MGR_DEVICE_DATA *Nic, IN WIFI_MGR_NETWORK_PROFILE *Profile)
 
EFI_STATUS WifiMgrGetLinkState (IN WIFI_MGR_DEVICE_DATA *Nic, OUT EFI_ADAPTER_INFO_MEDIA_STATE *LinkState)
 
EFI_STATUS WifiMgrPrepareConnection (IN WIFI_MGR_DEVICE_DATA *Nic, IN WIFI_MGR_NETWORK_PROFILE *Profile)
 
EFI_STATUS ConnectionRetry (IN EDKII_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol)
 
VOID EFIAPI WifiMgrOnConnectFinished (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS WifiMgrConnectToNetwork (IN WIFI_MGR_DEVICE_DATA *Nic, IN WIFI_MGR_NETWORK_PROFILE *Profile)
 
VOID EFIAPI WifiMgrOnDisconnectFinished (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS WifiMgrDisconnectToNetwork (IN WIFI_MGR_DEVICE_DATA *Nic)
 
VOID EFIAPI WifiMgrOnTimerTick (IN EFI_EVENT Event, IN VOID *Context)
 

Variables

EFI_EAP_TYPE mEapAuthMethod []
 
EFI_EAP_TYPE mEapSecondAuthMethod []
 
UINT8 mWifiConnectionCount = 0
 

Detailed Description

The Mac Connection2 Protocol adapter functions for WiFi Connection Manager.

Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file WifiConnectionMgrImpl.c.

Function Documentation

◆ ConnectionRetry()

EFI_STATUS ConnectionRetry ( IN EDKII_WIFI_PROFILE_SYNC_PROTOCOL WiFiProfileSyncProtocol)

Will reset NiC data, get profile from profile sync driver, and send for another connection attempt.This function should not be called more than 3 times.

Parameters
[in]WiFiProfileSyncProtocolThe target network profile to connect.
Return values
EFI_SUCCESSThe operation is completed.
otherOperation failure.

Definition at line 937 of file WifiConnectionMgrImpl.c.

◆ WifiMgrConfigEap()

EFI_STATUS WifiMgrConfigEap ( IN WIFI_MGR_DEVICE_DATA Nic,
IN WIFI_MGR_NETWORK_PROFILE Profile 
)

Conduct EAP configuration to supplicant before connecting to a EAP network. Current WiFi Connection Manager only supports three kinds of EAP networks: 1). EAP-TLS (Two-Way Authentication is required in our implementation) 2). EAP-TTLS/MSCHAPv2 (One-Way Authentication is required in our implementation) 3). PEAPv0/MSCHAPv2 (One-Way Authentication is required in our implementation)

Parameters
[in]NicPointer to the device data of the selected NIC.
[in]ProfileThe target network to be connected.
Return values
EFI_SUCCESSThe operation is completed.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_UNSUPPORTEDThe expected EAP method is not supported.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OtherErrors Returned errors when setting data to supplicant.

Definition at line 473 of file WifiConnectionMgrImpl.c.

◆ WifiMgrConfigPassword()

EFI_STATUS WifiMgrConfigPassword ( IN WIFI_MGR_DEVICE_DATA Nic,
IN WIFI_MGR_NETWORK_PROFILE Profile 
)

Configure password to supplicant before connecting to a secured network.

Parameters
[in]NicPointer to the device data of the selected NIC.
[in]ProfileThe target network to be connected.
Return values
EFI_SUCCESSThe operation is completed.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NOT_FOUNDNo valid password is found to configure.
OtherErrors Returned errors when setting data to supplicant.

Definition at line 392 of file WifiConnectionMgrImpl.c.

◆ WifiMgrConnectToNetwork()

EFI_STATUS WifiMgrConnectToNetwork ( IN WIFI_MGR_DEVICE_DATA Nic,
IN WIFI_MGR_NETWORK_PROFILE Profile 
)

Start connect operation, and send out a token to connect to a target network.

Parameters
[in]NicPointer to the device data of the selected NIC.
[in]ProfileThe target network to be connected.
Return values
EFI_SUCCESSThe operation is completed.
EFI_ALREADY_STARTEDAlready in "connected" state, need to perform a disconnect operation first.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OtherErrors Return errors when connecting network on low layer.

Definition at line 1207 of file WifiConnectionMgrImpl.c.

◆ WifiMgrDisconnectToNetwork()

EFI_STATUS WifiMgrDisconnectToNetwork ( IN WIFI_MGR_DEVICE_DATA Nic)

Start disconnect operation, and send out a token to disconnect from current connected network.

Parameters
[in]NicPointer to the device data of the selected NIC.
Return values
EFI_SUCCESSThe operation is completed.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
OtherErrors Return errors when disconnecting a network on low layer.

Definition at line 1387 of file WifiConnectionMgrImpl.c.

◆ WifiMgrGetLinkState()

EFI_STATUS WifiMgrGetLinkState ( IN WIFI_MGR_DEVICE_DATA Nic,
OUT EFI_ADAPTER_INFO_MEDIA_STATE LinkState 
)

Get current link state from low layer.

Parameters
[in]NicPointer to the device data of the selected NIC.
[out]LinkStateThe pointer to buffer to retrieve link state.
Return values
EFI_SUCCESSThe operation is completed.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_UNSUPPORTEDAdapter information protocol is not supported.
OtherErrors Returned errors when retrieving link state from low layer.

Definition at line 791 of file WifiConnectionMgrImpl.c.

◆ WifiMgrOnConnectFinished()

VOID EFIAPI WifiMgrOnConnectFinished ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The callback function for connect operation.

ASSERT when errors occur in config token.

Parameters
[in]EventThe Connect token receive event.
[in]ContextThe context of the connect token.

Definition at line 1063 of file WifiConnectionMgrImpl.c.

◆ WifiMgrOnDisconnectFinished()

VOID EFIAPI WifiMgrOnDisconnectFinished ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The callback function for disconnect operation.

ASSERT when errors occur in config token.

Parameters
[in]EventThe Disconnect token receive event.
[in]ContextThe context of the Disconnect token.

Definition at line 1338 of file WifiConnectionMgrImpl.c.

◆ WifiMgrOnScanFinished()

VOID EFIAPI WifiMgrOnScanFinished ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The callback function for scan operation. This function updates networks according to the latest scan result, and trigger UI refresh.

ASSERT when errors occur in config token.

Parameters
[in]EventThe GetNetworks token receive event.
[in]ContextThe context of the GetNetworks token.

Definition at line 36 of file WifiConnectionMgrImpl.c.

◆ WifiMgrOnTimerTick()

VOID EFIAPI WifiMgrOnTimerTick ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The state machine of the connection manager, periodically check the state and perform a corresponding operation.

Parameters
[in]EventThe timer event to be triggered.
[in]ContextThe context of the Nic device data.

Definition at line 1477 of file WifiConnectionMgrImpl.c.

◆ WifiMgrPrepareConnection()

EFI_STATUS WifiMgrPrepareConnection ( IN WIFI_MGR_DEVICE_DATA Nic,
IN WIFI_MGR_NETWORK_PROFILE Profile 
)

Prepare configuration work before connecting to the target network. For WPA2 Personal networks, password should be checked; and for EAP networks, parameters are different for different networks.

Parameters
[in]NicPointer to the device data of the selected NIC.
[in]ProfileThe target network to be connected.
Return values
EFI_SUCCESSThe operation is completed.
EFI_UNSUPPORTEDThis network is not supported.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 852 of file WifiConnectionMgrImpl.c.

◆ WifiMgrStartScan()

EFI_STATUS WifiMgrStartScan ( IN WIFI_MGR_DEVICE_DATA Nic)

Start scan operation, and send out a token to collect available networks.

Parameters
[in]NicPointer to the device data of the selected NIC.
Return values
EFI_SUCCESSThe operation is completed.
EFI_ALREADY_STARTEDA former scan operation is already ongoing.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OtherErrors Return errors when getting networks from low layer.

Definition at line 246 of file WifiConnectionMgrImpl.c.

Variable Documentation

◆ mEapAuthMethod

EFI_EAP_TYPE mEapAuthMethod[]
Initial value:
= {
EFI_EAP_TYPE_TTLS,
EFI_EAP_TYPE_PEAP,
EFI_EAP_TYPE_EAPTLS
}

Definition at line 12 of file WifiConnectionMgrImpl.c.

◆ mEapSecondAuthMethod

EFI_EAP_TYPE mEapSecondAuthMethod[]
Initial value:
= {
EFI_EAP_TYPE_MSCHAPV2
}

Definition at line 18 of file WifiConnectionMgrImpl.c.

◆ mWifiConnectionCount

UINT8 mWifiConnectionCount = 0

Definition at line 22 of file WifiConnectionMgrImpl.c.