qcacld-3.0: Add condition for restarting SAP

Currently, when SAP is being restarted on a phymode change,
the logic will run unconditionally. Add a check to see if SAP
is up first before attempting to restart it.

Change-Id: I7c02b3c62d265c6e4989901bc108d53689425f0c
CRs-fixed: 2734308
This commit is contained in:
Lincoln Tran 2020-07-17 11:08:44 -07:00 • committed by snandini
commit 15a06789ee

View file

@ -1455,6 +1455,13 @@ static void hdd_restart_sap_with_new_phymode(struct hdd_context *hdd_ctx,
hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
if (!test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
sap_config->sap_orig_hw_mode = sap_config->SapHw_mode;
sap_config->SapHw_mode = csr_phy_mode;
hdd_err("Can't restart AP because it is not started");
return;
}
qdf_event_reset(&hostapd_state->qdf_stop_bss_event);
status = wlansap_stop_bss(sap_ctx);
if (!QDF_IS_STATUS_SUCCESS(status)) {