Sfoglia il codice sorgente

qcacmn: Add frequency APIS in UMAC Dispatcher

To avoid "channel number" collision that was introduced after 6Ghz band was
added to the driver, add frequency based APIs to Global UMAC dfs
dispatcher.

CRS-Fixed: 2526372
Change-Id: Ice72aae699f609f9dadd0717852fa848cb392629
Priyadarshnee S 5 anni fa
parent
commit
be7b7b2562

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

@@ -1313,6 +1313,7 @@ struct wlan_lmac_if_dfs_rx_ops {
 	QDF_STATUS (*dfs_is_precac_timer_running)(struct wlan_objmgr_pdev *pdev,
 						  bool *is_precac_timer_running
 						  );
+#ifdef CONFIG_CHAN_NUM_API
 	QDF_STATUS
 	    (*dfs_find_vht80_chan_for_precac)(struct wlan_objmgr_pdev *pdev,
 					      uint32_t chan_mode,
@@ -1322,6 +1323,19 @@ struct wlan_lmac_if_dfs_rx_ops {
 					      uint32_t *phy_mode,
 					      bool *dfs_set_cfreq2,
 					      bool *set_agile);
+#endif
+#ifdef CONFIG_CHAN_FREQ_API
+	QDF_STATUS
+	    (*dfs_find_vht80_chan_for_precac_for_freq)(struct wlan_objmgr_pdev
+						       *pdev,
+						       uint32_t chan_mode,
+						       uint16_t ch_freq_seg1,
+						       uint32_t *cfreq1,
+						       uint32_t *cfreq2,
+						       uint32_t *phy_mode,
+						       bool *dfs_set_cfreq2,
+						       bool *set_agile);
+#endif
 	QDF_STATUS (*dfs_agile_precac_start)(struct wlan_objmgr_pdev *pdev);
 	QDF_STATUS (*dfs_set_agile_precac_state)(struct wlan_objmgr_pdev *pdev,
 						 int agile_precac_state);
@@ -1346,15 +1360,33 @@ struct wlan_lmac_if_dfs_rx_ops {
 						       uint32_t value);
 	QDF_STATUS (*dfs_get_precac_intermediate_chan)(struct wlan_objmgr_pdev *pdev,
 						       int *buff);
+#ifdef CONFIG_CHAN_NUM_API
 	bool (*dfs_decide_precac_preferred_chan)(struct wlan_objmgr_pdev *pdev,
 						 uint8_t *pref_chan,
 						 enum wlan_phymode mode);
+#endif
+#ifdef CONFIG_CHAN_FREQ_API
+	bool (*dfs_decide_precac_preferred_chan_for_freq)(struct
+						    wlan_objmgr_pdev *pdev,
+						    uint16_t *pref_chan_freq,
+						    enum wlan_phymode mode);
+#endif
+
+#ifdef CONFIG_CHAN_NUM_API
 	enum precac_chan_state (*dfs_get_precac_chan_state)(struct wlan_objmgr_pdev *pdev,
 							    uint8_t precac_chan);
+#endif
+
+#ifdef CONFIG_CHAN_FREQ_API
+	enum precac_chan_state (*dfs_get_precac_chan_state_for_freq)(struct
+						      wlan_objmgr_pdev *pdev,
+						      uint16_t pcac_freq);
+#endif
 #endif
 	QDF_STATUS (*dfs_get_override_precac_timeout)(
 			struct wlan_objmgr_pdev *pdev,
 			int *precac_timeout);
+#ifdef CONFIG_CHAN_NUM_API
 	QDF_STATUS (*dfs_set_current_channel)(struct wlan_objmgr_pdev *pdev,
 			uint16_t ic_freq,
 			uint64_t ic_flags,
@@ -1362,6 +1394,19 @@ struct wlan_lmac_if_dfs_rx_ops {
 			uint8_t ic_ieee,
 			uint8_t ic_vhtop_ch_freq_seg1,
 			uint8_t ic_vhtop_ch_freq_seg2);
+#endif
+#ifdef CONFIG_CHAN_FREQ_API
+	QDF_STATUS
+	    (*dfs_set_current_channel_for_freq)(struct wlan_objmgr_pdev *pdev,
+						uint16_t ic_freq,
+						uint64_t ic_flags,
+						uint16_t ic_flagext,
+						uint8_t ic_ieee,
+						uint8_t ic_vhtop_ch_freq_seg1,
+						uint8_t ic_vhtop_ch_freq_seg2,
+						uint16_t dfs_ch_mhz_freq_seg1,
+						uint16_t dfs_ch_mhz_freq_seg2);
+#endif
 #ifdef DFS_COMPONENT_ENABLE
 	QDF_STATUS (*dfs_process_radar_ind)(struct wlan_objmgr_pdev *pdev,
 			struct radar_found_info *radar_found);

+ 84 - 4
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -348,6 +348,51 @@ static void wlan_lmac_if_umac_rx_ops_register_p2p(
 }
 #endif
 
+/*
+ * register_precac_auto_chan_rx_ops_ieee() - Register auto chan switch rx ops
+ * for IEEE channel based APIs.
+ * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops
+ */
+#ifdef DFS_COMPONENT_ENABLE
+#if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_NUM_API)
+static inline void
+register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+	if (!rx_ops)
+		return;
+	rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state;
+}
+#else
+static inline void
+register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+}
+#endif
+#endif
+
+/*
+ * register_precac_auto_chan_rx_ops_freq() - Register auto chan switch rx ops
+ * for frequency based channel APIs.
+ * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops
+ */
+#ifdef DFS_COMPONENT_ENABLE
+#if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_FREQ_API)
+static inline void
+register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+	if (!rx_ops)
+		return;
+	rx_ops->dfs_get_precac_chan_state_for_freq =
+		ucfg_dfs_get_precac_chan_state_for_freq;
+}
+#else
+static inline void
+register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+}
+#endif
+#endif
+
 #ifdef DFS_COMPONENT_ENABLE
 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
 static inline void
@@ -359,7 +404,6 @@ register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
 		ucfg_dfs_set_precac_intermediate_chan;
 	rx_ops->dfs_get_precac_intermediate_chan =
 		ucfg_dfs_get_precac_intermediate_chan;
-	rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state;
 }
 #else
 static inline void
@@ -368,6 +412,41 @@ register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
 }
 #endif
 
+/*
+ * register_dfs_rx_ops_for_freq() - Register DFS rx ops for frequency based
+ * channel APIs.
+ * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
+ */
+#ifdef CONFIG_CHAN_FREQ_API
+static void register_dfs_rx_ops_for_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+	if (!rx_ops)
+		return;
+	rx_ops->dfs_find_vht80_chan_for_precac_for_freq =
+		tgt_dfs_find_vht80_precac_chan_freq;
+	rx_ops->dfs_set_current_channel_for_freq =
+		tgt_dfs_set_current_channel_for_freq;
+}
+#endif
+
+/*
+ * register_dfs_rx_ops_for_ieee() - Register DFS rx ops for IEEE channel based
+ * APIs
+ * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
+ */
+
+#ifdef CONFIG_CHAN_NUM_API
+static void register_dfs_rx_ops_for_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
+{
+	if (!rx_ops)
+		return;
+	rx_ops->dfs_find_vht80_chan_for_precac =
+		tgt_dfs_find_vht80_chan_for_precac;
+	rx_ops->dfs_set_current_channel =
+		tgt_dfs_set_current_channel;
+}
+#endif
+
 static QDF_STATUS
 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 {
@@ -383,8 +462,6 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 	dfs_rx_ops->dfs_control = tgt_dfs_control;
 	dfs_rx_ops->dfs_is_precac_timer_running =
 		tgt_dfs_is_precac_timer_running;
-	dfs_rx_ops->dfs_find_vht80_chan_for_precac =
-		tgt_dfs_find_vht80_chan_for_precac;
 	dfs_rx_ops->dfs_agile_precac_start =
 		tgt_dfs_agile_precac_start;
 	dfs_rx_ops->dfs_set_agile_precac_state =
@@ -401,7 +478,6 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 		ucfg_dfs_get_agile_precac_enable;
 	dfs_rx_ops->dfs_get_override_precac_timeout =
 		ucfg_dfs_get_override_precac_timeout;
-	dfs_rx_ops->dfs_set_current_channel = tgt_dfs_set_current_channel;
 	dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind;
 	dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete;
 	dfs_rx_ops->dfs_dfs_ocac_complete_ind = tgt_dfs_ocac_complete;
@@ -440,6 +516,10 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 		utils_dfs_reset_dfs_prevchan;
 
 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
+	register_precac_auto_chan_rx_ops_ieee(dfs_rx_ops);
+	register_precac_auto_chan_rx_ops_freq(dfs_rx_ops);
+	register_dfs_rx_ops_for_freq(dfs_rx_ops);
+	register_dfs_rx_ops_for_ieee(dfs_rx_ops);
 
 	return QDF_STATUS_SUCCESS;
 }