Bladeren bron

qcacld-3.0: Limit ROC for listen if NAN or NDI present

In P2P, if NDP is present, limit max ROC duration to
400ms on DBS and 250ms on non-DBS case.
If NAN is present, limit max ROC duration to 450ms on DBS
and 300ms on non-DBS case.

Change-Id: I2e943d2f55984464812bba16ca78dfab8681cf30
CRs-Fixed: 3046904
Deeksha Gupta 3 jaren geleden
bovenliggende
commit
1bdf606dab
2 gewijzigde bestanden met toevoegingen van 40 en 5 verwijderingen
  1. 35 4
      components/p2p/core/src/wlan_p2p_roc.c
  2. 5 1
      components/p2p/core/src/wlan_p2p_roc.h

+ 35 - 4
components/p2p/core/src/wlan_p2p_roc.c

@@ -82,7 +82,9 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 	struct wlan_objmgr_vdev *vdev;
 	struct p2p_soc_priv_obj *p2p_soc_obj = roc_ctx->p2p_soc_obj;
 	uint32_t go_num;
+	uint8_t ndp_num = 0, nan_disc_enabled_num = 0;
 	struct wlan_objmgr_pdev *pdev;
+	bool is_dbs;
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
 			p2p_soc_obj->soc, roc_ctx->vdev_id,
@@ -123,7 +125,17 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 	if (req->scan_req.dwell_time_passive < P2P_MAX_ROC_DURATION) {
 		go_num = policy_mgr_mode_specific_connection_count(
 				p2p_soc_obj->soc, PM_P2P_GO_MODE, NULL);
-		p2p_debug("present go number:%d", go_num);
+		policy_mgr_mode_specific_num_active_sessions(p2p_soc_obj->soc,
+							     QDF_NDI_MODE,
+							     &ndp_num);
+		policy_mgr_mode_specific_num_active_sessions(p2p_soc_obj->soc,
+							     QDF_NAN_DISC_MODE,
+							     &nan_disc_enabled_num);
+		p2p_debug("present go number:%d, NDP number:%d, NAN number:%d",
+			  go_num, ndp_num, nan_disc_enabled_num);
+
+		is_dbs = policy_mgr_is_hw_dbs_capable(p2p_soc_obj->soc);
+
 		if (go_num)
 		/* Add fixed 300ms extra ROC time instead of multiplying the
 		 * ROC duration by const value as this causes the ROC to be
@@ -144,12 +156,31 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 		 * give a higher value from supplicant
 		 */
 		if (go_num && req->scan_req.dwell_time_passive >
-		    P2P_MAX_ROC_DURATION_GO_PRESENT)
+		    P2P_MAX_ROC_DURATION_GO_PRESENT) {
 			req->scan_req.dwell_time_passive =
 					P2P_MAX_ROC_DURATION_GO_PRESENT;
-		else if (req->scan_req.dwell_time_passive >
-			 P2P_MAX_ROC_DURATION)
+		} else if (ndp_num) {
+			if (is_dbs && req->scan_req.dwell_time_passive >
+			    P2P_MAX_ROC_DURATION_DBS_NDP_PRESENT)
+				req->scan_req.dwell_time_passive =
+					P2P_MAX_ROC_DURATION_DBS_NDP_PRESENT;
+			else if (!is_dbs && req->scan_req.dwell_time_passive >
+				 P2P_MAX_ROC_DURATION_NON_DBS_NDP_PRESENT)
+				req->scan_req.dwell_time_passive =
+					P2P_MAX_ROC_DURATION_NON_DBS_NDP_PRESENT;
+		} else if (nan_disc_enabled_num) {
+			if (is_dbs && req->scan_req.dwell_time_passive >
+			    P2P_MAX_ROC_DURATION_DBS_NAN_PRESENT)
+				req->scan_req.dwell_time_passive =
+					P2P_MAX_ROC_DURATION_DBS_NAN_PRESENT;
+			else if (!is_dbs && req->scan_req.dwell_time_passive >
+				 P2P_MAX_ROC_DURATION_NON_DBS_NAN_PRESENT)
+				req->scan_req.dwell_time_passive =
+					P2P_MAX_ROC_DURATION_NON_DBS_NAN_PRESENT;
+		} else if (req->scan_req.dwell_time_passive >
+			 P2P_MAX_ROC_DURATION) {
 			req->scan_req.dwell_time_passive = P2P_MAX_ROC_DURATION;
+		}
 	}
 	p2p_debug("FW requested roc duration is:%d",
 		  req->scan_req.dwell_time_passive);

+ 5 - 1
components/p2p/core/src/wlan_p2p_roc.h

@@ -31,7 +31,11 @@
 #define P2P_WAIT_CANCEL_ROC      1000
 #define P2P_WAIT_CLEANUP_ROC     2000
 #define P2P_MAX_ROC_DURATION     1500
-#define P2P_MAX_ROC_DURATION_GO_PRESENT     600
+#define P2P_MAX_ROC_DURATION_GO_PRESENT           600
+#define P2P_MAX_ROC_DURATION_DBS_NDP_PRESENT      400
+#define P2P_MAX_ROC_DURATION_NON_DBS_NDP_PRESENT  250
+#define P2P_MAX_ROC_DURATION_DBS_NAN_PRESENT      450
+#define P2P_MAX_ROC_DURATION_NON_DBS_NAN_PRESENT  300
 
 #define P2P_ROC_DURATION_MULTI_GO_PRESENT   300
 #define P2P_ROC_DURATION_MULTI_GO_ABSENT    10