qcacmn: Configure Allowed Channels and ACS Allowed Channels

Description:-
'wifitool athX setprimarychans ch1 ch2 ... chn' will restart athX if
current channel is not in primary allowed channel list.
'wifitool athX getprimarychans' to get primary allowed channel list.
The channel selected by ACS, random channel selection will be ignored
if it's not present in primary allowed channel list.
When user sets the channel using iwconfig or doth_chanswitch, if the
channel is not present in the primary allowed channel list then HOST
does not honour the channel change.

Change-Id: If37592d4246334a3c8fb17d44aaead7a6f9e969e
CRs-Fixed: 2264102
This commit is contained in:
Shashikala Prabhu 2018-06-25 10:52:32 +05:30 • committed by Arif Hussain
commit e874411d1e
5 changed files with 42 additions and 0 deletions

View file

@ -243,4 +243,23 @@ void dfs_mlme_restart_vaps_with_non_dfs_chan(struct wlan_objmgr_pdev *pdev,
{
}
#endif
/**
* dfs_mlme_check_allowed_prim_chanlist() - Check whether the given channel is
* present in the primary allowed channel list or not
* @pdev: Pointer to DFS pdev object.
* @chan_num: Channel number
*/
#if defined(WLAN_SUPPORT_PRIMARY_ALLOWED_CHAN)
bool dfs_mlme_check_allowed_prim_chanlist(struct wlan_objmgr_pdev *pdev,
uint32_t chan_num);
#else
static inline
bool dfs_mlme_check_allowed_prim_chanlist(struct wlan_objmgr_pdev *pdev,
uint32_t chan_num)
{
return true;
}
#endif
#endif /* _WLAN_DFS_MLME_API_H_ */

View file

@ -54,6 +54,9 @@
* @mlme_rebuild_chan_list_with_non_dfs_channel: Rebuild channels with non-dfs
* channels.
* @mlme_restart_vaps_with_non_dfs_chan: Restart vaps with non-dfs channel.
* @mlme_check_allowed_prim_chanlist: Check whether the given channel is
* present in the primary allowed channel
* list or not.
*/
struct dfs_to_mlme {
QDF_STATUS (*pdev_component_obj_attach)(struct wlan_objmgr_pdev *pdev,
@ -130,6 +133,8 @@ struct dfs_to_mlme {
(struct wlan_objmgr_pdev *pdev);
QDF_STATUS (*mlme_restart_vaps_with_non_dfs_chan)
(struct wlan_objmgr_pdev *pdev, int no_chans_avail);
bool (*mlme_check_allowed_prim_chanlist)
(struct wlan_objmgr_pdev *pdev, uint32_t chan_num);
};
extern struct dfs_to_mlme global_dfs_to_mlme;

View file

@ -83,6 +83,8 @@ void register_dfs_callbacks(void)
mlme_dfs_rebuild_chan_list_with_non_dfs_channels;
tmp_dfs_to_mlme->mlme_restart_vaps_with_non_dfs_chan =
mlme_dfs_restart_vaps_with_non_dfs_chan;
tmp_dfs_to_mlme->mlme_check_allowed_prim_chanlist =
mlme_dfs_check_allowed_prim_chanlist;
}
#else
void register_dfs_callbacks(void)

View file

@ -305,3 +305,15 @@ void dfs_mlme_restart_vaps_with_non_dfs_chan(struct wlan_objmgr_pdev *pdev,
no_chans_avail);
}
#endif
#if defined(WLAN_SUPPORT_PRIMARY_ALLOWED_CHAN)
bool dfs_mlme_check_allowed_prim_chanlist(struct wlan_objmgr_pdev *pdev,
uint32_t chan_num)
{
if (!global_dfs_to_mlme.mlme_check_allowed_prim_chanlist)
return true;
return global_dfs_to_mlme.mlme_check_allowed_prim_chanlist(pdev,
chan_num);
}
#endif

View file

@ -22,6 +22,7 @@
* to outside of DFS component.
*/
#include "wlan_dfs_utils_api.h"
#include "wlan_dfs_mlme_api.h"
#include "../../core/src/dfs.h"
#include "../../core/src/dfs_zero_cac.h"
#include "../../core/src/dfs_etsi_precac.h"
@ -545,6 +546,9 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
center_freq = tmp_chan_list[i].dfs_ch_freq;
flagext = tmp_chan_list[i].dfs_ch_flagext;
if (!dfs_mlme_check_allowed_prim_chanlist(pdev, chan_num))
continue;
if ((is_curchan_5g) && WLAN_REG_IS_5GHZ_CH(chan_num)) {
chan_list[j].dfs_ch_ieee = chan_num;
chan_list[j].dfs_ch_freq = center_freq;