Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ WifiMgrDxeDriverBindingStart (
WiFiProfileSyncProtocol->GetProfile (Nic->ConnectPendingNetwork, Nic->MacAddress);
if (Nic->ConnectPendingNetwork != NULL) {
Status = WifiMgrConnectToNetwork (Nic, Nic->ConnectPendingNetwork);
if (!EFI_ERROR (Status)) {
if (EFI_ERROR (Status)) {
goto ERROR1;
}

Expand Down Expand Up @@ -293,9 +293,18 @@ WifiMgrDxeDriverBindingStart (
goto ERROR2;
}

Status = gBS->SetTimer (Nic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS (500));
if (EFI_ERROR (Status)) {
goto ERROR3;
//
// Connect to profile from last boot if available
//
if ((Nic->CurrentOperateNetwork != NULL) && Nic->CurrentOperateNetwork->IsAvailable) {
Status = gBS->SetTimer (
Nic->TickTimer,
TimerPeriodic,
EFI_TIMER_PERIOD_MILLISECONDS (500)
);
if (EFI_ERROR (Status)) {
goto ERROR3;
}
}

Nic->ConnectState = WifiMgrDisconnected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,11 @@ WifiMgrDxeHiiConfigAccessCallback (
Private->CurrentNic->HasDisconnectPendingNetwork = TRUE;
}

Status = gBS->SetTimer (Private->CurrentNic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS (500));
if (EFI_ERROR (Status)) {
gBS->CloseEvent (Private->CurrentNic->TickTimer);
}

break;

case KEY_ENROLL_CA_CERT_CONNECT_NETWORK:
Expand Down Expand Up @@ -1913,6 +1918,11 @@ WifiMgrDxeHiiConfigAccessCallback (
}
}

Status = gBS->SetTimer (Private->CurrentNic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS (500));
if (EFI_ERROR (Status)) {
gBS->CloseEvent (Private->CurrentNic->TickTimer);
}

break;
}
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
Expand Down
14 changes: 12 additions & 2 deletions NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ WifiMgrOnConnectFinished (
}

ConfigToken->Nic->ConnectState = WifiMgrConnectedToAp;
gBS->SetTimer (ConfigToken->Nic->TickTimer, TimerCancel, 0);
WifiMgrUpdateConnectMessage (ConfigToken->Nic, TRUE, NULL);

Exit:
Expand Down Expand Up @@ -1489,6 +1490,12 @@ WifiMgrOnTimerTick (
}

Nic = (WIFI_MGR_DEVICE_DATA *)Context;
if (Nic->ConnectPendingNetwork == NULL) {
DEBUG ((DEBUG_VERBOSE, "[WiFi Connection Manager] No profile for connection, no scan triggered!\n"));
gBS->SetTimer (Nic->TickTimer, TimerCancel, 0);
return;
}

NET_CHECK_SIGNATURE (Nic, WIFI_MGR_DEVICE_DATA_SIGNATURE);

Status = WifiMgrGetLinkState (Nic, &LinkState);
Expand All @@ -1506,8 +1513,11 @@ WifiMgrOnTimerTick (
}

Nic->ScanTickTime++;
if ((((Nic->ScanTickTime > WIFI_SCAN_FREQUENCY) && (Nic->ConnectState != WifiMgrConnectedToAp)) ||
Nic->OneTimeScanRequest) && (Nic->ScanState == WifiMgrScanFinished))
if ((((Nic->ScanTickTime > WIFI_SCAN_FREQUENCY) &&
((Nic->ConnectState != WifiMgrConnectedToAp) &&
(Nic->ConnectState != WifiMgrConnectingToAp))) ||
Nic->OneTimeScanRequest) &&
(Nic->ScanState == WifiMgrScanFinished))
{
Nic->OneTimeScanRequest = FALSE;
Nic->ScanTickTime = 0;
Expand Down
Loading