Prechádzať zdrojové kódy

qcacmn: Add function pointer to enable/disable DFS puncture

Add the global dispatcher function pointers to enable/disable
the DFS puncturing feature.

Add a new dfs member "dfs_use_puncture" to remember if the
feature is enabled or disabled.

CRs-Fixed: 3272765
Change-Id: I1f45a9f44ede7f8606f770365220c5f7508847cf
Vijay Krishnan 2 rokov pred
rodič
commit
1d368b2881

+ 3 - 0
umac/dfs/core/src/dfs.h

@@ -1124,6 +1124,8 @@ struct dfs_rcac_params {
  *                                   bandwidth expansion feature.
  * @dfs_use_bw_expand:               User configured value for enabling or
  *                                   disabling BW Expansion feature.
+ * @dfs_use_puncture:                User configured value for enabling or
+ *                                   disabling DFS puncturing feature.
  * @dfs_agile_rcac_ucfg:             User configuration for Rolling CAC.
  * @dfs_fw_adfs_support_non_160:     Target Agile DFS support for non-160 BWs.
  * @dfs_fw_adfs_support_160:         Target Agile DFS support for 160 BW.
@@ -1301,6 +1303,7 @@ struct wlan_dfs {
 	enum wlan_phymode dfs_bw_expand_des_mode;
 	bool           dfs_use_bw_expand;
 #endif
+	bool           dfs_use_puncture;
 	uint8_t        dfs_agile_precac_ucfg:1,
 #if defined(QCA_SUPPORT_ADFS_RCAC)
 		       dfs_agile_rcac_ucfg:1,

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

@@ -2097,6 +2097,9 @@ struct wlan_lmac_if_wifi_pos_rx_ops {
  * @dfs_set_bw_expand:                API to set BW Expansion feature.
  * @dfs_get_bw_expand:                API to get the status of BW Expansion
  *                                    feature.
+ * @dfs_set_dfs_puncture:             API to set DFS puncturing feature.
+ * @dfs_get_dfs_puncture:             API to get the status of DFS puncturing
+ *                                    feature.
  */
 struct wlan_lmac_if_dfs_rx_ops {
 	QDF_STATUS (*dfs_get_radars)(struct wlan_objmgr_pdev *pdev);
@@ -2216,6 +2219,14 @@ struct wlan_lmac_if_dfs_rx_ops {
 	QDF_STATUS (*dfs_get_bw_expand)(
 			struct wlan_objmgr_pdev *pdev,
 			bool *value);
+#ifdef QCA_DFS_BW_PUNCTURE
+	QDF_STATUS (*dfs_set_dfs_puncture)(
+			struct wlan_objmgr_pdev *pdev,
+			bool value);
+	QDF_STATUS (*dfs_get_dfs_puncture)(
+			struct wlan_objmgr_pdev *pdev,
+			bool *value);
+#endif
 	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,

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

@@ -691,6 +691,26 @@ register_dfs_bw_expand_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
 }
 #endif
 
+#ifdef QCA_DFS_BW_PUNCTURE
+/* register_dfs_puncture_rx_ops() - Register DFS Rx-Ops for DFS puncture.
+ * @rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
+ */
+static void
+register_dfs_puncture_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+	if (!rx_ops)
+		return;
+
+	rx_ops->dfs_set_dfs_puncture = ucfg_dfs_set_dfs_puncture;
+	rx_ops->dfs_get_dfs_puncture = ucfg_dfs_get_dfs_puncture;
+}
+#else
+static inline void
+register_dfs_puncture_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+}
+#endif
+
 #ifdef WLAN_MGMT_RX_REO_SUPPORT
 static QDF_STATUS
 wlan_lmac_if_mgmt_rx_reo_rx_ops_register(
@@ -845,6 +865,7 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 	register_agile_dfs_rx_ops(dfs_rx_ops);
 	register_dfs_chan_postnol_rx_ops(dfs_rx_ops);
 	register_dfs_bw_expand_rx_ops(dfs_rx_ops);
+	register_dfs_puncture_rx_ops(dfs_rx_ops);
 
 	return QDF_STATUS_SUCCESS;
 }