qcacmn: Use regdb channels to fill etsi precac required list
Use regdb channels to fill etsi precac required list. Change-Id: I4b9462c0c69150cf2288e17be0c46029d89e4765 CRs-Fixed: 2318558
This commit is contained in:

committed by
nshrivas

parent
17f7ea9f26
commit
9da501e634
@@ -38,13 +38,13 @@
|
|||||||
/**
|
/**
|
||||||
* struct dfs_etsi_precac_entry - PreCAC entry for ETSI domain
|
* struct dfs_etsi_precac_entry - PreCAC entry for ETSI domain
|
||||||
* @pe_list: ETSI PreCAC entry.
|
* @pe_list: ETSI PreCAC entry.
|
||||||
* @freq: primary freq.
|
* @ieee: channel number
|
||||||
* @etsi_caclst_ticks start tick, OS speicfic.
|
* @etsi_caclst_ticks start tick, OS speicfic.
|
||||||
* @dfs: Pointer to wlan_dfs structure.
|
* @dfs: Pointer to wlan_dfs structure.
|
||||||
*/
|
*/
|
||||||
struct dfs_etsi_precac_entry {
|
struct dfs_etsi_precac_entry {
|
||||||
TAILQ_ENTRY(dfs_etsi_precac_entry) pe_list;
|
TAILQ_ENTRY(dfs_etsi_precac_entry) pe_list;
|
||||||
uint16_t freq;
|
uint16_t ieee;
|
||||||
unsigned long etsi_caclst_ticks;
|
unsigned long etsi_caclst_ticks;
|
||||||
struct wlan_dfs *dfs;
|
struct wlan_dfs *dfs;
|
||||||
};
|
};
|
||||||
|
@@ -60,7 +60,7 @@ int dfs_is_subchan_in_etsi_precac_done_list(struct wlan_dfs *dfs,
|
|||||||
pe_list, tmp_precac_entry) {
|
pe_list, tmp_precac_entry) {
|
||||||
diff_ms = qdf_system_ticks_to_msecs(qdf_system_ticks() -
|
diff_ms = qdf_system_ticks_to_msecs(qdf_system_ticks() -
|
||||||
precac_entry->etsi_caclst_ticks);
|
precac_entry->etsi_caclst_ticks);
|
||||||
if (channel == precac_entry->freq &&
|
if (channel == precac_entry->ieee &&
|
||||||
diff_ms < ETSI_CAC_TIME_OUT_MS) {
|
diff_ms < ETSI_CAC_TIME_OUT_MS) {
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
@@ -117,7 +117,7 @@ void dfs_mark_etsi_precac_dfs(struct wlan_dfs *dfs, uint8_t *channels,
|
|||||||
for (i = 0; i < num_channels; i++) {
|
for (i = 0; i < num_channels; i++) {
|
||||||
TAILQ_FOREACH_SAFE(precac_entry, &dfs->dfs_etsiprecac_done_list,
|
TAILQ_FOREACH_SAFE(precac_entry, &dfs->dfs_etsiprecac_done_list,
|
||||||
pe_list, tmp_precac_entry) {
|
pe_list, tmp_precac_entry) {
|
||||||
if (channels[i] != precac_entry->freq)
|
if (channels[i] != precac_entry->ieee)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TAILQ_REMOVE(&dfs->dfs_etsiprecac_done_list,
|
TAILQ_REMOVE(&dfs->dfs_etsiprecac_done_list,
|
||||||
@@ -135,6 +135,7 @@ void dfs_init_etsi_precac_list(struct wlan_dfs *dfs)
|
|||||||
uint8_t found;
|
uint8_t found;
|
||||||
struct dfs_etsi_precac_entry *tmp_precac_entry;
|
struct dfs_etsi_precac_entry *tmp_precac_entry;
|
||||||
int nchans = 0;
|
int nchans = 0;
|
||||||
|
struct dfs_channel *chan_list = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to prepare list of unique VHT20 center frequencies.
|
* We need to prepare list of unique VHT20 center frequencies.
|
||||||
@@ -147,32 +148,30 @@ void dfs_init_etsi_precac_list(struct wlan_dfs *dfs)
|
|||||||
TAILQ_INIT(&dfs->dfs_etsiprecac_done_list);
|
TAILQ_INIT(&dfs->dfs_etsiprecac_done_list);
|
||||||
TAILQ_INIT(&dfs->dfs_etsiprecac_required_list);
|
TAILQ_INIT(&dfs->dfs_etsiprecac_required_list);
|
||||||
|
|
||||||
dfs_mlme_get_dfs_ch_nchans(dfs->dfs_pdev_obj, &nchans);
|
nchans = dfs_get_num_chans();
|
||||||
|
|
||||||
|
chan_list = qdf_mem_malloc(nchans * sizeof(*chan_list));
|
||||||
|
if (!chan_list)
|
||||||
|
return;
|
||||||
|
|
||||||
|
utils_dfs_get_chan_list(dfs->dfs_pdev_obj, (void *)chan_list, &nchans);
|
||||||
|
if (!nchans) {
|
||||||
|
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "zero channels");
|
||||||
|
qdf_mem_free(chan_list);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PRECAC_LIST_LOCK(dfs);
|
PRECAC_LIST_LOCK(dfs);
|
||||||
/* Fill the precac-required-list with unique elements */
|
|
||||||
for (i = 0; i < nchans; i++) {
|
for (i = 0; i < nchans; i++) {
|
||||||
struct dfs_channel *ichan = NULL, lc;
|
if (!WLAN_IS_CHAN_DFS(&chan_list[i]))
|
||||||
|
|
||||||
ichan = &lc;
|
|
||||||
dfs_mlme_get_dfs_ch_channels(dfs->dfs_pdev_obj,
|
|
||||||
&ichan->dfs_ch_freq,
|
|
||||||
&ichan->dfs_ch_flags,
|
|
||||||
&ichan->dfs_ch_flagext,
|
|
||||||
&ichan->dfs_ch_ieee,
|
|
||||||
&ichan->dfs_ch_vhtop_ch_freq_seg1,
|
|
||||||
&ichan->dfs_ch_vhtop_ch_freq_seg2,
|
|
||||||
i);
|
|
||||||
|
|
||||||
if (!WLAN_IS_CHAN_DFS(ichan))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
found = 0;
|
found = 0;
|
||||||
TAILQ_FOREACH(tmp_precac_entry,
|
TAILQ_FOREACH(tmp_precac_entry,
|
||||||
&dfs->dfs_etsiprecac_required_list,
|
&dfs->dfs_etsiprecac_required_list,
|
||||||
pe_list) {
|
pe_list) {
|
||||||
if (tmp_precac_entry->freq ==
|
if (tmp_precac_entry->ieee ==
|
||||||
ichan->dfs_ch_vhtop_ch_freq_seg1) {
|
chan_list[i].dfs_ch_ieee) {
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -187,8 +186,7 @@ void dfs_init_etsi_precac_list(struct wlan_dfs *dfs)
|
|||||||
"etsi precac entry alloc fail");
|
"etsi precac entry alloc fail");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
etsi_precac_entry->freq =
|
etsi_precac_entry->ieee = chan_list[i].dfs_ch_ieee;
|
||||||
ichan->dfs_ch_vhtop_ch_freq_seg1;
|
|
||||||
etsi_precac_entry->dfs = dfs;
|
etsi_precac_entry->dfs = dfs;
|
||||||
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_required_list,
|
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_required_list,
|
||||||
etsi_precac_entry, pe_list);
|
etsi_precac_entry, pe_list);
|
||||||
@@ -201,8 +199,9 @@ void dfs_init_etsi_precac_list(struct wlan_dfs *dfs)
|
|||||||
TAILQ_FOREACH(tmp_precac_entry,
|
TAILQ_FOREACH(tmp_precac_entry,
|
||||||
&dfs->dfs_etsiprecac_required_list,
|
&dfs->dfs_etsiprecac_required_list,
|
||||||
pe_list)
|
pe_list)
|
||||||
dfs_info(dfs, WLAN_DEBUG_DFS, "freq=%u",
|
dfs_info(dfs, WLAN_DEBUG_DFS, "ieee=%u", tmp_precac_entry->ieee);
|
||||||
tmp_precac_entry->freq);
|
|
||||||
|
qdf_mem_free(chan_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dfs_deinit_etsi_precac_list(struct wlan_dfs *dfs)
|
void dfs_deinit_etsi_precac_list(struct wlan_dfs *dfs)
|
||||||
@@ -265,8 +264,7 @@ void dfs_print_etsi_precaclists(struct wlan_dfs *dfs)
|
|||||||
&dfs->dfs_etsiprecac_required_list,
|
&dfs->dfs_etsiprecac_required_list,
|
||||||
pe_list) {
|
pe_list) {
|
||||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||||
"freq=%u ",
|
"ieee=%u ", tmp_precac_entry->ieee);
|
||||||
tmp_precac_entry->freq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print the ETSI Pre-CAC done List */
|
/* Print the ETSI Pre-CAC done List */
|
||||||
@@ -280,9 +278,8 @@ void dfs_print_etsi_precaclists(struct wlan_dfs *dfs)
|
|||||||
tmp_precac_entry->etsi_caclst_ticks);
|
tmp_precac_entry->etsi_caclst_ticks);
|
||||||
|
|
||||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||||
"freq=%u added at (msec): %lu",
|
"ieee=%u added at (msec): %lu", tmp_precac_entry->ieee,
|
||||||
tmp_precac_entry->freq,
|
time_added);
|
||||||
time_added);
|
|
||||||
}
|
}
|
||||||
PRECAC_LIST_UNLOCK(dfs);
|
PRECAC_LIST_UNLOCK(dfs);
|
||||||
}
|
}
|
||||||
@@ -312,7 +309,7 @@ int dfs_add_chan_to_etsi_done_list(struct wlan_dfs *dfs, uint8_t channel)
|
|||||||
TAILQ_FOREACH_SAFE(precac_entry,
|
TAILQ_FOREACH_SAFE(precac_entry,
|
||||||
&dfs->dfs_etsiprecac_required_list,
|
&dfs->dfs_etsiprecac_required_list,
|
||||||
pe_list, tmp_precac_entry) {
|
pe_list, tmp_precac_entry) {
|
||||||
if (channel == precac_entry->freq) {
|
if (channel == precac_entry->ieee) {
|
||||||
TAILQ_REMOVE(&dfs->dfs_etsiprecac_required_list,
|
TAILQ_REMOVE(&dfs->dfs_etsiprecac_required_list,
|
||||||
precac_entry, pe_list);
|
precac_entry, pe_list);
|
||||||
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_done_list,
|
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_done_list,
|
||||||
|
@@ -623,4 +623,21 @@ QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dfs_get_num_chans() - Get the number of channels supported by the regulatory.
|
||||||
|
*
|
||||||
|
* Return: Number of supported channels.
|
||||||
|
*/
|
||||||
|
int dfs_get_num_chans(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* utils_dfs_get_chan_list() - Get channel list from regdb.
|
||||||
|
* @pdev: Pointer to DFS pdev object.
|
||||||
|
* @clist: Pointer to current channel list
|
||||||
|
* @num_chan: number of channels in the current channel list.
|
||||||
|
*/
|
||||||
|
void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
||||||
|
void *clist,
|
||||||
|
uint32_t *num_chan);
|
||||||
#endif /* _WLAN_DFS_UTILS_API_H_ */
|
#endif /* _WLAN_DFS_UTILS_API_H_ */
|
||||||
|
@@ -526,21 +526,15 @@ static void utils_dfs_get_max_sup_width(struct wlan_objmgr_pdev *pdev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* utils_dfs_get_chan_list() - Get channel list from regdb based on current
|
|
||||||
* operating channel.
|
|
||||||
* @pdev: Pointer to DFS pdev object.
|
|
||||||
* @chan_list: Pointer to current channel list
|
|
||||||
* @num_chan: number of channels in the current channel list.
|
|
||||||
*/
|
|
||||||
#ifndef QCA_DFS_USE_POLICY_MANAGER
|
#ifndef QCA_DFS_USE_POLICY_MANAGER
|
||||||
static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
||||||
struct dfs_channel *chan_list, uint32_t *num_chan)
|
void *clist, uint32_t *num_chan)
|
||||||
{
|
{
|
||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
enum channel_state state;
|
enum channel_state state;
|
||||||
struct regulatory_channel *cur_chan_list;
|
struct regulatory_channel *cur_chan_list;
|
||||||
struct wlan_dfs *dfs;
|
struct wlan_dfs *dfs;
|
||||||
|
struct dfs_channel *chan_list = (struct dfs_channel *)clist;
|
||||||
|
|
||||||
dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev);
|
dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev);
|
||||||
if (!dfs)
|
if (!dfs)
|
||||||
@@ -617,7 +611,7 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
utils_dfs_get_chan_list(pdev, tmp_chan_list, num_chan);
|
utils_dfs_get_chan_list(pdev, (void *)tmp_chan_list, num_chan);
|
||||||
|
|
||||||
chan_num = dfs->dfs_curchan->dfs_ch_ieee;
|
chan_num = dfs->dfs_curchan->dfs_ch_ieee;
|
||||||
center_freq = dfs->dfs_curchan->dfs_ch_freq;
|
center_freq = dfs->dfs_curchan->dfs_ch_freq;
|
||||||
@@ -658,8 +652,8 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
||||||
struct dfs_channel *chan_list, uint32_t *num_chan)
|
void *clist, uint32_t *num_chan)
|
||||||
{
|
{
|
||||||
uint8_t pcl_ch[QDF_MAX_NUM_CHAN] = {0};
|
uint8_t pcl_ch[QDF_MAX_NUM_CHAN] = {0};
|
||||||
uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0};
|
uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0};
|
||||||
@@ -668,6 +662,7 @@ static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
|||||||
int i;
|
int i;
|
||||||
struct wlan_objmgr_psoc *psoc;
|
struct wlan_objmgr_psoc *psoc;
|
||||||
uint32_t conn_count = 0;
|
uint32_t conn_count = 0;
|
||||||
|
struct dfs_channel *chan_list = (struct dfs_channel *)clist;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
if (!psoc) {
|
if (!psoc) {
|
||||||
@@ -714,7 +709,7 @@ static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
|
|||||||
static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
|
static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
|
||||||
struct dfs_channel *chan_list, uint32_t *num_chan)
|
struct dfs_channel *chan_list, uint32_t *num_chan)
|
||||||
{
|
{
|
||||||
utils_dfs_get_chan_list(pdev, chan_list, num_chan);
|
utils_dfs_get_chan_list(pdev, (void *)chan_list, num_chan);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1088,3 +1083,8 @@ QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev,
|
|||||||
|
|
||||||
qdf_export_symbol(utils_dfs_is_spoof_check_failed);
|
qdf_export_symbol(utils_dfs_is_spoof_check_failed);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int dfs_get_num_chans(void)
|
||||||
|
{
|
||||||
|
return NUM_CHANNELS;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user