Jelajahi Sumber

qcacld-3.0: Clean up channel number usage for CDP API

For cdp_hl_fc_set_td_limit() API, use channel frequency instead of
channel number.

Change-Id: Ic053be33ac7c7cbd2543b0208a1184b3f20a4346
CRs-fixed: 2565734
Yue Ma 5 tahun lalu
induk
melakukan
b1e993f96a

+ 2 - 2
core/dp/txrx/ol_tx_hl.c

@@ -2245,7 +2245,7 @@ int ol_txrx_set_vdev_os_queue_status(struct cdp_soc_t *soc_hdl, u8 vdev_id,
 }
 
 int ol_txrx_set_vdev_tx_desc_limit(struct cdp_soc_t *soc_hdl, u8 vdev_id,
-				   u8 chan)
+				   u32 chan_freq)
 {
 	struct ol_txrx_vdev_t *vdev =
 	(struct ol_txrx_vdev_t *)ol_txrx_get_vdev_from_vdev_id(vdev_id);
@@ -2259,7 +2259,7 @@ int ol_txrx_set_vdev_tx_desc_limit(struct cdp_soc_t *soc_hdl, u8 vdev_id,
 	}
 
 	/* TODO: Handle no of spatial streams and channel BW */
-	if (WLAN_REG_IS_5GHZ_CH(chan))
+	if (WLAN_REG_IS_5GHZ_CH_FREQ(chan_freq))
 		fc_limit_id = TXRX_FC_5GH_80M_2x2;
 	else
 		fc_limit_id = TXRX_FC_2GH_40M_2x2;

+ 2 - 2
core/dp/txrx/ol_txrx.h

@@ -570,12 +570,12 @@ int ol_txrx_set_vdev_os_queue_status(struct cdp_soc_t *soc_hdl, u8 vdev_id,
  * ol_txrx_set_vdev_tx_desc_limit() - Set TX descriptor limits for a vdev
  * @soc_hdl: soc handle
  * @vdev_id: vdev id for the vdev under consideration.
- * @chan: Channel on which the vdev has been started.
+ * @chan_freq: channel frequency on which the vdev has been started.
  *
  * Return: 0 on success, -EINVAL on failure
  */
 int ol_txrx_set_vdev_tx_desc_limit(struct cdp_soc_t *soc_hdl, u8 vdev_id,
-				   u8 chan);
+				   u32 chan_freq);
 #endif
 
 /**

+ 12 - 17
core/hdd/src/wlan_hdd_assoc.c

@@ -2920,7 +2920,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 	tSirResultCodes timeout_reason = 0;
 	bool ok;
 	mac_handle_t mac_handle;
-	uint8_t conn_info_channel;
+	uint32_t conn_info_freq;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (!hdd_ctx) {
@@ -3068,15 +3068,11 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 		wlan_hdd_auto_shutdown_enable(hdd_ctx, false);
 #endif
 
-		conn_info_channel =
-			wlan_reg_freq_to_chan(hdd_ctx->pdev,
-					      sta_ctx->conn_info.chan_freq);
+		conn_info_freq = sta_ctx->conn_info.chan_freq;
 
 		hdd_debug("check if STA chan ok for DNBS");
-		if (policy_mgr_is_chan_ok_for_dnbs(
-					hdd_ctx->psoc,
-					wlan_chan_to_freq(conn_info_channel),
-					&ok)) {
+		if (policy_mgr_is_chan_ok_for_dnbs(hdd_ctx->psoc,
+						   conn_info_freq, &ok)) {
 			hdd_err("Unable to check DNBS eligibility for chan(freq):%u",
 				sta_ctx->conn_info.chan_freq);
 			return QDF_STATUS_E_FAILURE;
@@ -3279,8 +3275,8 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 							pConnectedProfile->SSID.length);
 
 						cdp_hl_fc_set_td_limit(soc,
-						adapter->vdev_id,
-						conn_info_channel);
+							adapter->vdev_id,
+							conn_info_freq);
 
 						hdd_send_roamed_ind(
 								dev,
@@ -3327,8 +3323,8 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 					hdd_debug("ft_carrier_on is %d, sending connect indication",
 						 ft_carrier_on);
 					cdp_hl_fc_set_td_limit(soc,
-					adapter->vdev_id,
-					conn_info_channel);
+							       adapter->vdev_id,
+							       conn_info_freq);
 					hdd_connect_result(dev,
 							   roam_info->
 							   bssid.bytes,
@@ -3386,8 +3382,8 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 								   roam_info->status_code);
 					}
 					cdp_hl_fc_set_td_limit(soc,
-					adapter->vdev_id,
-					conn_info_channel);
+							       adapter->vdev_id,
+							       conn_info_freq);
 				}
 			}
 			if (!hddDisconInProgress) {
@@ -3422,9 +3418,8 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 						adapter->vdev_id,
 						&reqRsnLength, reqRsnIe);
 
-			cdp_hl_fc_set_td_limit(soc,
-				adapter->vdev_id,
-				conn_info_channel);
+			cdp_hl_fc_set_td_limit(soc, adapter->vdev_id,
+					       conn_info_freq);
 			hdd_send_re_assoc_event(dev, adapter, roam_info,
 						reqRsnIe, reqRsnLength);
 			/* Reassoc successfully */

+ 2 - 4
core/hdd/src/wlan_hdd_hostapd.c

@@ -1860,8 +1860,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			cdp_hl_fc_set_td_limit(
 				cds_get_context(QDF_MODULE_ID_SOC),
 				adapter->vdev_id,
-				wlan_reg_freq_to_chan(hdd_ctx->pdev,
-				ap_ctx->operating_chan_freq));
+				ap_ctx->operating_chan_freq);
 
 			hdd_register_tx_flow_control(adapter,
 				hdd_softap_tx_resume_timer_expired_handler,
@@ -2525,8 +2524,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 
 		cdp_hl_fc_set_td_limit(cds_get_context(QDF_MODULE_ID_SOC),
 				       adapter->vdev_id,
-				       wlan_reg_freq_to_chan(hdd_ctx->pdev,
-				       ap_ctx->operating_chan_freq));
+				       ap_ctx->operating_chan_freq);
 
 		phy_mode = wlan_sap_get_phymode(
 				WLAN_HDD_GET_SAP_CTX_PTR(adapter));