Просмотр исходного кода

qcacmn: Add an API to get a super channel list entry

Add an API wlan_reg_get_superchan_entry to get a super channel list
entry for a given input channel index.

Change-Id: Ia231669872c15998549aff6262d66766b8cec5c2
CRs-Fixed: 3098998
Hariharan Basuthkar 3 лет назад
Родитель
Сommit
4e9dad300a

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

@@ -6104,6 +6104,43 @@ uint16_t reg_convert_enum_to_6g_idx(enum channel_enum ch_idx)
 
 	return (ch_idx - MIN_6GHZ_CHANNEL);
 }
+
+QDF_STATUS
+reg_get_superchan_entry(struct wlan_objmgr_pdev *pdev,
+			enum channel_enum chan_enum,
+			const struct super_chan_info **p_sup_chan_entry)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	uint16_t sup_idx;
+
+	sup_idx = reg_convert_enum_to_6g_idx(chan_enum);
+
+	if (sup_idx == INVALID_CHANNEL) {
+		reg_debug("super channel idx is invalid for the chan_enum %d",
+			  chan_enum);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err_rl("pdev reg component is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	if (!p_sup_chan_entry) {
+		reg_err_rl("p_sup_chan_entry is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	if (sup_idx >= NUM_6GHZ_CHANNELS) {
+		reg_debug("sup_idx is out of bounds");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*p_sup_chan_entry = &pdev_priv_obj->super_chan_list[sup_idx];
+
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 #ifdef FEATURE_WLAN_CH_AVOID_EXT

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

@@ -1728,6 +1728,22 @@ bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc);
  * Return: enum channel_enum
  */
 uint16_t reg_convert_enum_to_6g_idx(enum channel_enum ch_idx);
+
+/**
+ * reg_get_superchan_entry() - Get the address of the super channel list
+ * entry for a given input channel index.
+ *
+ * @pdev: pdev ptr
+ * @chan_enum: Channel enum
+ * @p_sup_chan_entry: Pointer to address of *p_sup_chan_entry
+ *
+ * Return: QDF_STATUS_SUCCESS if super channel entry is available for the input
+ * chan_enum else QDF_STATUS_E_FAILURE
+ */
+QDF_STATUS
+reg_get_superchan_entry(struct wlan_objmgr_pdev *pdev,
+			enum channel_enum chan_enum,
+			const struct super_chan_info **p_sup_chan_entry);
 #endif
 
 #ifdef FEATURE_WLAN_CH_AVOID_EXT

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

@@ -276,6 +276,21 @@ wlan_reg_get_max_txpower_for_6g_tpe(struct wlan_objmgr_pdev *pdev,
 				    bool is_psd,
 				    uint8_t *tx_power);
 
+/**
+ * wlan_reg_get_superchan_entry() - Get the address of the super channel list
+ * entry for a given input channel index.
+ *
+ * @pdev: pdev ptr
+ * @chan_enum: Channel enum
+ * @p_sup_chan_entry: Pointer to address of *p_sup_chan_entry
+ *
+ * Return: QDF_STATUS_SUCCESS if super channel entry is available for the input
+ * chan_enum else QDF_STATUS_E_FAILURE
+ */
+QDF_STATUS wlan_reg_get_superchan_entry(
+		struct wlan_objmgr_pdev *pdev,
+		enum channel_enum chan_enum,
+		const struct super_chan_info **p_sup_chan_entry);
 #else
 
 #define WLAN_REG_IS_6GHZ_CHAN_FREQ(freq) (false)
@@ -339,6 +354,16 @@ wlan_reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
 {
 	return QDF_STATUS_E_FAILURE;
 }
+
+static inline
+QDF_STATUS wlan_reg_get_superchan_entry(
+		struct wlan_objmgr_pdev *pdev,
+		enum channel_enum chan_enum,
+		const struct super_chan_info **p_sup_chan_entry)
+{
+	*p_sup_chan_entry = NULL;
+	return QDF_STATUS_E_NOSUPPORT;
+}
 #endif /* CONFIG_BAND_6GHZ */
 
 /**

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

@@ -1429,6 +1429,13 @@ wlan_reg_set_ap_pwr_and_update_chan_list(struct wlan_objmgr_pdev *pdev,
 
 qdf_export_symbol(wlan_reg_set_ap_pwr_and_update_chan_list);
 
+QDF_STATUS wlan_reg_get_superchan_entry(
+		struct wlan_objmgr_pdev *pdev,
+		enum channel_enum chan_enum,
+		const struct super_chan_info **p_sup_chan_entry)
+{
+	return reg_get_superchan_entry(pdev, chan_enum, p_sup_chan_entry);
+}
 #endif /* CONFIG_BAND_6GHZ */
 
 bool wlan_reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc)