瀏覽代碼

qcacmn: Move RCSA and NOL IE related code under a function

The RCSA and NOL IE are win specific and need to be moved into a function.

Change-Id: I5bb68279b4747ca61a4e4a7c4a6d78818ee4be86
CRs-Fixed: 2737134
Vignesh U 4 年之前
父節點
當前提交
d96e6d0356

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

@@ -1293,11 +1293,13 @@ struct wlan_dfs {
 	int32_t        dfs_freq_offset;
 	bool           dfs_cac_aborted;
 	qdf_spinlock_t dfs_data_struct_lock;
+#if defined(QCA_DFS_RCSA_SUPPORT)
 	uint8_t        dfs_nol_ie_bandwidth;
 	uint16_t       dfs_nol_ie_startfreq;
 	uint8_t        dfs_nol_ie_bitmap;
 	bool           dfs_is_rcsa_ie_sent;
 	bool           dfs_is_nol_ie_sent;
+#endif
 	uint8_t        dfs_legacy_precac_ucfg:1,
 		       dfs_agile_precac_ucfg:1,
 #if defined(QCA_SUPPORT_ADFS_RCAC)
@@ -2739,8 +2741,19 @@ int dfs_second_segment_radar_disable(struct wlan_dfs *dfs);
  *                         - centre frequency.
  * @nol_ie_bitmap          - NOL bitmap denoting affected subchannels.
  */
+#if defined(QCA_DFS_RCSA_SUPPORT)
 void dfs_fetch_nol_ie_info(struct wlan_dfs *dfs, uint8_t *nol_ie_bandwidth,
 			   uint16_t *nol_ie_startfreq, uint8_t *nol_ie_bitmap);
+#else
+static inline
+void dfs_fetch_nol_ie_info(struct wlan_dfs *dfs, uint8_t *nol_ie_bandwidth,
+			   uint16_t *nol_ie_startfreq, uint8_t *nol_ie_bitmap)
+{
+	*nol_ie_bandwidth = 0;
+	*nol_ie_startfreq = 0;
+	*nol_ie_bitmap = 0;
+}
+#endif
 
 /**
  * dfs_set_rcsa_flags() - Set flags that are required for sending RCSA and
@@ -2749,8 +2762,16 @@ void dfs_fetch_nol_ie_info(struct wlan_dfs *dfs, uint8_t *nol_ie_bandwidth,
  * @is_rcsa_ie_sent: Boolean to check if RCSA IE should be sent or not.
  * @is_nol_ie_sent: Boolean to check if NOL IE should be sent or not.
  */
+#if defined(QCA_DFS_RCSA_SUPPORT)
 void dfs_set_rcsa_flags(struct wlan_dfs *dfs, bool is_rcsa_ie_sent,
 			bool is_nol_ie_sent);
+#else
+static inline
+void dfs_set_rcsa_flags(struct wlan_dfs *dfs, bool is_rcsa_ie_sent,
+			bool is_nol_ie_sent)
+{
+}
+#endif
 
 /**
  * dfs_get_rcsa_flags() - Get flags that are required for sending RCSA and
@@ -2759,8 +2780,18 @@ void dfs_set_rcsa_flags(struct wlan_dfs *dfs, bool is_rcsa_ie_sent,
  * @is_rcsa_ie_sent: Boolean to check if RCSA IE should be sent or not.
  * @is_nol_ie_sent: Boolean to check if NOL IE should be sent or not.
  */
+#if defined(QCA_DFS_RCSA_SUPPORT)
 void dfs_get_rcsa_flags(struct wlan_dfs *dfs, bool *is_rcsa_ie_sent,
 			bool *is_nol_ie_sent);
+#else
+static inline
+void dfs_get_rcsa_flags(struct wlan_dfs *dfs, bool *is_rcsa_ie_sent,
+			bool *is_nol_ie_sent)
+{
+	*is_rcsa_ie_sent = false;
+	*is_nol_ie_sent = false;
+}
+#endif
 
 /**
  * dfs_process_nol_ie_bitmap() - Update NOL with external radar information.
@@ -2772,9 +2803,19 @@ void dfs_get_rcsa_flags(struct wlan_dfs *dfs, bool *is_rcsa_ie_sent,
  *
  * Return: True if NOL IE should be propagated, else false.
  */
+#if defined(QCA_DFS_RCSA_SUPPORT)
 bool dfs_process_nol_ie_bitmap(struct wlan_dfs *dfs, uint8_t nol_ie_bandwidth,
 			       uint16_t nol_ie_startfreq,
 			       uint8_t nol_ie_bitmap);
+#else
+static inline
+bool dfs_process_nol_ie_bitmap(struct wlan_dfs *dfs, uint8_t nol_ie_bandwidth,
+			       uint16_t nol_ie_startfreq,
+			       uint8_t nol_ie_bitmap)
+{
+	return false;
+}
+#endif
 
 /**
  * dfs_is_cac_required() - Check if DFS CAC is required for the current channel.

+ 61 - 24
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -832,6 +832,7 @@ int dfs_second_segment_radar_disable(struct wlan_dfs *dfs)
 	return 0;
 }
 
+#if defined(QCA_DFS_RCSA_SUPPORT)
 /* dfs_prepare_nol_ie_bitmap: Create a Bitmap from the radar found subchannels
  * to be sent along with RCSA.
  * @dfs: Pointer to wlan_dfs.
@@ -958,6 +959,7 @@ bool dfs_process_nol_ie_bitmap(struct wlan_dfs *dfs, uint8_t nol_ie_bandwidth,
 	return should_nol_ie_be_sent;
 }
 #endif
+#endif /* QCA_DFS_RCSA_SUPPORT */
 
 #if defined(WLAN_DFS_TRUE_160MHZ_SUPPORT) && defined(WLAN_DFS_FULL_OFFLOAD)
 void dfs_translate_radar_params(struct wlan_dfs *dfs,
@@ -1100,6 +1102,60 @@ dfs_find_radar_affected_channels(struct wlan_dfs *dfs,
 	return num_channels;
 }
 
+#if defined(QCA_DFS_RCSA_SUPPORT)
+/**
+ * dfs_send_nol_ie_and_rcsa()- Send NOL IE and RCSA action frames.
+ * @dfs: Pointer to wlan_dfs structure.
+ * @radar_found: Pointer to radar found structure.
+ * @nol_freq_list: List of 20MHz frequencies on which radar has been detected.
+ * @num_channels: number of radar affected channels.
+ * @wait_for_csa: indicates if the repeater AP should take DFS action or wait
+ * for CSA
+ *
+ * Return: void.
+ */
+static void
+dfs_send_nol_ie_and_rcsa(struct wlan_dfs *dfs,
+			 struct radar_found_info *radar_found,
+			 uint16_t *nol_freq_list,
+			 uint8_t num_channels,
+			 bool *wait_for_csa)
+{
+	dfs->dfs_is_nol_ie_sent = false;
+	(dfs->is_radar_during_precac ||
+	 radar_found->detector_id == dfs_get_agile_detector_id(dfs)) ?
+		(dfs->dfs_is_rcsa_ie_sent = false) :
+		(dfs->dfs_is_rcsa_ie_sent = true);
+	if (dfs->dfs_use_nol_subchannel_marking) {
+		dfs_reset_nol_ie_bitmap(dfs);
+		dfs_prepare_nol_ie_bitmap_for_freq(dfs, radar_found,
+						   nol_freq_list,
+						   num_channels);
+		dfs->dfs_is_nol_ie_sent = true;
+	}
+
+	/*
+	 * This calls into the umac DFS code, which sets the umac
+	 * related radar flags and begins the channel change
+	 * machinery.
+
+	 * Even during precac, this API is called, but with a flag
+	 * saying not to send RCSA, but only the radar affected subchannel
+	 * information.
+	 */
+	dfs_mlme_start_rcsa(dfs->dfs_pdev_obj, wait_for_csa);
+}
+#else
+static void
+dfs_send_nol_ie_and_rcsa(struct wlan_dfs *dfs,
+			 struct radar_found_info *radar_found,
+			 uint16_t *nol_freq_list,
+			 uint8_t num_channels,
+			 bool *wait_for_csa)
+{
+}
+#endif /* QCA_DFS_RCSA_SUPPORT */
+
 QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
 				 struct radar_found_info *radar_found)
 {
@@ -1197,19 +1253,6 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
 		goto exit;
 	}
 
-	dfs->dfs_is_nol_ie_sent = false;
-	(dfs->is_radar_during_precac ||
-	 radar_found->detector_id == dfs_get_agile_detector_id(dfs)) ?
-		(dfs->dfs_is_rcsa_ie_sent = false) :
-		(dfs->dfs_is_rcsa_ie_sent = true);
-	if (dfs->dfs_use_nol_subchannel_marking) {
-		dfs_reset_nol_ie_bitmap(dfs);
-		dfs_prepare_nol_ie_bitmap_for_freq(dfs, radar_found,
-						   nol_freq_list,
-						   num_channels);
-		dfs->dfs_is_nol_ie_sent = true;
-	}
-
 	/*
 	 * If precac is running and the radar found in secondary
 	 * VHT80 mark the channel as radar and add to NOL list.
@@ -1239,18 +1282,12 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
 	if (radar_found->detector_id == dfs_get_agile_detector_id(dfs))
 		utils_dfs_agile_sm_deliver_evt(dfs->dfs_pdev_obj,
 					       DFS_AGILE_SM_EV_ADFS_RADAR);
-	/*
-	 * This calls into the umac DFS code, which sets the umac
-	 * related radar flags and begins the channel change
-	 * machinery.
-
-	 * Even during precac, this API is called, but with a flag
-	 * saying not to send RCSA, but only the radar affected subchannel
-	 * information.
-	 */
-
-	dfs_mlme_start_rcsa(dfs->dfs_pdev_obj, &wait_for_csa);
 
+	dfs_send_nol_ie_and_rcsa(dfs,
+				 radar_found,
+				 nol_freq_list,
+				 num_channels,
+				 &wait_for_csa);
 	/* If radar is found on preCAC or Agile CAC, return here since
 	 * channel change is not required.
 	 */

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

@@ -33,8 +33,10 @@ extern struct dfs_to_mlme global_dfs_to_mlme;
  * @pdev: Pointer to DFS pdev object.
  * @wait_for_csa: Wait for CSA from RootAP.
  */
+#if defined(QCA_DFS_RCSA_SUPPORT)
 void dfs_mlme_start_rcsa(struct wlan_objmgr_pdev *pdev,
 		bool *wait_for_csa);
+#endif
 
 /**
  * dfs_mlme_mark_dfs() - Mark the channel in the channel list.

+ 2 - 0
umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c

@@ -31,12 +31,14 @@
 #include "wni_api.h"
 #endif
 
+#if defined(QCA_DFS_RCSA_SUPPORT)
 void dfs_mlme_start_rcsa(struct wlan_objmgr_pdev *pdev,
 		bool *wait_for_csa)
 {
 	if (global_dfs_to_mlme.dfs_start_rcsa)
 		global_dfs_to_mlme.dfs_start_rcsa(pdev, wait_for_csa);
 }
+#endif
 
 #ifndef QCA_MCL_DFS_SUPPORT
 #ifdef CONFIG_CHAN_NUM_API