ソースを参照

qcacmn: Add APIs to find preCAC status of the given channel

Introduce DFS utils APIs to find preCAC status of the given
channel.

Change-Id: If47411af82b43b9dcff04ba2f84cdb10ec9ca1f1
Vignesh Mohan 5 年 前
コミット
cb9f7ad948

+ 28 - 0
umac/dfs/core/src/dfs_zero_cac.h

@@ -148,6 +148,7 @@ enum precac_chan_state {
  * @bw:                Bandwidth of the precac entry.
  * @dfs:               Pointer to wlan_dfs structure.
  * @tree_root:         Tree root node with 80MHz channel key.
+ * @non_dfs_subch_count: Number of non DFS subchannels in the entry.
  */
 struct dfs_precac_entry {
 	TAILQ_ENTRY(dfs_precac_entry) pe_list;
@@ -158,6 +159,7 @@ struct dfs_precac_entry {
 	uint16_t            bw;
 	struct wlan_dfs     *dfs;
 	struct precac_tree_node *tree_root;
+	uint8_t             non_dfs_subch_count;
 };
 
 /**
@@ -1405,4 +1407,30 @@ dfs_process_radar_ind_on_agile_chan(struct wlan_dfs *dfs,
 	return QDF_STATUS_E_FAILURE;
 }
 #endif
+
+#ifdef ATH_SUPPORT_ZERO_CAC_DFS
+/**
+ * dfs_precac_status_for_channel() - Find the preCAC status of the given
+ * channel.
+ *
+ * @dfs: Pointer to wlan_dfs dfs.
+ * @deschan: DFS channel to check preCAC status.
+ *
+ * Return:
+ * DFS_NO_PRECAC_COMPLETED_CHANS - 0 preCAC completed channels.
+ * DFS_PRECAC_COMPLETED_CHAN - Given channel is preCAC completed.
+ * DFS_PRECAC_REQUIRED_CHAN - Given channel requires preCAC.
+ */
+enum precac_status_for_chan
+dfs_precac_status_for_channel(struct wlan_dfs *dfs,
+			      struct dfs_channel *deschan);
+#else
+static inline enum precac_status_for_chan
+dfs_precac_status_for_channel(struct wlan_dfs *dfs,
+			      struct dfs_channel *deschan)
+{
+	return DFS_INVALID_PRECAC_STATUS;
+}
+#endif
+
 #endif /* _DFS_ZERO_CAC_H_ */

+ 20 - 0
umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h

@@ -373,4 +373,24 @@ enum dfs_agile_sm_evt {
 	DFS_AGILE_SM_EV_ADFS_RADAR =  3,
 };
 
+/**
+ * enum precac_status_for_chan - preCAC status for channels.
+ * @DFS_NO_PRECAC_COMPLETED_CHANS: None of the channels are preCAC completed.
+ * @DFS_PRECAC_COMPLETED_CHAN: A given channel is preCAC completed.
+ * @DFS_PRECAC_REQUIRED_CHAN:  A given channel required preCAC.
+ * @DFS_INVALID_PRECAC_STATUS: Invalid status.
+ *
+ * Note: "DFS_NO_PRECAC_COMPLETED_CHANS" has more priority than
+ * "DFS_PRECAC_COMPLETED_CHAN". This is because if the preCAC list does not
+ * have any channel that completed preCAC, "DFS_NO_PRECAC_COMPLETED_CHANS"
+ * is returned and search for preCAC completion (DFS_PRECAC_COMPLETED_CHAN)
+ * for a given channel is not done.
+ */
+enum precac_status_for_chan {
+	DFS_NO_PRECAC_COMPLETED_CHANS,
+	DFS_PRECAC_COMPLETED_CHAN,
+	DFS_PRECAC_REQUIRED_CHAN,
+	DFS_INVALID_PRECAC_STATUS,
+};
+
 #endif  /* _DFS_IOCTL_H_ */

+ 19 - 0
umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h

@@ -1032,4 +1032,23 @@ QDF_STATUS utils_dfs_get_rcac_channel(struct wlan_objmgr_pdev *pdev,
 }
 #endif /* QCA_SUPPORT_ADFS_RCAC */
 
+#ifdef ATH_SUPPORT_ZERO_CAC_DFS
+/**
+ * utils_dfs_precac_status_for_channel() - API to find the preCAC status
+ * of the given channel.
+ * @pdev: Pointer to DFS pdev object.
+ * @deschan: Pointer to desired channel of wlan_channel structure.
+ */
+enum precac_status_for_chan
+utils_dfs_precac_status_for_channel(struct wlan_objmgr_pdev *pdev,
+				    struct wlan_channel *deschan);
+#else
+static inline enum precac_status_for_chan
+utils_dfs_precac_status_for_channel(struct wlan_objmgr_pdev *pdev,
+				    struct wlan_channel *deschan)
+{
+	return DFS_INVALID_PRECAC_STATUS;
+}
+#endif
+
 #endif /* _WLAN_DFS_UTILS_API_H_ */

+ 18 - 0
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -1701,3 +1701,21 @@ QDF_STATUS utils_dfs_get_rcac_channel(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+
+#ifdef ATH_SUPPORT_ZERO_CAC_DFS
+enum precac_status_for_chan
+utils_dfs_precac_status_for_channel(struct wlan_objmgr_pdev *pdev,
+				    struct wlan_channel *deschan)
+{
+	struct wlan_dfs *dfs;
+	struct dfs_channel chan;
+
+	dfs = wlan_pdev_get_dfs_obj(pdev);
+	if (!dfs)
+		return false;
+
+	dfs_fill_chan_info(&chan, deschan);
+
+	return dfs_precac_status_for_channel(dfs, &chan);
+}
+#endif