浏览代码

qcacld-3.0: Start the driver roc timer same as supplicant requested

Driver multiplies the supplicant requested roc duration by either
6 or 10 times and then requests FW roc of that much duration.
This is because to extend the roc after rx frame is received.
Currently, host is initializing the internal roc timer for the
duration same as requested to FW.
In such case we cannot extend the roc as currently there is only check
for timer running, but not the remaining time. And FW may give
scan completion event immediately after sending the tx frame.

Change-Id: Ib864949d232c31422f83d78bd6b318cadbf13366
CRs-Fixed: 2397924
Bala Venkatesh 6 年之前
父节点
当前提交
31cca2f512
共有 1 个文件被更改,包括 21 次插入15 次删除
  1. 21 15
      components/p2p/core/src/wlan_p2p_roc.c

+ 21 - 15
components/p2p/core/src/wlan_p2p_roc.c

@@ -81,6 +81,7 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 	struct scan_start_request *req;
 	struct wlan_objmgr_vdev *vdev;
 	struct p2p_soc_priv_obj *p2p_soc_obj = roc_ctx->p2p_soc_obj;
+	uint32_t go_num;
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
 			p2p_soc_obj->soc, roc_ctx->vdev_id,
@@ -98,6 +99,7 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 	}
 
 	ucfg_scan_init_default_params(vdev, req);
+
 	roc_ctx->scan_id = ucfg_scan_get_scan_id(p2p_soc_obj->soc);
 	req->vdev = vdev;
 	req->scan_req.scan_id = roc_ctx->scan_id;
@@ -111,6 +113,25 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 	req->scan_req.num_bssid = 1;
 	qdf_set_macaddr_broadcast(&req->scan_req.bssid_list[0]);
 
+	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);
+		if (go_num)
+			req->scan_req.dwell_time_passive *=
+					P2P_ROC_DURATION_MULTI_GO_PRESENT;
+		else
+			req->scan_req.dwell_time_passive *=
+					P2P_ROC_DURATION_MULTI_GO_ABSENT;
+		/* this is to protect too huge value if some customers
+		 * give a higher value from supplicant
+		 */
+		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 for chan: %d",
+		  req->scan_req.dwell_time_passive, roc_ctx->chan);
+
 	status = ucfg_scan_start(req);
 
 	p2p_debug("start scan, scan req id:%d, scan id:%d, status:%d",
@@ -347,7 +368,6 @@ static void p2p_roc_timeout(void *pdata)
 static QDF_STATUS p2p_execute_roc_req(struct p2p_roc_context *roc_ctx)
 {
 	QDF_STATUS status;
-	uint32_t go_num;
 	struct p2p_soc_priv_obj *p2p_soc_obj = roc_ctx->p2p_soc_obj;
 
 	p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d, scan_id:%d, tx ctx:%pK, chan:%d, phy_mode:%d, duration:%d, roc_type:%d, roc_state:%d",
@@ -368,20 +388,6 @@ static QDF_STATUS p2p_execute_roc_req(struct p2p_roc_context *roc_ctx)
 	}
 
 	roc_ctx->roc_state = ROC_STATE_REQUESTED;
-	if (roc_ctx->duration < 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);
-		if (go_num)
-			roc_ctx->duration *= P2P_ROC_DURATION_MULTI_GO_PRESENT;
-		else
-			roc_ctx->duration *= P2P_ROC_DURATION_MULTI_GO_ABSENT;
-		/* this is to protect too huge value if some customers
-		 * give a higher value from supplicant
-		 */
-		if (roc_ctx->duration > P2P_MAX_ROC_DURATION)
-			roc_ctx->duration = P2P_MAX_ROC_DURATION;
-	}
 	status = p2p_scan_start(roc_ctx);
 	if (status != QDF_STATUS_SUCCESS) {
 		qdf_mc_timer_destroy(&roc_ctx->roc_timer);