Skip to content

Commit 0213064

Browse files
WifiConnectionManager: PreScan Check for Connect
When the Wifi network is enabled the connection manager will trigger a network scan without a profile to use. If there is a connected network or attempting a connection, the scan will interrupt and break the connection. Fix - The Wifi Connection Manager will check for SSID length longer than the minimum SSID length, and if the state is not in connecting or connected. Only of SSID string length is over the defined minimum and state are not connected then it will attempt the network scan as normal. Signed-off-by: Zachary Clark-Williams <[email protected]>
1 parent 5bc52de commit 0213064

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,18 @@ WifiMgrOnTimerTick (
14911491
Nic = (WIFI_MGR_DEVICE_DATA *)Context;
14921492
NET_CHECK_SIGNATURE (Nic, WIFI_MGR_DEVICE_DATA_SIGNATURE);
14931493

1494+
if ((Nic->ConnectPendingNetwork == NULL) || (StrLen (Nic->ConnectPendingNetwork->SSId) < SSID_MIN_LEN)) {
1495+
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] No valid profile for connection, no scan triggered!\n"));
1496+
gBS->CloseEvent (Event);
1497+
return;
1498+
}
1499+
1500+
if ((Nic->ConnectState == WifiMgrConnectedToAp) || (Nic->ConnectState == WifiMgrConnectingToAp)) {
1501+
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Already connecting to AP, no scan triggered!\n"));
1502+
gBS->CloseEvent (Event);
1503+
return;
1504+
}
1505+
14941506
Status = WifiMgrGetLinkState (Nic, &LinkState);
14951507
if (EFI_ERROR (Status)) {
14961508
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Error: Failed to get link state!\n"));

0 commit comments

Comments
 (0)