Jelajahi Sumber

qcacld-3.0: Rename variables name chan to chan_freq of wlan_hdd_mgmt_tx

We have fixed using channel number as internal parameter instead of
chan frequency with change I60fe37d7d716eeaceaa00f3fb59c77b629ebacac,
but variables name are still chan which might cause confused to reader.

Rename all places where "chan" to "chan_freq", which actually channel
frequency used. And alter miss APIs which still expect channel number.

Change-Id: I948cbad133a17093f49384b563966d2c53b51707
CRs-Fixed: 3033951
Will Huang 3 tahun lalu
induk
melakukan
a54bb30ccb

+ 36 - 33
components/p2p/core/src/wlan_p2p_off_chan_tx.c

@@ -209,7 +209,7 @@ static QDF_STATUS p2p_check_and_update_channel(struct tx_action_context *tx_ctx)
 	struct p2p_soc_priv_obj *p2p_soc_obj;
 	struct p2p_roc_context *curr_roc_ctx;
 
-	if (!tx_ctx || tx_ctx->chan) {
+	if (!tx_ctx || tx_ctx->chan_freq) {
 		p2p_err("NULL tx ctx or channel valid");
 		return QDF_STATUS_E_INVAL;
 	}
@@ -230,7 +230,7 @@ static QDF_STATUS p2p_check_and_update_channel(struct tx_action_context *tx_ctx)
 	    (mode == QDF_P2P_DEVICE_MODE ||
 	     mode == QDF_P2P_CLIENT_MODE ||
 	     mode == QDF_P2P_GO_MODE))
-		tx_ctx->chan = curr_roc_ctx->chan;
+		tx_ctx->chan_freq = curr_roc_ctx->chan_freq;
 
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_P2P_ID);
 
@@ -1064,7 +1064,6 @@ static QDF_STATUS p2p_mgmt_tx(struct tx_action_context *tx_ctx,
 	void *mac_addr;
 	uint8_t pdev_id;
 	struct wlan_objmgr_vdev *vdev;
-	qdf_freq_t chanfreq = 0;
 	struct wlan_objmgr_pdev *pdev;
 
 	psoc = tx_ctx->p2p_soc_obj->soc;
@@ -1084,10 +1083,7 @@ static QDF_STATUS p2p_mgmt_tx(struct tx_action_context *tx_ctx,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	if (tx_ctx->chan)
-		chanfreq = tx_ctx->chan;
-
-	mgmt_param.chanfreq = chanfreq;
+	mgmt_param.chanfreq = tx_ctx->chan_freq;
 
 	mgmt_param.qdf_ctx = wlan_psoc_get_qdf_dev(psoc);
 	if (!(mgmt_param.qdf_ctx)) {
@@ -1165,7 +1161,7 @@ static QDF_STATUS p2p_roc_req_for_tx_action(
 	p2p_soc_obj = tx_ctx->p2p_soc_obj;
 	roc_ctx->p2p_soc_obj = p2p_soc_obj;
 	roc_ctx->vdev_id = tx_ctx->vdev_id;
-	roc_ctx->chan = tx_ctx->chan;
+	roc_ctx->chan_freq = tx_ctx->chan_freq;
 	roc_ctx->duration = tx_ctx->duration;
 	roc_ctx->roc_state = ROC_STATE_IDLE;
 	roc_ctx->roc_type = OFF_CHANNEL_TX;
@@ -1808,13 +1804,15 @@ void p2p_dump_tx_queue(struct p2p_soc_priv_obj *p2p_soc_obj)
 	while (QDF_IS_STATUS_SUCCESS(status)) {
 		tx_ctx = qdf_container_of(p_node,
 				struct tx_action_context, node);
-		p2p_debug("p2p soc object:%pK, tx ctx:%pK, vdev_id:%d, scan_id:%d, roc_cookie:%llx, chan:%d, buf:%pK, len:%d, off_chan:%d, cck:%d, ack:%d, duration:%d",
-			p2p_soc_obj, tx_ctx,
-			tx_ctx->vdev_id, tx_ctx->scan_id,
-			tx_ctx->roc_cookie, tx_ctx->chan,
-			tx_ctx->buf, tx_ctx->buf_len,
-			tx_ctx->off_chan, tx_ctx->no_cck,
-			tx_ctx->no_ack, tx_ctx->duration);
+		p2p_debug("p2p soc object:%pK, tx ctx:%pK, vdev_id:%d, "
+			  "scan_id:%d, roc_cookie:%llx, freq:%d, buf:%pK, "
+			  "len:%d, off_chan:%d, cck:%d, ack:%d, duration:%d",
+			  p2p_soc_obj, tx_ctx,
+			  tx_ctx->vdev_id, tx_ctx->scan_id,
+			  tx_ctx->roc_cookie, tx_ctx->chan_freq,
+			  tx_ctx->buf, tx_ctx->buf_len,
+			  tx_ctx->off_chan, tx_ctx->no_cck,
+			  tx_ctx->no_ack, tx_ctx->duration);
 
 		status = qdf_list_peek_next(&p2p_soc_obj->tx_q_roc,
 						p_node, &p_node);
@@ -1826,13 +1824,15 @@ void p2p_dump_tx_queue(struct p2p_soc_priv_obj *p2p_soc_obj)
 	while (QDF_IS_STATUS_SUCCESS(status)) {
 		tx_ctx = qdf_container_of(p_node,
 				struct tx_action_context, node);
-		p2p_debug("p2p soc object:%pK, tx_ctx:%pK, vdev_id:%d, scan_id:%d, roc_cookie:%llx, chan:%d, buf:%pK, len:%d, off_chan:%d, cck:%d, ack:%d, duration:%d",
-			p2p_soc_obj, tx_ctx,
-			tx_ctx->vdev_id, tx_ctx->scan_id,
-			tx_ctx->roc_cookie, tx_ctx->chan,
-			tx_ctx->buf, tx_ctx->buf_len,
-			tx_ctx->off_chan, tx_ctx->no_cck,
-			tx_ctx->no_ack, tx_ctx->duration);
+		p2p_debug("p2p soc object:%pK, tx_ctx:%pK, vdev_id:%d, "
+			  "scan_id:%d, roc_cookie:%llx, freq:%d, buf:%pK, "
+			  "len:%d, off_chan:%d, cck:%d, ack:%d, duration:%d",
+			  p2p_soc_obj, tx_ctx,
+			  tx_ctx->vdev_id, tx_ctx->scan_id,
+			  tx_ctx->roc_cookie, tx_ctx->chan_freq,
+			  tx_ctx->buf, tx_ctx->buf_len,
+			  tx_ctx->off_chan, tx_ctx->no_cck,
+			  tx_ctx->no_ack, tx_ctx->duration);
 
 		status = qdf_list_peek_next(&p2p_soc_obj->tx_q_ack,
 						p_node, &p_node);
@@ -2923,7 +2923,7 @@ void p2p_rand_mac_tx(struct wlan_objmgr_pdev *pdev,
 		return;
 	soc = tx_action->p2p_soc_obj->soc;
 
-	if (!tx_action->no_ack && tx_action->chan &&
+	if (!tx_action->no_ack && tx_action->chan_freq &&
 	    tx_action->buf_len > MIN_MAC_HEADER_LEN &&
 	    p2p_is_vdev_support_rand_mac_by_id(soc, tx_action->vdev_id) &&
 	    p2p_is_random_mac(soc, tx_action->vdev_id,
@@ -2931,7 +2931,7 @@ void p2p_rand_mac_tx(struct wlan_objmgr_pdev *pdev,
 		status = p2p_request_random_mac(
 			soc, tx_action->vdev_id,
 			&tx_action->buf[SRC_MAC_ADDR_OFFSET],
-			wlan_reg_legacy_chan_to_freq(pdev, tx_action->chan),
+			tx_action->chan_freq,
 			tx_action->id,
 			tx_action->duration);
 		if (status == QDF_STATUS_SUCCESS)
@@ -3003,11 +3003,13 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
 
 	p2p_soc_obj = tx_ctx->p2p_soc_obj;
 
-	p2p_debug("soc:%pK, tx_ctx:%pK, vdev_id:%d, scan_id:%d, roc_cookie:%llx, chan:%d, buf:%pK, len:%d, off_chan:%d, cck:%d, ack:%d, duration:%d",
-		p2p_soc_obj->soc, tx_ctx, tx_ctx->vdev_id,
-		tx_ctx->scan_id, tx_ctx->roc_cookie, tx_ctx->chan,
-		tx_ctx->buf, tx_ctx->buf_len, tx_ctx->off_chan,
-		tx_ctx->no_cck, tx_ctx->no_ack, tx_ctx->duration);
+	p2p_debug("soc:%pK, tx_ctx:%pK, vdev_id:%d, scan_id:%d, "
+		  "roc_cookie:%llx, freq:%d, buf:%pK, len:%d, "
+		  "off_chan:%d, cck:%d, ack:%d, duration:%d",
+		  p2p_soc_obj->soc, tx_ctx, tx_ctx->vdev_id,
+		  tx_ctx->scan_id, tx_ctx->roc_cookie, tx_ctx->chan_freq,
+		  tx_ctx->buf, tx_ctx->buf_len, tx_ctx->off_chan,
+		  tx_ctx->no_cck, tx_ctx->no_ack, tx_ctx->duration);
 
 	status = p2p_get_frame_info(tx_ctx->buf, tx_ctx->buf_len,
 			&(tx_ctx->frame_info));
@@ -3036,8 +3038,8 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
 		tx_ctx->no_ack = 1;
 	}
 
-	if (!tx_ctx->off_chan || !tx_ctx->chan) {
-		if (!tx_ctx->chan)
+	if (!tx_ctx->off_chan || !tx_ctx->chan_freq) {
+		if (!tx_ctx->chan_freq)
 			p2p_check_and_update_channel(tx_ctx);
 		status = p2p_execute_tx_action_frame(tx_ctx);
 		if (status != QDF_STATUS_SUCCESS) {
@@ -3049,7 +3051,7 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
 
 	/* For off channel tx case */
 	curr_roc_ctx = p2p_find_current_roc_ctx(p2p_soc_obj);
-	if (curr_roc_ctx && (curr_roc_ctx->chan == tx_ctx->chan)) {
+	if (curr_roc_ctx && (curr_roc_ctx->chan_freq == tx_ctx->chan_freq)) {
 		if ((curr_roc_ctx->roc_state == ROC_STATE_REQUESTED) ||
 		    (curr_roc_ctx->roc_state == ROC_STATE_STARTED)) {
 			tx_ctx->roc_cookie = (uintptr_t)curr_roc_ctx;
@@ -3080,7 +3082,8 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
 		}
 	}
 
-	curr_roc_ctx = p2p_find_roc_by_chan(p2p_soc_obj, tx_ctx->chan);
+	curr_roc_ctx = p2p_find_roc_by_chan_freq(p2p_soc_obj,
+						 tx_ctx->chan_freq);
 	if (curr_roc_ctx && (curr_roc_ctx->roc_state == ROC_STATE_IDLE)) {
 		tx_ctx->roc_cookie = (uintptr_t)curr_roc_ctx;
 		status = qdf_list_insert_back(

+ 2 - 2
components/p2p/core/src/wlan_p2p_off_chan_tx.h

@@ -156,7 +156,7 @@ struct p2p_frame_info {
  * @scan_id:        Scan id given by scan component for this roc req
  * @roc_cookie:     Cookie for remain on channel request
  * @id:             Identifier of this tx context
- * @chan:           Chan for which this tx has been requested
+ * @chan_freq:      Chan frequency for which this tx has been requested
  * @buf:            tx buffer
  * @buf_len:        Length of tx buffer
  * @off_chan:       Is this off channel tx
@@ -173,7 +173,7 @@ struct tx_action_context {
 	int scan_id;
 	uint64_t roc_cookie;
 	int32_t id;
-	qdf_freq_t chan;
+	qdf_freq_t chan_freq;
 	uint8_t *buf;
 	int buf_len;
 	bool off_chan;

+ 51 - 37
components/p2p/core/src/wlan_p2p_roc.c

@@ -113,7 +113,7 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx)
 	req->scan_req.scan_type = SCAN_TYPE_P2P_LISTEN;
 	req->scan_req.scan_req_id = p2p_soc_obj->scan_req_id;
 	req->scan_req.chan_list.num_chan = 1;
-	req->scan_req.chan_list.chan[0].freq = roc_ctx->chan;
+	req->scan_req.chan_list.chan[0].freq = roc_ctx->chan_freq;
 	req->scan_req.dwell_time_passive = roc_ctx->duration;
 	req->scan_req.dwell_time_active = 0;
 	req->scan_req.scan_priority = SCAN_PRIORITY_HIGH;
@@ -245,7 +245,7 @@ static QDF_STATUS p2p_send_roc_event(
 	p2p_evt.vdev_id = roc_ctx->vdev_id;
 	p2p_evt.roc_event = evt;
 	p2p_evt.cookie = (uint64_t)roc_ctx->id;
-	p2p_evt.chan = roc_ctx->chan;
+	p2p_evt.chan_freq = roc_ctx->chan_freq;
 	p2p_evt.duration = roc_ctx->duration;
 
 	p2p_debug("roc_event: %d, cookie:%llx", p2p_evt.roc_event,
@@ -272,9 +272,10 @@ static QDF_STATUS p2p_destroy_roc_ctx(struct p2p_roc_context *roc_ctx,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct p2p_soc_priv_obj *p2p_soc_obj = roc_ctx->p2p_soc_obj;
 
-	p2p_debug("p2p_soc_obj:%pK, roc_ctx:%pK, up_layer_event:%d, in_roc_queue:%d vdev_id:%d chan:%d duration:%d",
-		p2p_soc_obj, roc_ctx, up_layer_event, in_roc_queue,
-		roc_ctx->vdev_id, roc_ctx->chan, roc_ctx->duration);
+	p2p_debug("p2p_soc_obj:%pK, roc_ctx:%pK, up_layer_event:%d,"
+		  " in_roc_queue:%d vdev_id:%d freq:%d duration:%d",
+		  p2p_soc_obj, roc_ctx, up_layer_event, in_roc_queue,
+		  roc_ctx->vdev_id, roc_ctx->chan_freq, roc_ctx->duration);
 
 	if (up_layer_event) {
 		if (roc_ctx->roc_state < ROC_STATE_ON_CHAN)
@@ -358,11 +359,13 @@ static void p2p_roc_timeout(void *pdata)
 		return;
 	}
 
-	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",
-		roc_ctx->p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
-		roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan,
-		roc_ctx->phy_mode, roc_ctx->duration,
-		roc_ctx->roc_type, roc_ctx->roc_state);
+	p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d, scan_id:%d,"
+		  " tx ctx:%pK, freq:%d, phy_mode:%d, duration:%d,"
+		  " roc_type:%d, roc_state:%d",
+		  roc_ctx->p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
+		  roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan_freq,
+		  roc_ctx->phy_mode, roc_ctx->duration,
+		  roc_ctx->roc_type, roc_ctx->roc_state);
 
 	if (roc_ctx->roc_state == ROC_STATE_CANCEL_IN_PROG) {
 		p2p_err("Cancellation already in progress");
@@ -385,11 +388,13 @@ static QDF_STATUS p2p_execute_roc_req(struct p2p_roc_context *roc_ctx)
 	QDF_STATUS status;
 	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",
-		p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
-		roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan,
-		roc_ctx->phy_mode, roc_ctx->duration,
-		roc_ctx->roc_type, roc_ctx->roc_state);
+	p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d, scan_id:%d,"
+		  " tx ctx:%pK, freq:%d, phy_mode:%d, duration:%d,"
+		  " roc_type:%d, roc_state:%d",
+		  p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
+		  roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan_freq,
+		  roc_ctx->phy_mode, roc_ctx->duration,
+		  roc_ctx->roc_type, roc_ctx->roc_state);
 
 	/* prevent runtime suspend */
 	qdf_runtime_pm_prevent_suspend(&p2p_soc_obj->roc_runtime_lock);
@@ -612,14 +617,14 @@ struct p2p_roc_context *p2p_find_current_roc_ctx(
 				struct p2p_roc_context, node);
 		if (roc_ctx->roc_state != ROC_STATE_IDLE) {
 			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",
-				roc_ctx->p2p_soc_obj, roc_ctx,
-				roc_ctx->vdev_id, roc_ctx->scan_id,
-				roc_ctx->tx_ctx, roc_ctx->chan,
-				roc_ctx->phy_mode, roc_ctx->duration,
-				roc_ctx->roc_type, roc_ctx->roc_state);
+				  ":%d, scan_id:%d, tx ctx:%pK, freq:"
+				  "%d, phy_mode:%d, duration:%d, "
+				  "roc_type:%d, roc_state:%d",
+				  roc_ctx->p2p_soc_obj, roc_ctx,
+				  roc_ctx->vdev_id, roc_ctx->scan_id,
+				  roc_ctx->tx_ctx, roc_ctx->chan_freq,
+				  roc_ctx->phy_mode, roc_ctx->duration,
+				  roc_ctx->roc_type, roc_ctx->roc_state);
 
 			return roc_ctx;
 		}
@@ -652,8 +657,8 @@ struct p2p_roc_context *p2p_find_roc_by_tx_ctx(
 	return NULL;
 }
 
-struct p2p_roc_context *p2p_find_roc_by_chan(
-	struct p2p_soc_priv_obj *p2p_soc_obj, uint8_t chan)
+struct p2p_roc_context *p2p_find_roc_by_chan_freq(
+	struct p2p_soc_priv_obj *p2p_soc_obj, qdf_freq_t chan_freq)
 {
 	struct p2p_roc_context *roc_ctx;
 	qdf_list_node_t *p_node;
@@ -664,11 +669,14 @@ struct p2p_roc_context *p2p_find_roc_by_chan(
 		roc_ctx = qdf_container_of(p_node,
 					   struct p2p_roc_context,
 					   node);
-		if (roc_ctx->chan == chan) {
-			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",
+		if (roc_ctx->chan_freq == chan_freq) {
+			p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d,"
+				  " scan_id:%d, tx ctx:%pK, freq:%d,"
+				  " phy_mode:%d, duration:%d,"
+				  " roc_type:%d, roc_state:%d",
 				  roc_ctx->p2p_soc_obj, roc_ctx,
 				  roc_ctx->vdev_id, roc_ctx->scan_id,
-				  roc_ctx->tx_ctx, roc_ctx->chan,
+				  roc_ctx->tx_ctx, roc_ctx->chan_freq,
 				  roc_ctx->phy_mode, roc_ctx->duration,
 				  roc_ctx->roc_type, roc_ctx->roc_state);
 
@@ -775,10 +783,12 @@ QDF_STATUS p2p_process_cleanup_roc_queue(
 		roc_ctx = qdf_container_of(p_node,
 				struct p2p_roc_context, node);
 
-		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",
+		p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d, "
+			  "scan_id:%d, tx ctx:%pK, freq:%d, phy_mode:%d, "
+			  "duration:%d, roc_type:%d, roc_state:%d",
 			  roc_ctx->p2p_soc_obj, roc_ctx,
 			  roc_ctx->vdev_id, roc_ctx->scan_id,
-			  roc_ctx->tx_ctx, roc_ctx->chan,
+			  roc_ctx->tx_ctx, roc_ctx->chan_freq,
 			  roc_ctx->phy_mode, roc_ctx->duration,
 			  roc_ctx->roc_type, roc_ctx->roc_state);
 		status = qdf_list_peek_next(&p2p_soc_obj->roc_q,
@@ -803,9 +813,11 @@ QDF_STATUS p2p_process_cleanup_roc_queue(
 		roc_ctx = qdf_container_of(p_node,
 				struct p2p_roc_context, node);
 
-		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",
+		p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d, "
+			  "scan_id:%d, tx ctx:%pK, freq:%d, phy_mode:%d, "
+			  "duration:%d, roc_type:%d, roc_state:%d",
 			  roc_ctx->p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
-			  roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan,
+			  roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan_freq,
 			  roc_ctx->phy_mode, roc_ctx->duration,
 			  roc_ctx->roc_type, roc_ctx->roc_state);
 
@@ -838,11 +850,13 @@ QDF_STATUS p2p_process_roc_req(struct p2p_roc_context *roc_ctx)
 
 	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",
-		p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
-		roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan,
-		roc_ctx->phy_mode, roc_ctx->duration,
-		roc_ctx->roc_type, roc_ctx->roc_state);
+	p2p_debug("p2p soc obj:%pK, roc ctx:%pK, vdev_id:%d, scan_id:%d, "
+		  "tx_ctx:%pK, freq:%d, phy_mode:%d, duration:%d, "
+		  "roc_type:%d, roc_state:%d",
+		  p2p_soc_obj, roc_ctx, roc_ctx->vdev_id,
+		  roc_ctx->scan_id, roc_ctx->tx_ctx, roc_ctx->chan_freq,
+		  roc_ctx->phy_mode, roc_ctx->duration,
+		  roc_ctx->roc_type, roc_ctx->roc_state);
 
 	status = qdf_list_insert_back(&p2p_soc_obj->roc_q,
 			&roc_ctx->node);

+ 6 - 6
components/p2p/core/src/wlan_p2p_roc.h

@@ -76,7 +76,7 @@ enum roc_state {
  * @vdev_id:     Vdev id on which this request has come
  * @scan_id:     Scan id given by scan component for this roc req
  * @tx_ctx:      TX context if this ROC is for tx MGMT
- * @chan:        Chan for which this RoC has been requested
+ * @chan_freq:   Chan frequency for which this RoC has been requested
  * @phy_mode:    PHY mode
  * @duration:    Duration for the RoC
  * @roc_type:    RoC type  User requested or internal
@@ -90,7 +90,7 @@ struct p2p_roc_context {
 	uint32_t vdev_id;
 	uint32_t scan_id;
 	void *tx_ctx;
-	qdf_freq_t chan;
+	qdf_freq_t chan_freq;
 	uint8_t phy_mode;
 	uint32_t duration;
 	enum roc_type roc_type;
@@ -160,9 +160,9 @@ struct p2p_roc_context *p2p_find_roc_by_tx_ctx(
 	struct p2p_soc_priv_obj *p2p_soc_obj, uint64_t cookie);
 
 /**
- * p2p_find_roc_by_chan() - Find out roc context by channel
+ * p2p_find_roc_by_chan_freq() - Find out roc context by channel
  * @p2p_soc_obj: p2p psoc private object
- * @chan: channel of the ROC
+ * @chan_freq: channel frequency of the ROC
  *
  * This function finds out roc context by channel from p2p psoc
  * private object
@@ -170,8 +170,8 @@ struct p2p_roc_context *p2p_find_roc_by_tx_ctx(
  * Return: Pointer to roc context - success
  *         NULL                   - failure
  */
-struct p2p_roc_context *p2p_find_roc_by_chan(
-	struct p2p_soc_priv_obj *p2p_soc_obj, uint8_t chan);
+struct p2p_roc_context *p2p_find_roc_by_chan_freq(
+	struct p2p_soc_priv_obj *p2p_soc_obj, qdf_freq_t chan_freq);
 
 /**
  * p2p_restart_roc_timer() - Restarts roc timer

+ 6 - 6
components/p2p/dispatcher/inc/wlan_p2p_public_struct.h

@@ -61,13 +61,13 @@ struct p2p_ps_params {
 /**
  * struct p2p_roc_req - P2P roc request
  * @vdev_id:     Vdev id on which this request has come
- * @chan:        Chan for which this RoC has been requested
+ * @chan_freq:   Chan frequency for which this RoC has been requested
  * @phy_mode:    PHY mode
  * @duration:    Duration for the RoC
  */
 struct p2p_roc_req {
 	uint32_t vdev_id;
-	qdf_freq_t chan;
+	qdf_freq_t chan_freq;
 	uint32_t phy_mode;
 	uint32_t duration;
 };
@@ -89,14 +89,14 @@ enum p2p_roc_event {
  * @vdev_id:     Vdev id
  * @roc_event:   RoC event
  * @cookie:      Cookie which is given to supplicant for this roc req
- * @chan:        Chan for which this RoC has been requested
+ * @chan_freq:   Chan frequency for which this RoC has been requested
  * @duration:    Duration for the RoC
   */
 struct p2p_event {
 	uint32_t vdev_id;
 	enum p2p_roc_event roc_event;
 	uint64_t cookie;
-	qdf_freq_t chan;
+	qdf_freq_t chan_freq;
 	uint32_t duration;
 };
 
@@ -137,7 +137,7 @@ struct p2p_tx_cnf {
 /**
  * struct p2p_mgmt_tx - p2p mgmt tx structure
  * @vdev_id:             Vdev id
- * @chan:                Chan for which this RoC has been requested
+ * @chan_freq:           Chan frequency for which this RoC has been requested
  * @wait:                Duration for the RoC
  * @len:                 Length of tx buffer
  * @no_cck:              Required cck or not
@@ -147,7 +147,7 @@ struct p2p_tx_cnf {
  */
 struct p2p_mgmt_tx {
 	uint32_t vdev_id;
-	uint32_t chan;
+	qdf_freq_t chan_freq;
 	uint32_t wait;
 	uint32_t len;
 	uint32_t no_cck;

+ 10 - 9
components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c

@@ -119,9 +119,9 @@ QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
 	QDF_STATUS status;
 	int32_t id;
 
-	p2p_debug("soc:%pK, vdev_id:%d, chan:%d, phy_mode:%d, duration:%d",
-		soc, roc_req->vdev_id, roc_req->chan,
-		roc_req->phy_mode, roc_req->duration);
+	p2p_debug("soc:%pK, vdev_id:%d, chanfreq:%d, phy_mode:%d, duration:%d",
+		  soc, roc_req->vdev_id, roc_req->chan_freq,
+		  roc_req->phy_mode, roc_req->duration);
 
 	if (!soc) {
 		p2p_err("psoc context passed is NULL");
@@ -149,7 +149,7 @@ QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
 	*cookie = (uint64_t)id;
 	roc_ctx->p2p_soc_obj = p2p_soc_obj;
 	roc_ctx->vdev_id = roc_req->vdev_id;
-	roc_ctx->chan = roc_req->chan;
+	roc_ctx->chan_freq = roc_req->chan_freq;
 	roc_ctx->phy_mode = roc_req->phy_mode;
 	roc_ctx->duration = roc_req->duration;
 	roc_ctx->roc_state = ROC_STATE_IDLE;
@@ -303,10 +303,11 @@ QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
 	QDF_STATUS status;
 	int32_t id;
 
-	p2p_debug("soc:%pK, vdev_id:%d, chan:%d, wait:%d, buf_len:%d, cck:%d, no ack:%d, off chan:%d",
-		soc, mgmt_frm->vdev_id, mgmt_frm->chan,
-		mgmt_frm->wait, mgmt_frm->len, mgmt_frm->no_cck,
-		mgmt_frm->dont_wait_for_ack, mgmt_frm->off_chan);
+	p2p_debug("soc:%pK, vdev_id:%d, freq:%d, wait:%d, buf_len:%d,"
+		  " cck:%d, no ack:%d, off chan:%d",
+		  soc, mgmt_frm->vdev_id, mgmt_frm->chan_freq,
+		  mgmt_frm->wait, mgmt_frm->len, mgmt_frm->no_cck,
+		  mgmt_frm->dont_wait_for_ack, mgmt_frm->off_chan);
 
 	if (!soc) {
 		p2p_err("psoc context passed is NULL");
@@ -340,7 +341,7 @@ QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
 	*cookie = (uint64_t)id;
 	tx_action->p2p_soc_obj = p2p_soc_obj;
 	tx_action->vdev_id = mgmt_frm->vdev_id;
-	tx_action->chan = mgmt_frm->chan;
+	tx_action->chan_freq = mgmt_frm->chan_freq;
 	tx_action->duration = mgmt_frm->wait;
 	tx_action->buf_len = mgmt_frm->len;
 	tx_action->no_cck = mgmt_frm->no_cck;

+ 4 - 4
os_if/p2p/src/wlan_cfg80211_p2p.c

@@ -283,7 +283,7 @@ static void wlan_p2p_event_callback(void *user_data,
 	}
 
 	pdev = wlan_vdev_get_pdev(vdev);
-	chan = ieee80211_get_channel(wdev->wiphy, p2p_event->chan);
+	chan = ieee80211_get_channel(wdev->wiphy, p2p_event->chan_freq);
 	if (!chan) {
 		osif_err("channel conversion failed");
 		goto fail;
@@ -364,7 +364,7 @@ int wlan_cfg80211_roc(struct wlan_objmgr_vdev *vdev,
 		return -EINVAL;
 	}
 
-	roc_req.chan = chan->center_freq;
+	roc_req.chan_freq = chan->center_freq;
 	roc_req.duration = duration;
 	roc_req.vdev_id = (uint32_t)vdev_id;
 
@@ -376,7 +376,7 @@ int wlan_cfg80211_roc(struct wlan_objmgr_vdev *vdev,
 	}
 
 	if (!ok) {
-		osif_err("channel%d not OK for DNBS", roc_req.chan);
+		osif_err("channel%d not OK for DNBS", roc_req.chan_freq);
 		return -EINVAL;
 	}
 
@@ -455,7 +455,7 @@ int wlan_cfg80211_mgmt_tx(struct wlan_objmgr_vdev *vdev,
 	}
 
 	mgmt_tx.vdev_id = (uint32_t)vdev_id;
-	mgmt_tx.chan = chan_freq;
+	mgmt_tx.chan_freq = chan_freq;
 	mgmt_tx.wait = wait;
 	mgmt_tx.len = len;
 	mgmt_tx.no_cck = (uint32_t)no_cck;