Bladeren bron

qcacld-3.0: Fix TDLS mode problem in P2P client operation

TDLS mode is incorrectly set in P2P remain on channel operation, and
due to this TDLS connection happens in P2P client mode, even when it
is not configured.
Set the correct TDLS mode in P2P ROC operation.

Change-Id: I480f09b03da8637ec4fc283b8feb2c08b0917ac4
CRs-Fixed: 1112790
Kabilan Kannan 8 jaren geleden
bovenliggende
commit
8657a7e195
2 gewijzigde bestanden met toevoegingen van 15 en 13 verwijderingen
  1. 1 1
      core/hdd/src/wlan_hdd_p2p.c
  2. 14 12
      core/hdd/src/wlan_hdd_tdls.c

+ 1 - 1
core/hdd/src/wlan_hdd_p2p.c

@@ -527,7 +527,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data)
 			pRemainChanCtx->scan_id);
 	}
 
-	hdd_restart_tdls_source_timer(hdd_ctx, eTDLS_SUPPORT_ENABLED);
+	hdd_restart_tdls_source_timer(hdd_ctx, hdd_ctx->tdls_mode_last);
 	qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc);
 	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
 }

+ 14 - 12
core/hdd/src/wlan_hdd_tdls.c

@@ -645,6 +645,17 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx, bool ssr)
 	hdd_ctx->tdls_nss_teardown_complete = false;
 	hdd_ctx->tdls_nss_transition_mode = TDLS_NSS_TRANSITION_UNKNOWN;
 
+	if (false == hdd_ctx->config->fEnableTDLSImplicitTrigger) {
+		hdd_ctx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY;
+		hdd_notice("TDLS Implicit trigger not enabled!");
+	} else if (true == hdd_ctx->config->fTDLSExternalControl) {
+		hdd_ctx->tdls_mode = eTDLS_SUPPORT_EXTERNAL_CONTROL;
+	} else {
+		hdd_ctx->tdls_mode = eTDLS_SUPPORT_ENABLED;
+	}
+
+	hdd_ctx->tdls_mode_last = hdd_ctx->tdls_mode;
+
 	if (hdd_ctx->config->fEnableTDLSSleepSta ||
 	    hdd_ctx->config->fEnableTDLSBufferSta ||
 	    hdd_ctx->config->fEnableTDLSOffChannel)
@@ -797,15 +808,6 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
 	pHddTdlsCtx->threshold_config.rssi_delta =
 		pHddCtx->config->fTDLSRSSIDelta;
 
-	if (false == pHddCtx->config->fEnableTDLSImplicitTrigger) {
-		pHddCtx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY;
-		hdd_notice("TDLS Implicit trigger not enabled!");
-	} else if (true == pHddCtx->config->fTDLSExternalControl) {
-		pHddCtx->tdls_mode = eTDLS_SUPPORT_EXTERNAL_CONTROL;
-	} else {
-		pHddCtx->tdls_mode = eTDLS_SUPPORT_ENABLED;
-	}
-
 	INIT_DELAYED_WORK(&pHddCtx->tdls_scan_ctxt.tdls_scan_work,
 			  wlan_hdd_tdls_schedule_scan);
 
@@ -6041,8 +6043,8 @@ void wlan_hdd_change_tdls_mode(void *data)
 {
 	hdd_context_t *hdd_ctx = (hdd_context_t *)data;
 
-	wlan_hdd_tdls_set_mode(hdd_ctx, eTDLS_SUPPORT_ENABLED, false,
-			       HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL);
+	wlan_hdd_tdls_set_mode(hdd_ctx, hdd_ctx->tdls_mode_last, false,
+			       HDD_SET_TDLS_MODE_SOURCE_P2P);
 }
 
 /**
@@ -6064,7 +6066,7 @@ void hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx,
 
 	if (tdls_mode == eTDLS_SUPPORT_DISABLED) {
 		wlan_hdd_tdls_set_mode(pHddCtx, tdls_mode, false,
-				HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL);
+				HDD_SET_TDLS_MODE_SOURCE_P2P);
 		wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx);
 	}