Parcourir la source

qcacmn: Add dfs tgt API to set Sub Channel Marking

Introduce dfs_tgt API to send the WMI command to enable/disable
"Subchannel Marking" in Firmware (only in  Full Offload)

Change-Id: If739409521c8704b612e52dfc8ed6b86ffe32bca
CRs-Fixed: 2334258
Vignesh Mohan il y a 6 ans
Parent
commit
4974032991

+ 21 - 1
target_if/dfs/inc/target_if_dfs_full_offload.h

@@ -60,6 +60,7 @@ static QDF_STATUS target_process_bang_radar_cmd(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
+#if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
 /**
  * target_send_usenol_pdev_param - send usenol pdev param to FW.
  * @pdev: Pointer to pdev object.
@@ -67,9 +68,21 @@ static QDF_STATUS target_process_bang_radar_cmd(struct wlan_objmgr_pdev *pdev,
  *
  * Return: QDF_STATUS
  */
-#if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
 QDF_STATUS target_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
 					 bool usenol);
+
+/**
+ * target_send_subchan_marking_pdev_param - Send subchannel marking
+ * pdev param to FW.
+ * @pdev: Pointer to pdev object.
+ * @subchanmark: Value of user configured subchannel_marking.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+target_send_subchan_marking_pdev_param(struct wlan_objmgr_pdev *pdev,
+				       bool subchanmark);
+
 #else
 static inline QDF_STATUS
 target_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
@@ -77,6 +90,13 @@ target_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline QDF_STATUS
+target_send_subchan_marking_pdev_param(struct wlan_objmgr_pdev *pdev,
+				       bool subchanmark)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 #endif /* _TARGET_IF_DFS_FULL_OFFLOAD_H_ */
 

+ 2 - 0
target_if/dfs/src/target_if_dfs.c

@@ -380,5 +380,7 @@ QDF_STATUS target_if_register_dfs_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 
 	dfs_tx_ops->dfs_send_usenol_pdev_param =
 		&target_send_usenol_pdev_param;
+	dfs_tx_ops->dfs_send_subchan_marking_pdev_param =
+		&target_send_subchan_marking_pdev_param;
 	return QDF_STATUS_SUCCESS;
 }

+ 27 - 0
target_if/dfs/src/target_if_dfs_full_offload.c

@@ -267,4 +267,31 @@ QDF_STATUS target_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
 		target_if_err("dfs: usenol_pdev_param send failed %d", status);
 	return status;
 }
+
+QDF_STATUS
+target_send_subchan_marking_pdev_param(struct wlan_objmgr_pdev *pdev,
+				       bool subchanmark)
+{
+	QDF_STATUS status;
+	wmi_unified_t wmi_handle;
+
+	if (!pdev) {
+		target_if_err("null pdev");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
+	if (!wmi_handle) {
+		target_if_err("null wmi_handle");
+		return QDF_STATUS_E_FAILURE;
+	}
+	status = wmi_send_subchan_marking_pdev_param(wmi_handle,
+						     subchanmark, pdev);
+
+	if (QDF_IS_STATUS_ERROR(status))
+		target_if_err("dfs: subchan_marking_pdev_param send failed %d",
+			      status);
+
+	return status;
+}
 #endif

+ 6 - 1
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -27,6 +27,7 @@
 #include "../dfs_process_radar_found_ind.h"
 #include <wlan_reg_services_api.h>
 #include <wlan_dfs_utils_api.h>
+#include <wlan_dfs_tgt_api.h>
 #include "wlan_dfs_mlme_api.h"
 #include "../dfs_internal.h"
 /**
@@ -122,14 +123,18 @@
 int dfs_set_nol_subchannel_marking(struct wlan_dfs *dfs,
 				   bool nol_subchannel_marking)
 {
+	QDF_STATUS status;
+
 	if (!dfs)
 		return -EIO;
 
 	dfs->dfs_use_nol_subchannel_marking = nol_subchannel_marking;
 	dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "NOL subchannel marking is %s ",
 		 (nol_subchannel_marking) ? "set" : "disabled");
+	status = tgt_dfs_send_subchan_marking(dfs->dfs_pdev_obj,
+					      nol_subchannel_marking);
 
-	return 0;
+	return qdf_status_to_os_return(status);
 }
 
 int dfs_get_nol_subchannel_marking(struct wlan_dfs *dfs,

+ 18 - 1
umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h

@@ -417,6 +417,8 @@ bool tgt_dfs_is_stadfs_enabled(struct wlan_objmgr_pdev *pdev);
  * Return: true if the pdev supports 5GHz, else false.
  */
 bool tgt_dfs_is_pdev_5ghz(struct wlan_objmgr_pdev *pdev);
+
+#if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
 /**
  * tgt_dfs_send_usenol_pdev_param() - Send usenol pdev param to FW.
  * @pdev: Pointer to pdev object.
@@ -424,9 +426,18 @@ bool tgt_dfs_is_pdev_5ghz(struct wlan_objmgr_pdev *pdev);
  *
  * Return: QDF_STATUS
  */
-#if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
 QDF_STATUS tgt_dfs_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
 					  bool usenol);
+
+/**
+ * tgt_dfs_send_subchan_marking() - Send subchannel marking pdev param to FW.
+ * @pdev: Pointer to pdev object.
+ * @subchanmark: Value of subchannel_marking.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS tgt_dfs_send_subchan_marking(struct wlan_objmgr_pdev *pdev,
+					bool subchanmark);
 #else
 static inline
 QDF_STATUS tgt_dfs_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
@@ -434,5 +445,11 @@ QDF_STATUS tgt_dfs_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline QDF_STATUS
+tgt_dfs_send_subchan_marking(struct wlan_objmgr_pdev *pdev, bool subchanmark)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 #endif /* _WLAN_DFS_TGT_API_H_ */

+ 31 - 0
umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c

@@ -609,6 +609,37 @@ QDF_STATUS tgt_dfs_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
 }
 
 qdf_export_symbol(tgt_dfs_send_usenol_pdev_param);
+
+QDF_STATUS tgt_dfs_send_subchan_marking(struct wlan_objmgr_pdev *pdev,
+					bool subchanmark)
+{
+	struct wlan_objmgr_psoc *psoc;
+	struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		dfs_err(NULL, WLAN_DEBUG_DFS_ALWAYS, "psoc is null");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	dfs_tx_ops = wlan_psoc_get_dfs_txops(psoc);
+	if (!dfs_tx_ops) {
+		dfs_debug(NULL, WLAN_DEBUG_DFS_ALWAYS,
+			  "dfs_tx_ops=%pK", dfs_tx_ops);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (dfs_tx_ops->dfs_send_subchan_marking_pdev_param)
+		return dfs_tx_ops->dfs_send_subchan_marking_pdev_param(
+				pdev, subchanmark);
+
+	dfs_debug(NULL, WLAN_DEBUG_DFS_ALWAYS,
+		  "dfs_send_subchan_marking_pdev_param is null");
+
+	return QDF_STATUS_E_FAILURE;
+}
+
+qdf_export_symbol(tgt_dfs_send_subchan_marking);
 #endif
 
 void tgt_dfs_enable_stadfs(struct wlan_objmgr_pdev *pdev, bool val)