qcacmn: Skip STA scan on 6Ghz or 5ghz indoor chan if SAP is up

Currently STA can scan and come up on 6Ghz or indoor channel if
hardware is non-dbs and SAP is present

As part of this change, do not allow STA to scan on 6Ghz or
5Ghz indoor channel for non-dbs hardware if SAP is present

Change-Id: I97759f8b2c6a1c460d90fbb797a0e64d2532797c
CRs-Fixed: 3186406
Tento commit je obsažen v:
Jyoti Kumari
2022-05-04 15:22:20 +05:30
odevzdal Madan Koyyalamudi
rodič b434bd1dc2
revize 02f2ffb93a
6 změnil soubory, kde provedl 91 přidání a 0 odebrání

Zobrazit soubor

@@ -348,6 +348,8 @@ struct extscan_def_config {
* @adaptive_dwell_time_mode_nc: adaptive dwell mode without connection
* @honour_nl_scan_policy_flags: honour nl80211 scan policy flags
* @extscan_adaptive_dwell_mode: Adaptive dwell mode during ext scan
* @skip_6g_and_indoor_freq: skip 6Ghz and 5Gh indoor freq channel for
* STA scan if hw is non-DBS and SAP is present
* @scan_f_passive: passively scan all channels including active channels
* @scan_f_bcast_probe: add wild card ssid prbreq even if ssid_list is specified
* @scan_f_cck_rates: add cck rates to rates/xrates ie in prb req
@@ -440,6 +442,7 @@ struct scan_default_params {
enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode_nc;
bool honour_nl_scan_policy_flags;
enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
bool skip_6g_and_indoor_freq;
union {
struct {
uint32_t scan_f_passive:1,

Zobrazit soubor

@@ -842,6 +842,39 @@ static inline void scm_update_24g_chlist(struct scan_start_request *req)
req->scan_req.chan_list.num_chan = num_scan_channels;
}
/**
* scm_filter_6g_and_indoor_freq() - Modify channel list to skip 6Ghz and 5Ghz
* indoor channel if hw mode is non dbs and SAP is present
* @pdev: pointer to pdev
* @req: scan request
*
* Return: None
*/
static void scm_filter_6g_and_indoor_freq(struct wlan_objmgr_pdev *pdev,
struct scan_start_request *req)
{
uint32_t i;
uint32_t num_scan_channels;
qdf_freq_t freq;
num_scan_channels = 0;
for (i = 0; i < req->scan_req.chan_list.num_chan; i++) {
freq = req->scan_req.chan_list.chan[i].freq;
if (WLAN_REG_IS_6GHZ_CHAN_FREQ(freq))
continue;
if (wlan_reg_is_freq_indoor(pdev, freq))
continue;
req->scan_req.chan_list.chan[num_scan_channels++] =
req->scan_req.chan_list.chan[i];
}
if (num_scan_channels < req->scan_req.chan_list.num_chan)
scm_debug("6g and indoor channel chan skipped (%d, %d)",
req->scan_req.chan_list.num_chan, num_scan_channels);
req->scan_req.chan_list.num_chan = num_scan_channels;
}
/**
* scm_scan_chlist_concurrency_modify() - modify chan list to skip 5G if
* required
@@ -887,6 +920,17 @@ static inline void scm_scan_chlist_concurrency_modify(
if (trim & TRIM_CHANNEL_LIST_24G)
scm_update_24g_chlist(req);
}
/*
* Do not allow STA to scan on 6Ghz or indoor channel for non dbs
* hardware if SAP and skip_6g_and_indoor_freq_scan ini are present
*/
if (scan_obj->scan_def.skip_6g_and_indoor_freq &&
!policy_mgr_is_hw_dbs_capable(psoc) &&
(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_STA_MODE) &&
policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL))
scm_filter_6g_and_indoor_freq(pdev, req);
}
#else
static inline

Zobrazit soubor

@@ -1437,6 +1437,26 @@ enum scan_mode_6ghz {
false, \
"scan allow bss with corrupted ie")
/*
* <ini>
* skip_6g_and_indoor_freq_scan - Skip scan on 6Ghz and indoor channel
* @Min: 0
* @Max: 1
* @Default: 0
*
* This ini is used to skip 6Ghz and 5Gh indoor freq for STA scan if hw is
* non-DBS and SAP is present
*
* Related: scan
*
* Usage: External
*
* <ini>
*/
#define CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN CFG_INI_BOOL( \
"skip_6g_and_indoor_freq_scan", \
false, \
"skip sta scan on 6Ghz and 5Ghz indoor channel")
#define CFG_SCAN_ALL \
CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \
CFG(CFG_DROP_BCN_ON_INVALID_FREQ) \
@@ -1475,6 +1495,7 @@ enum scan_mode_6ghz {
CFG(CFG_6GHZ_SCAN_MODE) \
CFG(CFG_6GHZ_SCAN_MODE_DUTY_CYCLE) \
CFG(CFG_SCAN_ALLOW_BSS_WITH_CORRUPTED_IE) \
CFG(CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN) \
CFG_SCAN_PNO
#endif /* __CONFIG_SCAN_H */

Zobrazit soubor

@@ -419,4 +419,13 @@ void
wlan_scan_unregister_requester(struct wlan_objmgr_psoc *psoc,
wlan_scan_requester requester);
/**
* wlan_scan_cfg_skip_6g_and_indoor_freq() - API to get 6g and indoor freq
* scan ini val
* @psoc: psoc object
*
* Return: skip 6g and indoor freq scan or not
*/
bool wlan_scan_cfg_skip_6g_and_indoor_freq(
struct wlan_objmgr_psoc *psoc);
#endif

Zobrazit soubor

@@ -643,3 +643,13 @@ wlan_scan_unregister_requester(struct wlan_objmgr_psoc *psoc,
qdf_spin_unlock_bh(&scan->lock);
}
bool wlan_scan_cfg_skip_6g_and_indoor_freq(struct wlan_objmgr_psoc *psoc)
{
struct wlan_scan_obj *scan_obj;
scan_obj = wlan_psoc_get_scan_obj(psoc);
if (!scan_obj)
return false;
return scan_obj->scan_def.skip_6g_and_indoor_freq;
}

Zobrazit soubor

@@ -818,6 +818,10 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_6GHZ_SCAN_MODE_DUTY_CYCLE);
scan_obj->allow_bss_with_incomplete_ie =
cfg_get(psoc, CFG_SCAN_ALLOW_BSS_WITH_CORRUPTED_IE);
scan_obj->scan_def.skip_6g_and_indoor_freq =
cfg_get(psoc, CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN);
/* init scan id seed */
qdf_atomic_init(&scan_obj->scan_ids);