Ver código fonte

qcacld-3.0: Block the RRM measurement request till DHCP is completed

qcacld-2.0 to qcacld-3.0 propagation

When RRM measurement request is received, it triggers a RRM scan.
Now if DHCP is in progress when this scan is triggered, DHCP may
fail leading to disconnect.

To avoid this block the RRM measurement request till DHCP is
completed or DHCP timeout happens.

Change-Id: I9f84bdc04519363933b5de3229bee9d1c4f9fe43
CRs-Fixed: 1020108
Abhishek Singh 8 anos atrás
pai
commit
ca4080369e

+ 11 - 0
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);

+ 8 - 2
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;
 

+ 1 - 0
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 {

+ 1 - 0
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,

+ 23 - 0
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.

+ 2 - 0
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 */