浏览代码

qcacmn: Add APIs to enable/disable BW Reduction

Add functions to enable/disable BW-Agile DFS Reduction

Change-Id: I1cc355f06a2027b229ca2001671ddb69c7cff4e6
CRs-Fixed: 2302983
Shaakir Mohamed 6 年之前
父节点
当前提交
25737a45e3

+ 1 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -1528,6 +1528,7 @@ enum _ol_ath_param_t {
 	 * full band freq range or it's 2g
 	 */
 	OL_ATH_PARAM_BAND_INFO = 399,
+	OL_ATH_PARAM_BW_REDUCE = 400,
 };
 
 /* Enumeration of PDEV Configuration parameter */

+ 1 - 1
umac/dfs/core/src/dfs.h

@@ -1158,7 +1158,7 @@ struct wlan_dfs {
 	int32_t        dfs_max_sidx;
 	uint8_t        dfs_seg_id;
 	uint8_t        dfs_is_chirp;
-	uint8_t        dfs_bw_reduced;
+	bool           dfs_bw_reduced;
 	int32_t        dfs_freq_offset;
 	bool           dfs_cac_aborted;
 	qdf_spinlock_t dfs_data_struct_lock;

+ 5 - 2
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -748,8 +748,11 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
 		return QDF_STATUS_SUCCESS;
 	}
 
-	if (dfs->dfs_use_nol_subchannel_marking &&
-		!(dfs->dfs_bangradar || dfs->dfs_second_segment_bangradar))
+	/* BW reduction is dependent on subchannel marking */
+
+	if ((dfs->dfs_use_nol_subchannel_marking ||
+	     (dfs->dfs_use_nol_subchannel_marking && dfs->dfs_bw_reduced)) &&
+	      !(dfs->dfs_bangradar || dfs->dfs_second_segment_bangradar))
 		num_channels = dfs_find_radar_affected_subchans(dfs,
 								radar_found,
 								channels,

+ 19 - 2
umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h

@@ -369,6 +369,25 @@ bool utils_dfs_process_nol_ie_bitmap(struct wlan_objmgr_pdev *pdev,
 				     uint16_t nol_ie_startfreq,
 				     uint8_t nol_ie_bitmap);
 
+/**
+ * utils_dfs_bw_reduce() - Set bw reduce.
+ * @pdev: Pointer to DFS pdev object.
+ * @bw_reduce: Fill bw_reduce value in this variable.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS utils_dfs_bw_reduce(struct wlan_objmgr_pdev *pdev,
+				bool bw_reduce);
+
+/**
+ * utils_dfs_is_bw_reduce() - Get bw reduce.
+ * @pdev: Pointer to DFS pdev object.
+ * @bw_reduce: Pointer to get bw_reduce value.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS utils_dfs_is_bw_reduce(struct wlan_objmgr_pdev *pdev,
+				  bool *bw_reduce);
 /**
  * utils_dfs_set_cac_timer_running() - Sets the cac timer running.
  * @pdev: Pointer to DFS pdev object.
@@ -413,7 +432,6 @@ QDF_STATUS utils_dfs_get_random_channel(struct wlan_objmgr_pdev *pdev,
 /**
  * utils_dfs_bw_reduced_channel() - Get BW reduced channel.
  * @pdev: Pointer to DFS pdev object.
- * @flags: Reduced bandwidth channel flags.
  * @ch_params: current channel params.
  * @hw_mode: current operating mode.
  * @target_chan: Pointer to target_chan.
@@ -424,7 +442,6 @@ QDF_STATUS utils_dfs_get_random_channel(struct wlan_objmgr_pdev *pdev,
  * Return: QDF_STATUS
  */
 QDF_STATUS utils_dfs_bw_reduced_channel(struct wlan_objmgr_pdev *pdev,
-					uint16_t flags,
 					struct ch_params *ch_params,
 					uint32_t *hw_mode,
 					uint8_t *target_chan);

+ 31 - 2
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -399,6 +399,35 @@ QDF_STATUS utils_dfs_second_segment_radar_disable(struct wlan_objmgr_pdev *pdev)
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS utils_dfs_bw_reduce(struct wlan_objmgr_pdev *pdev, bool bw_reduce)
+{
+	struct wlan_dfs *dfs;
+
+	dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev);
+	if (!dfs)
+		return  QDF_STATUS_E_FAILURE;
+
+	dfs->dfs_bw_reduced = bw_reduce;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+qdf_export_symbol(utils_dfs_bw_reduce);
+
+QDF_STATUS utils_dfs_is_bw_reduce(struct wlan_objmgr_pdev *pdev,
+				  bool *bw_reduce)
+{
+	struct wlan_dfs *dfs;
+
+	dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev);
+	if (!dfs)
+		return  QDF_STATUS_E_FAILURE;
+
+	*bw_reduce = dfs->dfs_bw_reduced;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS utils_dfs_fetch_nol_ie_info(struct wlan_objmgr_pdev *pdev,
 				       uint8_t *nol_ie_bandwidth,
 				       uint16_t *nol_ie_startfreq,
@@ -828,7 +857,6 @@ qdf_export_symbol(utils_dfs_get_random_channel);
 
 QDF_STATUS utils_dfs_bw_reduced_channel(
 	struct wlan_objmgr_pdev *pdev,
-	uint16_t flags,
 	struct ch_params *ch_params,
 	uint32_t *hw_mode,
 	uint8_t *target_chan)
@@ -859,7 +887,6 @@ QDF_STATUS utils_dfs_bw_reduced_channel(
 			dfs->dfs_curchan->dfs_ch_vhtop_ch_freq_seg1;
 		ch_params->center_freq_seg1 =
 			dfs->dfs_curchan->dfs_ch_vhtop_ch_freq_seg2;
-		dfs->dfs_bw_reduced = 1;
 		wlan_reg_set_channel_params(pdev,
 					    dfs->dfs_curchan->dfs_ch_ieee,
 					    0, ch_params);
@@ -873,6 +900,8 @@ QDF_STATUS utils_dfs_bw_reduced_channel(
 	return status;
 }
 
+qdf_export_symbol(utils_dfs_bw_reduced_channel);
+
 #ifdef QCA_DFS_NOL_PLATFORM_DRV_SUPPORT
 void utils_dfs_init_nol(struct wlan_objmgr_pdev *pdev)
 {

+ 4 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1178,6 +1178,10 @@ struct wlan_lmac_if_dfs_rx_ops {
 	QDF_STATUS (*dfs_get_nol_subchannel_marking)(
 			struct wlan_objmgr_pdev *pdev,
 			bool *value);
+	QDF_STATUS (*dfs_set_bw_reduction)(struct wlan_objmgr_pdev *pdev,
+			bool value);
+	QDF_STATUS (*dfs_is_bw_reduction_needed)(struct wlan_objmgr_pdev *pdev,
+			bool *bw_reduce);
 };
 
 struct wlan_lmac_if_mlme_rx_ops {

+ 5 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -371,6 +371,11 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 		ucfg_dfs_set_nol_subchannel_marking;
 	dfs_rx_ops->dfs_get_nol_subchannel_marking =
 		ucfg_dfs_get_nol_subchannel_marking;
+	dfs_rx_ops->dfs_set_bw_reduction =
+		utils_dfs_bw_reduce;
+	dfs_rx_ops->dfs_is_bw_reduction_needed =
+		utils_dfs_is_bw_reduce;
+
 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
 
 	return QDF_STATUS_SUCCESS;