소스 검색

qcacmn: set 'dfs' parameter if host and fw supports 320 MHz

Set dfs object parameter if host and fw supports 320 MHz bandwidth.
i.e. dfs->dfs_is_bangradar_320_enabled. Set to true if the host and
firmware support the bandwidth is 320 MHz. If there is no support, set
false.

Change-Id: I210823c448450f89dc65937201b4839168369d18
CRs-Fixed: 3270525
Jithender Miryala 2 년 전
부모
커밋
26bf9ca291

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

@@ -214,6 +214,26 @@ static bool target_if_dfs_offload(struct wlan_objmgr_psoc *psoc)
 				   wmi_service_dfs_phyerr_offload);
 }
 
+/**
+ * target_if_dfs_bangradar_320_supp: Check the service of
+ * 'wmi_service_bang_radar_320_support' whether the bang radar 320 is
+ * supported or not. If the service is enabled, then it returns true.
+ */
+
+static bool target_if_dfs_bangradar_320_supp(struct wlan_objmgr_psoc *psoc)
+{
+	wmi_unified_t wmi_handle;
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("null wmi_handle");
+		return false;
+	}
+
+	return wmi_service_enabled(wmi_handle,
+				   wmi_service_bang_radar_320_support);
+}
+
 #ifdef WLAN_FEATURE_11BE
 /**
  * target_if_dfs_is_radar_found_chan_freq_eq_center_freq: Check whether the
@@ -449,6 +469,8 @@ QDF_STATUS target_if_register_dfs_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	target_if_register_dfs_tx_ops_send_avg(dfs_tx_ops);
 
 	dfs_tx_ops->dfs_is_tgt_offload = &target_if_dfs_offload;
+	dfs_tx_ops->dfs_is_tgt_bangradar_320_supp =
+				&target_if_dfs_bangradar_320_supp;
 	dfs_tx_ops->dfs_is_tgt_radar_found_chan_freq_eq_center_freq =
 		&target_if_dfs_is_radar_found_chan_freq_eq_center_freq;
 

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

@@ -1065,6 +1065,7 @@ struct dfs_rcac_params {
  * @dfs_cac_started_chan:            CAC started channel.
  * @dfs_pdev_obj:                    DFS pdev object.
  * @dfs_is_offload_enabled:          Set if DFS offload enabled.
+ * @dfs_is_bangradar_320_supported:  Set if DFS 320MHZ enabled.
  * @dfs_is_radar_found_chan_freq_eq_center_freq:
  *                                   Set if chan_freq parameter of the radar
  *                                   found wmi event indicates channel center.
@@ -1275,6 +1276,7 @@ struct wlan_dfs {
 	uint16_t       dfs_agile_precac_freq_mhz;
 #endif
 	bool           dfs_is_offload_enabled;
+	bool           dfs_is_bangradar_320_supported;
 	bool           dfs_is_radar_found_chan_freq_eq_center_freq;
 	int            dfs_use_nol;
 	qdf_spinlock_t dfs_nol_lock;

+ 12 - 0
umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c

@@ -487,6 +487,18 @@ QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev,
 	dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_offload %d",
 		 dfs->dfs_is_offload_enabled);
 
+	if (!dfs_tx_ops->dfs_is_tgt_bangradar_320_supp) {
+		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,
+			"dfs_is_tgt_bangradar_320_supp is null");
+		dfs_destroy_object(dfs);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	dfs->dfs_is_bangradar_320_supported =
+				dfs_tx_ops->dfs_is_tgt_bangradar_320_supp(psoc);
+	dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_bangradar_320_support %d",
+		 dfs->dfs_is_bangradar_320_supported);
+
 	if (!dfs_tx_ops->dfs_is_tgt_radar_found_chan_freq_eq_center_freq) {
 		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,
 			"dfs_is_radar_found_chan_freq_eq_center_freq is null");

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

@@ -1130,6 +1130,7 @@ struct wlan_lmac_if_reg_tx_ops {
  * @dfs_ocac_abort_cmd:                 Send Off-Channel CAC abort command.
  * @dfs_is_pdev_5ghz:                   Check if the given pdev is 5GHz.
  * @dfs_set_phyerr_filter_offload:      Config phyerr filter offload.
+ * @dfs_is_tgt_bangradar_320_supp:      To check host DFS 320MHZ support or not
  * @dfs_is_tgt_radar_found_chan_freq_eq_center_freq:
  *                                      Check if chan_freq parameter of the
  *                                      radar found wmi event points to channel
@@ -1181,6 +1182,7 @@ struct wlan_lmac_if_dfs_tx_ops {
 			struct wlan_objmgr_pdev *pdev,
 			bool dfs_phyerr_filter_offload);
 	bool (*dfs_is_tgt_offload)(struct wlan_objmgr_psoc *psoc);
+	bool (*dfs_is_tgt_bangradar_320_supp)(struct wlan_objmgr_psoc *psoc);
 	bool (*dfs_is_tgt_radar_found_chan_freq_eq_center_freq)
 		 (struct wlan_objmgr_psoc *psoc);
 	QDF_STATUS (*dfs_send_offload_enable_cmd)(