qcacmn: Add 6Ghz scan mode CFG item

Add 6ghz scan Mode CFG item and funcitonality
0 - Remove 6GHz channels in the scan request
1 - Allow/Add 6Ghz PSC channels to scan request
2 - Allow/Add all the 6Ghz channels

Change-Id: I2f07c30e599ace4592ae02a88d86876725abbb5f
CRs-Fixed: 2517277
このコミットが含まれているのは:
Sandeep Puligilla
2019-10-15 10:32:14 -07:00
committed by nshrivas
コミット 5939199242
4個のファイルの変更140行の追加0行の削除

ファイルの表示

@@ -30,6 +30,7 @@
#include <wlan_scan_public_structs.h>
#include "wlan_scan_cache_db.h"
#include "wlan_scan_11d.h"
#include "wlan_scan_cfg.h"
#define scm_alert(params...) \
QDF_TRACE_FATAL(QDF_MODULE_ID_SCAN, params)
@@ -299,6 +300,7 @@ struct extscan_def_config {
* @max_bss_per_pdev: maximum number of bss entries to be maintained per pdev
* @max_active_scans_allowed: maximum number of active parallel scan allowed
* per psoc
* @scan_mode_6g: scan mode in 6Ghz
* @enable_connected_scan: enable scans after connection
* @scan_priority: default scan priority
* @adaptive_dwell_time_mode: adaptive dwell mode with connection
@@ -386,6 +388,7 @@ struct scan_default_params {
uint8_t p2p_scan_burst_duration;
uint8_t go_scan_burst_duration;
uint8_t ap_scan_burst_duration;
enum scan_mode_6ghz scan_mode_6g;
bool enable_connected_scan;
enum scan_priority scan_priority;
enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode;

ファイルの表示

@@ -34,6 +34,7 @@
#include <wlan_policy_mgr_api.h>
#endif
#include <wlan_dfs_utils_api.h>
#include <wlan_scan_cfg.h>
QDF_STATUS
scm_scan_free_scan_request_mem(struct scan_start_request *req)
@@ -806,6 +807,97 @@ static inline void scm_scan_chlist_concurrency_modify(
}
#endif
#ifdef CONFIG_BAND_6GHZ
static void
scm_update_6ghz_channel_list(struct wlan_objmgr_vdev *vdev,
struct chan_list *chan_list,
struct wlan_scan_obj *scan_obj)
{
uint8_t i;
struct regulatory_channel *chan_list_6g;
bool psc_channel_found = false;
bool channel_6g_found = false;
uint8_t num_scan_channels = 0, channel_count;
struct wlan_objmgr_pdev *pdev;
uint32_t freq;
pdev = wlan_vdev_get_pdev(vdev);
if (!pdev)
return;
scm_debug("6g scan mode %d", scan_obj->scan_def.scan_mode_6g);
for (i = 0; i < chan_list->num_chan; i++) {
freq = chan_list->chan[i].freq;
if ((scan_obj->scan_def.scan_mode_6g ==
SCAN_MODE_6G_NO_CHANNEL) &&
(wlan_reg_is_6ghz_chan_freq(freq))) {
/* Drop the 6Ghz channels */
continue;
} else if ((scan_obj->scan_def.scan_mode_6g ==
SCAN_MODE_6G_PSC_CHANNEL) &&
(wlan_reg_is_6ghz_chan_freq(freq))) {
/* Allow only PSC channels */
if (wlan_reg_is_6ghz_psc_chan_freq(freq))
psc_channel_found = true;
else
continue;
} else if ((scan_obj->scan_def.scan_mode_6g ==
SCAN_MODE_6G_ALL_CHANNEL) &&
(wlan_reg_is_6ghz_chan_freq(freq))) {
/* Allow any 6ghz channel */
channel_6g_found = true;
}
chan_list->chan[num_scan_channels++] =
chan_list->chan[i];
}
scm_debug("psc_channel_found %d channel_6g_found%d",
psc_channel_found, channel_6g_found);
if ((scan_obj->scan_def.scan_mode_6g == SCAN_MODE_6G_PSC_CHANNEL &&
!psc_channel_found) ||
(scan_obj->scan_def.scan_mode_6g == SCAN_MODE_6G_ALL_CHANNEL &&
!channel_6g_found)) {
chan_list_6g = qdf_mem_malloc(NUM_6GHZ_CHANNELS *
sizeof(struct regulatory_channel));
if (!chan_list_6g)
goto end;
/* Add the 6Ghz channels based on config*/
channel_count = wlan_reg_get_band_channel_list(pdev,
REG_BAND_6G,
chan_list_6g);
scm_debug("Number of 6G channels %d", channel_count);
for (i = 0; i < channel_count; i++) {
if ((scan_obj->scan_def.scan_mode_6g ==
SCAN_MODE_6G_PSC_CHANNEL) &&
(!psc_channel_found) &&
wlan_reg_is_6ghz_psc_chan_freq(chan_list_6g[i].
center_freq)) {
chan_list->chan[num_scan_channels++].freq =
chan_list_6g[i].center_freq;
} else if ((scan_obj->scan_def.scan_mode_6g ==
SCAN_MODE_6G_ALL_CHANNEL) &&
(!channel_6g_found)) {
chan_list->chan[num_scan_channels++].freq =
chan_list_6g[i].center_freq;
}
}
}
scm_debug("Number of channels to scan %d", num_scan_channels);
for (i = 0; i < num_scan_channels; i++)
scm_debug("channels to scan %d", chan_list->chan[i].freq);
end:
chan_list->num_chan = num_scan_channels;
}
#else
static void
scm_update_6ghz_channel_list(struct wlan_objmgr_vdev *vdev,
struct chan_list *chan_list,
struct wlan_scan_obj *scan_obj)
{
}
#endif
/**
* scm_update_channel_list() - update scan req params depending on dfs inis
* and initial scan request.
@@ -872,10 +964,14 @@ scm_update_channel_list(struct scan_start_request *req,
continue;
if (utils_dfs_is_freq_in_nol(pdev, freq))
continue;
req->scan_req.chan_list.chan[num_scan_channels++] =
req->scan_req.chan_list.chan[i];
}
req->scan_req.chan_list.num_chan = num_scan_channels;
scm_update_6ghz_channel_list(req->vdev, &req->scan_req.chan_list,
scan_obj);
scm_scan_chlist_concurrency_modify(req->vdev, req);
}

ファイルの表示

@@ -24,6 +24,19 @@
#include "cfg_define.h"
/**
* enum scan_mode_6ghz - scan mode for 6GHz
* @SCAN_MODE_6G_NO_CHANNEL: Remove 6GHz channels in the scan request
* @SCAN_MODE_6G_PSC_CHANNEL: Allow/Add 6Ghz PSC channels to scan request
* @SCAN_MODE_6G_ALL_CHANNEL: Allow all the 6Ghz channels
*/
enum scan_mode_6ghz {
SCAN_MODE_6G_NO_CHANNEL,
SCAN_MODE_6G_PSC_CHANNEL,
SCAN_MODE_6G_ALL_CHANNEL,
SCAN_MODE_6G_MAX = SCAN_MODE_6G_ALL_CHANNEL,
};
/*
* <ini>
* drop_bcn_on_chan_mismatch - drop the beacon for chan mismatch
@@ -1189,6 +1202,32 @@
false,\
"Enable/Disable SNR Monitoring")
/*
* <ini>
* scan_mode_6ghz - 6ghz Scan mode
* @Min: 0
* @Max: 2
* @Default: 2
*
* Configure the 6Ghz scan mode
* 0 - Remove 6GHz channels in the scan request
* 1 - Allow/Add 6Ghz PSC channels to scan request
* 2 - Allow all the 6Ghz channels
*
* Related: SCAN
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_6GHZ_SCAN_MODE CFG_INI_UINT( \
"scan_mode_6ghz", \
SCAN_MODE_6G_NO_CHANNEL, \
SCAN_MODE_6G_MAX, \
SCAN_MODE_6G_PSC_CHANNEL, \
CFG_VALUE_OR_DEFAULT, \
"6ghz scan mode")
#define CFG_SCAN_ALL \
CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \
CFG(CFG_ENABLE_WAKE_LOCK_IN_SCAN) \
@@ -1220,6 +1259,7 @@
CFG(CFG_ENABLE_SNR_MONITORING) \
CFG(CFG_AP_SCAN_BURST_DURATION) \
CFG(CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH) \
CFG(CFG_6GHZ_SCAN_MODE) \
CFG_SCAN_PNO
#endif /* __CONFIG_SCAN_H */

ファイルの表示

@@ -1042,6 +1042,7 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc,
scan_obj->scan_def.scan_ev_restarted = true;
scan_obj->scan_def.enable_connected_scan =
cfg_get(psoc, CFG_ENABLE_CONNECTED_SCAN);
scan_obj->scan_def.scan_mode_6g = cfg_get(psoc, CFG_6GHZ_SCAN_MODE);
/* init scan id seed */
qdf_atomic_init(&scan_obj->scan_ids);