Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72890133 authored by Ashish's avatar Ashish Committed by Madan Koyyalamudi
Browse files

qcacmn: Move reg_get_6g_ap_master_chan_list out of AFC flag

Currently api wlan_reg_get_6g_ap_master_chan_list is declared
and defined under CONFIG_AFC_SUPPORT feature flag, since this is
a generic API and can be used by other functionalities as well.
With this change move wlan_reg_get_6g_ap_master_chan_list api
out of CONFIG_AFC_SUPPORT feature flag.

Change-Id: Ifa7b27895b4660bbf248fc2827472ba50c9df9a4
CRs-Fixed: 3090281
parent cb1aae14
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1988,6 +1988,30 @@ QDF_STATUS reg_process_master_chan_list_ext(

	return QDF_STATUS_SUCCESS;
}

QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
					  enum reg_6g_ap_type ap_pwr_type,
					  struct regulatory_channel *chan_list)
{
	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
	struct regulatory_channel *master_chan_list_6g;

	pdev_priv_obj = reg_get_pdev_obj(pdev);

	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
		reg_err("reg pdev private obj is NULL");
		return QDF_STATUS_E_FAILURE;
	}

	if (ap_pwr_type >= REG_CURRENT_MAX_AP_TYPE)
		return QDF_STATUS_E_FAILURE;

	master_chan_list_6g = pdev_priv_obj->mas_chan_list_6g_ap[ap_pwr_type];
	qdf_mem_copy(chan_list, master_chan_list_6g,
		     NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel));

	return QDF_STATUS_SUCCESS;
}
#endif /* CONFIG_BAND_6GHZ */

QDF_STATUS reg_process_master_chan_list(
+23 −1
Original line number Diff line number Diff line
@@ -88,7 +88,29 @@ void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc,
 */
QDF_STATUS
reg_process_master_chan_list_ext(struct cur_regulatory_info *reg_info);
#endif

/**
 * reg_get_6g_ap_master_chan_list() - Get  an ap  master channel list depending
 * on * ap power type
 * @ap_pwr_type: Power type (LPI/VLP/SP)
 * @chan_list: Pointer to the channel list. The output channel list
 *
 * Return: QDF_STATUS
 */
QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
					  enum reg_6g_ap_type ap_pwr_type,
					  struct regulatory_channel *chan_list);

#else /* CONFIG_BAND_6GHZ */
static inline QDF_STATUS
reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
			       enum reg_6g_ap_type ap_pwr_type,
			       struct regulatory_channel *chan_list)
{
	return QDF_STATUS_E_FAILURE;
}
#endif /* CONFIG_BAND_6GHZ */

/**
 * reg_process_master_chan_list() - Compute master channel list based on the
 * regulatory rules.
+21 −0
Original line number Diff line number Diff line
@@ -227,6 +227,19 @@ static inline bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq,
}
#endif

/**
 * wlan_reg_get_6g_ap_master_chan_list() - provide  the appropriate ap master
 * channel list
 * @pdev: pdev pointer
 * @ap_pwr_type: The ap power type (LPI/VLP/SP)
 * @chan_list: channel list pointer
 *
 * Return: QDF_STATUS
 */
QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(
					struct wlan_objmgr_pdev *pdev,
					enum reg_6g_ap_type ap_pwr_type,
					struct regulatory_channel *chan_list);
/**
 * wlan_reg_is_6ghz_psc_chan_freq() - Check if the given 6GHz channel frequency
 * is preferred scanning channel frequency.
@@ -337,6 +350,14 @@ wlan_reg_get_max_txpower_for_6g_tpe(struct wlan_objmgr_pdev *pdev,
{
	return QDF_STATUS_E_FAILURE;
}

static inline QDF_STATUS
wlan_reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
				    enum reg_6g_ap_type ap_pwr_type,
				    struct regulatory_channel *chan_list)
{
	return QDF_STATUS_E_FAILURE;
}
#endif /* CONFIG_BAND_6GHZ */

/**
+10 −0
Original line number Diff line number Diff line
@@ -476,6 +476,16 @@ regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc,
	if (tx_ops->unregister_master_ext_handler)
		tx_ops->unregister_master_ext_handler(psoc, NULL);
}

QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(
					struct wlan_objmgr_pdev *pdev,
					enum reg_6g_ap_type ap_pwr_type,
					struct regulatory_channel *chan_list)
{
	return  reg_get_6g_ap_master_chan_list(pdev, ap_pwr_type, chan_list);
}

qdf_export_symbol(wlan_reg_get_6g_ap_master_chan_list);
#else
static inline void
regulatory_assign_register_master_ext_handler(struct wlan_objmgr_psoc *psoc,