Browse Source

qcacmn: Set the VAP flag to block Tx after radar is hit

The change 'I4acd2f70707386f731e9b8fa2ef90a37868cbe23'
makes modifications in MLME and DP (Data Path) to optimize
the check for radar in per packet transmission path to
reduce CPU processing overheads. This new check is based on
a VAP variable that indicates whether radar is detected
or not.

Upon radar detection, send an indication to MLME through the
registered callbacks to update the status of the flag.

Change-Id: Id0582b5d79be672949f150907eb9ee64fa17d4f7
CRs-Fixed: 3528956
Thirusenthil Kumaran J 2 years ago
parent
commit
f1ea292064

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

@@ -1093,6 +1093,8 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
 		goto exit;
 	}
 
+	dfs_mlme_set_tx_flag(dfs->dfs_pdev_obj, false);
+
 	/*
 	 * If precac is running and the radar found in secondary
 	 * VHT80 mark the channel as radar and add to NOL list.

+ 9 - 0
umac/dfs/dispatcher/inc/wlan_dfs_mlme_api.h

@@ -228,6 +228,15 @@ void dfs_mlme_channel_change_by_precac(struct wlan_objmgr_pdev *pdev);
  */
 void dfs_mlme_nol_timeout_notification(struct wlan_objmgr_pdev *pdev);
 
+/**
+ * dfs_mlme_set_tx_flag() - Set the Vap flag to block Tx on Radar detection.
+ * @pdev:            Pointer to DFS pdev object.
+ * @is_tx_allowed:   Flag value to be set.
+ *                   True indicate data Tx is allowed
+ *                   False indicate data Tx is blocked;
+ */
+void dfs_mlme_set_tx_flag(struct wlan_objmgr_pdev *pdev, bool is_tx_allowed);
+
 /**
  * dfs_mlme_clist_update() - Mark the channel as RADAR.
  * @pdev: Pointer to DFS pdev object.

+ 4 - 0
umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h

@@ -76,6 +76,8 @@
  * @mlme_release_radar_mode_switch_lock: Release lock taken for radar processing
  *                                     over mode switch.
  * @mlme_proc_spoof_success:           Called when FW send spoof success event.
+ * @mlme_set_tx_flag:                  Called when Radar is detected to
+ *                                     indicate stop data traffic.
  */
 struct dfs_to_mlme {
 	QDF_STATUS (*pdev_component_obj_attach)(struct wlan_objmgr_pdev *pdev,
@@ -211,6 +213,8 @@ struct dfs_to_mlme {
 	QDF_STATUS (*mlme_proc_spoof_success)
 			(struct wlan_objmgr_pdev *pdev);
 #endif
+	QDF_STATUS (*mlme_set_tx_flag)(struct wlan_objmgr_pdev *pdev,
+				       bool is_tx_allowed);
 };
 
 extern struct dfs_to_mlme global_dfs_to_mlme;

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

@@ -205,6 +205,7 @@ void register_dfs_callbacks(void)
 		mlme_release_radar_mode_switch_lock;
 	tmp_dfs_to_mlme->mlme_mark_dfs =
 		mlme_dfs_mark_dfs;
+	tmp_dfs_to_mlme->mlme_set_tx_flag = mlme_dfs_set_tx_flag;
 	/*
 	 * Register precac auto channel switch feature related callbacks
 	 */

+ 7 - 1
umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -275,6 +275,12 @@ void dfs_mlme_nol_timeout_notification(struct wlan_objmgr_pdev *pdev)
 				pdev);
 }
 
+void dfs_mlme_set_tx_flag(struct wlan_objmgr_pdev *pdev, bool is_tx_allowed)
+{
+	if (global_dfs_to_mlme.mlme_set_tx_flag)
+		global_dfs_to_mlme.mlme_set_tx_flag(pdev, is_tx_allowed);
+}
+
 void dfs_mlme_clist_update(struct wlan_objmgr_pdev *pdev,
 		void *nollist,
 		int nentries)