diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index c2d33947d39b..c7b6f53c1c65 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -247,6 +247,11 @@ static int __wlan_hdd_ipv6_changed(struct notifier_block *nb, status = wlan_hdd_validate_context(pHddCtx); if (0 != status) return NOTIFY_DONE; + if (eConnectionState_Associated == + WLAN_HDD_GET_STATION_CTX_PTR( + pAdapter)->conn_info.connState) + sme_dhcp_done_ind(pHddCtx->hHal, + pAdapter->sessionId); schedule_work(&pAdapter->ipv6NotifierWorkQueue); } @@ -752,6 +757,12 @@ static int __wlan_hdd_ipv4_changed(struct notifier_block *nb, if (0 != status) return NOTIFY_DONE; + if (eConnectionState_Associated == + WLAN_HDD_GET_STATION_CTX_PTR( + pAdapter)->conn_info.connState) + sme_dhcp_done_ind(pHddCtx->hHal, + pAdapter->sessionId); + if (!pHddCtx->config->fhostArpOffload) { hdd_notice("Offload not enabled ARPOffload=%d", pHddCtx->config->fhostArpOffload); diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 684c3cb33343..d35e447dc8d8 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -1899,7 +1899,10 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx, break; case SIR_MAC_ACTION_RRM: - if (mac_ctx->rrm.rrmPEContext.rrmEnable) { + /* Ignore RRM measurement request until DHCP is set */ + if (mac_ctx->rrm.rrmPEContext.rrmEnable && + mac_ctx->roam.roamSession + [session->smeSessionId].dhcp_done) { switch (action_hdr->actionID) { case SIR_MAC_RRM_RADIO_MEASURE_REQ: __lim_process_radio_measure_request(mac_ctx, @@ -1926,7 +1929,10 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx, } else { /* Else we will just ignore the RRM messages. */ lim_log(mac_ctx, LOG1, - FL("RRM frm ignored, it is disabled in cfg")); + FL("RRM frm ignored, it is disabled in cfg %d or DHCP not completed %d"), + mac_ctx->rrm.rrmPEContext.rrmEnable, + mac_ctx->roam.roamSession + [session->smeSessionId].dhcp_done); } break; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 8fe191bcec97..6ff46559ff66 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -998,6 +998,7 @@ typedef struct tagCsrRoamSession { bool roam_synch_in_progress; bool supported_nss_1x1; bool disable_hi_rssi; + bool dhcp_done; } tCsrRoamSession; typedef struct tagCsrRoamStruct { diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index f9abc72bef2c..12eef22ae8c6 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -282,6 +282,7 @@ QDF_STATUS sme_roam_reassoc(tHalHandle hHal, uint8_t sessionId, QDF_STATUS sme_roam_connect_to_last_profile(tHalHandle hHal, uint8_t sessionId); QDF_STATUS sme_roam_disconnect(tHalHandle hHal, uint8_t sessionId, eCsrRoamDisconnectReason reason); +void sme_dhcp_done_ind(tHalHandle hal, uint8_t session_id); QDF_STATUS sme_roam_stop_bss(tHalHandle hHal, uint8_t sessionId); QDF_STATUS sme_roam_get_associated_stas(tHalHandle hHal, uint8_t sessionId, QDF_MODULE_ID modId, void *pUsrContext, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 987e5efaa855..7f8305846b4d 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -3992,6 +3992,29 @@ QDF_STATUS sme_roam_disconnect(tHalHandle hHal, uint8_t sessionId, return status; } +/* sme_dhcp_done_ind() - send dhcp done ind + * @hal: hal context + * @session_id: session id + * + * Return: void. + */ +void sme_dhcp_done_ind(tHalHandle hal, uint8_t session_id) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + tCsrRoamSession *session; + + if (!mac_ctx) + return; + + session = CSR_GET_SESSION(mac_ctx, session_id); + if (!session) { + sms_log(mac_ctx, LOGE, + FL("session %d not found"), session_id); + return; + } + session->dhcp_done = true; +} + /* --------------------------------------------------------------------------- \fn sme_roam_stop_bss \brief To stop BSS for Soft AP. This is an asynchronous API. diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 364f71c5e36d..fd3d19bb2148 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -7522,6 +7522,8 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, sme_bss_type_to_string(pProfile->BSSType), pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]); + /* Reset dhcp_done for the fresh connection */ + pSession->dhcp_done = false; csr_roam_cancel_roaming(pMac, sessionId); csr_scan_remove_fresh_scan_command(pMac, sessionId); /* Only abort the scan if its not used for other roam/connect purpose */