Forráskód Böngészése

qcacld-3.0: Update TDLS current mode only for TDLS enabled vdev

When scan is complete, tdls notifier tries to update the
tdls_current_mode for all available TDLS & P2P vdev. This causes
the TDLS current mode to enabled wrongly and further add peer gets
honored for P2P Client vdev in STA + P2P client concurrency.

So avoid changing current mode for P2P cli when STA vdev is
present.

Also add check for P2P CLI mode in tdls_check_is_tdls_allowed()
to avoid tdls commands going on P2P client vdev.

Change-Id: I681de9781a4892e307681da5699ca7b30f8f9651
CRs-Fixed: 3626695
Pragaspathi Thilagaraj 1 éve
szülő
commit
0f95a0d1a3

+ 5 - 3
components/tdls/core/src/wlan_tdls_cmds_process.c

@@ -2058,8 +2058,6 @@ QDF_STATUS tdls_process_setup_peer(struct tdls_oper_request *req)
 	uint32_t pref_width;
 	struct wlan_objmgr_pdev *pdev;
 
-	tdls_debug("Configure external TDLS peer " QDF_MAC_ADDR_FMT,
-		   QDF_MAC_ADDR_REF(req->peer_addr));
 
 	/* reference cnt is acquired in ucfg_tdls_oper */
 	vdev = req->vdev;
@@ -2070,11 +2068,15 @@ QDF_STATUS tdls_process_setup_peer(struct tdls_oper_request *req)
 	}
 
 	if (!tdls_check_is_tdls_allowed(vdev)) {
-		tdls_err("TDLS not allowed, Reject setup peer");
+		tdls_err("TDLS not allowed on vdev:%d, Reject setup peer",
+			 wlan_vdev_get_id(vdev));
 		status = QDF_STATUS_E_INVAL;
 		goto error;
 	}
 
+	tdls_debug("vdev:%d Configure external TDLS peer " QDF_MAC_ADDR_FMT,
+		   wlan_vdev_get_id(vdev),
+		   QDF_MAC_ADDR_REF(req->peer_addr));
 	qdf_mem_zero(&peer_req, sizeof(peer_req));
 	peer_req.vdev = vdev;
 	qdf_mem_copy(peer_req.peer_addr, req->peer_addr, QDF_MAC_ADDR_SIZE);

+ 43 - 21
components/tdls/core/src/wlan_tdls_main.c

@@ -997,7 +997,16 @@ bool tdls_check_is_tdls_allowed(struct wlan_objmgr_vdev *vdev)
 	     tdls_is_concurrency_allowed(tdls_soc_obj->soc))) {
 		state = true;
 	} else {
-		tdls_warn("Concurrent sessions exist disable TDLS");
+		tdls_warn("vdev:%d Concurrent sessions exist disable TDLS",
+			  wlan_vdev_get_id(vdev));
+		state = false;
+		goto exit;
+	}
+
+	if (wlan_vdev_mlme_get_opmode(vdev) == QDF_P2P_CLIENT_MODE && sta_count) {
+		tdls_warn("vdev:%d Concurrent STA exists. TDLS not allowed for P2P vdev",
+			  wlan_vdev_get_id(vdev));
+		state = false;
 		goto exit;
 	}
 
@@ -1507,7 +1516,8 @@ void tdls_process_enable_for_vdev(struct wlan_objmgr_vdev *vdev)
 							      NULL);
 	opmode = wlan_vdev_mlme_get_opmode(vdev);
 	if (opmode == QDF_P2P_CLIENT_MODE && sta_count) {
-		tdls_debug("STA + P2P concurrency. Don't allow TDLS on P2P vdev");
+		tdls_debug("STA + P2P concurrency. Don't allow TDLS on P2P vdev:%d",
+			   wlan_vdev_get_id(vdev));
 		return;
 	}
 
@@ -1827,18 +1837,17 @@ static void tdls_set_mode_in_vdev(struct tdls_vdev_priv_obj *tdls_vdev,
 				  enum tdls_feature_mode tdls_mode,
 				  enum tdls_disable_sources source)
 {
-	if (!tdls_vdev)
-		return;
-	tdls_debug("enter tdls mode is %d", tdls_mode);
+	tdls_debug("set tdls mode: %d source:%d", tdls_mode,
+		   source);
 
-	if (TDLS_SUPPORT_IMP_MODE == tdls_mode ||
-	    TDLS_SUPPORT_EXT_CONTROL == tdls_mode) {
-		clear_bit((unsigned long)source,
-			  &tdls_soc->tdls_source_bitmap);
+	switch (tdls_mode) {
+	case TDLS_SUPPORT_IMP_MODE:
+		fallthrough;
+	case TDLS_SUPPORT_EXT_CONTROL:
+		clear_bit((unsigned long)source, &tdls_soc->tdls_source_bitmap);
 		/*
 		 * Check if any TDLS source bit is set and if
-		 * bitmap is not zero then we should not
-		 * enable TDLS
+		 * bitmap is not zero then we should not enable TDLS
 		 */
 		if (tdls_soc->tdls_source_bitmap) {
 			tdls_notice("Don't enable TDLS, source bitmap: %lu",
@@ -1846,12 +1855,15 @@ static void tdls_set_mode_in_vdev(struct tdls_vdev_priv_obj *tdls_vdev,
 			return;
 		}
 		tdls_implicit_enable(tdls_vdev);
-		/* tdls implicit mode is enabled, so
-		 * enable the connection tracker
+		/*
+		 * tdls implicit mode is enabled, so enable the connection
+		 * tracker
 		 */
-		tdls_soc->enable_tdls_connection_tracker =
-			true;
-	} else if (TDLS_SUPPORT_DISABLED == tdls_mode) {
+		tdls_soc->enable_tdls_connection_tracker = true;
+
+		return;
+
+	case TDLS_SUPPORT_DISABLED:
 		set_bit((unsigned long)source,
 			&tdls_soc->tdls_source_bitmap);
 		tdls_implicit_disable(tdls_vdev);
@@ -1859,7 +1871,10 @@ static void tdls_set_mode_in_vdev(struct tdls_vdev_priv_obj *tdls_vdev,
 		 * stop the connection tracker.
 		 */
 		tdls_soc->enable_tdls_connection_tracker = false;
-	} else if (TDLS_SUPPORT_EXP_TRIG_ONLY == tdls_mode) {
+
+		return;
+
+	case TDLS_SUPPORT_EXP_TRIG_ONLY:
 		clear_bit((unsigned long)source,
 			  &tdls_soc->tdls_source_bitmap);
 		tdls_implicit_disable(tdls_vdev);
@@ -1875,8 +1890,11 @@ static void tdls_set_mode_in_vdev(struct tdls_vdev_priv_obj *tdls_vdev,
 		 */
 		if (tdls_soc->tdls_source_bitmap)
 			return;
+
+		return;
+	default:
+		return;
 	}
-	tdls_debug("exit ");
 }
 
 /**
@@ -1932,12 +1950,15 @@ static void tdls_set_current_mode(struct tdls_soc_priv_obj *tdls_soc,
 							QDF_STA_MODE,
 							WLAN_TDLS_NB_ID);
 	if (vdev) {
-		tdls_debug("set mode in tdls vdev ");
+		tdls_debug("set mode in tdls STA vdev:%d",
+			   wlan_vdev_get_id(vdev));
 		tdls_vdev = wlan_vdev_get_tdls_vdev_obj(vdev);
 		if (tdls_vdev)
 			tdls_set_mode_in_vdev(tdls_vdev, tdls_soc,
 					      tdls_mode, source);
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID);
+
+		goto exit;
 	}
 
 	/* get p2p client vdev */
@@ -1945,7 +1966,8 @@ static void tdls_set_current_mode(struct tdls_soc_priv_obj *tdls_soc,
 							QDF_P2P_CLIENT_MODE,
 							WLAN_TDLS_NB_ID);
 	if (vdev) {
-		tdls_debug("set mode in tdls vdev ");
+		tdls_debug("set mode in tdls P2P cli vdev:%d",
+			   wlan_vdev_get_id(vdev));
 		tdls_vdev = wlan_vdev_get_tdls_vdev_obj(vdev);
 		if (tdls_vdev)
 			tdls_set_mode_in_vdev(tdls_vdev, tdls_soc,
@@ -1953,11 +1975,11 @@ static void tdls_set_current_mode(struct tdls_soc_priv_obj *tdls_soc,
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID);
 	}
 
+exit:
 	if (!update_last)
 		tdls_soc->tdls_last_mode = tdls_soc->tdls_current_mode;
 
 	tdls_soc->tdls_current_mode = tdls_mode;
-
 }
 
 QDF_STATUS tdls_set_operation_mode(struct tdls_set_mode_params *tdls_set_mode)