浏览代码

qcacmn: Add reg API to check for enable channel state

Add new reg API to check if frequency is active (non-passive) 
or not from the secondary channel list.
The API checks the channel state against CHANNEL_STATE_ENABLE.

Change-Id: If41850563e680659ea815f09207ec0b854a2f040
CRs-Fixed: 3136785
Deeksha Gupta 3 年之前
父节点
当前提交
8944151a4b

+ 11 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -5863,6 +5863,17 @@ bool reg_is_disable_in_secondary_list_for_freq(struct wlan_objmgr_pdev *pdev,
 
 	return ch_state == CHANNEL_STATE_DISABLE;
 }
+
+bool reg_is_enable_in_secondary_list_for_freq(struct wlan_objmgr_pdev *pdev,
+					      qdf_freq_t freq)
+{
+	enum channel_state ch_state;
+
+	ch_state = reg_get_channel_state_from_secondary_list_for_freq(pdev,
+								      freq);
+
+	return ch_state == CHANNEL_STATE_ENABLE;
+}
 #endif
 
 bool reg_is_passive_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)

+ 11 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -1249,6 +1249,17 @@ bool reg_is_disable_for_pwrmode(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
  */
 bool reg_is_disable_in_secondary_list_for_freq(struct wlan_objmgr_pdev *pdev,
 					       qdf_freq_t freq);
+
+/**
+ * reg_is_enable_in_secondary_list_for_freq() - Check if the given channel
+ * frequency is in enable state
+ * @pdev: Pointer to pdev
+ * @freq: Channel frequency
+ *
+ * Return: True if channel state is enabled, else false
+ */
+bool reg_is_enable_in_secondary_list_for_freq(struct wlan_objmgr_pdev *pdev,
+					      qdf_freq_t freq);
 #endif
 
 /**

+ 12 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -1594,6 +1594,18 @@ bool wlan_reg_is_disable_in_secondary_list_for_freq(
 						struct wlan_objmgr_pdev *pdev,
 						qdf_freq_t freq);
 
+/**
+ * wlan_reg_is_enable_in_secondary_list_for_freq() - Checks in the secondary
+ * channel list to see if chan state is enabled
+ * @pdev: pdev ptr
+ * @freq: Channel center frequency
+ *
+ * Return: true or false
+ */
+bool wlan_reg_is_enable_in_secondary_list_for_freq(
+						struct wlan_objmgr_pdev *pdev,
+						qdf_freq_t freq);
+
 /**
  * wlan_reg_is_dfs_in_secondary_list_for_freq() - hecks the channel state for
  * DFS from the secondary channel list

+ 7 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -1078,6 +1078,13 @@ bool wlan_reg_is_disable_in_secondary_list_for_freq(
 	return reg_is_disable_in_secondary_list_for_freq(pdev, freq);
 }
 
+bool wlan_reg_is_enable_in_secondary_list_for_freq(
+						struct wlan_objmgr_pdev *pdev,
+						qdf_freq_t freq)
+{
+	return reg_is_enable_in_secondary_list_for_freq(pdev, freq);
+}
+
 bool wlan_reg_is_dfs_in_secondary_list_for_freq(struct wlan_objmgr_pdev *pdev,
 						qdf_freq_t freq)
 {