qcacld-3.0: Add vendor attribute to include 6 GHz in roam full scan

During the roam scan, if there are no desired APs found in the partial
frequency list, an immediate full scan on all the supported frequencies
is initiated as a fallback. This would include the 6 GHz PSC
frequencies by default.
This attribute allow that behavior to be modified to include PSCs only
if 6 GHz use has been detected in the environment.

Change-Id: I6dc380419f14b920737fd87cd9a487c28364563b
CRs-Fixed: 3351697
This commit is contained in:
Srikanth Marepalli 2022-12-02 16:21:08 +05:30
commit 30d7a094d6
12 changed files with 283 additions and 0 deletions

View file

@ -1725,6 +1725,8 @@ struct fw_scan_channels {
* @roam_ho_delay_config: Roam HO delay value
* @exclude_rm_partial_scan_freq: Exclude the channels in roam full scan that
* are already scanned as part of partial scan.
* @roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full scan
* only on prior discovery of any 6 GHz support in the environment.
*/
struct wlan_mlme_lfr_cfg {
bool mawc_roam_enabled;
@ -1845,6 +1847,7 @@ struct wlan_mlme_lfr_cfg {
bool enable_ft_over_ds;
uint16_t roam_ho_delay_config;
uint8_t exclude_rm_partial_scan_freq;
uint8_t roam_full_scan_6ghz_on_disc;
};
/**

View file

@ -197,6 +197,40 @@ target_if_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_vdev *vdev,
return status;
}
/**
* target_if_cm_roam_full_scan_6ghz_on_disc() - Indicate to FW whether to
* include the 6 GHz channels in roam full scan only on prior discovery of any
* 6 GHz support in the environment or by default.
* @vdev: vdev object
* @roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full scan:
* 1 - Include only on prior discovery of any 6 GHz support in the environment
* 0 - Include all the supported 6 GHz channels by default
*
* Return: QDF_STATUS
*/
static QDF_STATUS
target_if_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_vdev *vdev,
uint8_t roam_full_scan_6ghz_on_disc)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
uint8_t vdev_id;
wmi_unified_t wmi_handle;
wmi_handle = target_if_cm_roam_get_wmi_handle_from_vdev(vdev);
if (!wmi_handle)
return status;
vdev_id = wlan_vdev_get_id(vdev);
status = target_if_roam_set_param(wmi_handle, vdev_id,
WMI_ROAM_PARAM_ROAM_CONTROL_FULL_SCAN_6GHZ_PSC_ONLY_WITH_RNR,
roam_full_scan_6ghz_on_disc);
if (QDF_IS_STATUS_ERROR(status))
target_if_err("Failed to set WMI_ROAM_PARAM_ROAM_CONTROL_FULL_SCAN_6GHZ_PSC_ONLY_WITH_RNR");
return status;
}
static void
target_if_cm_roam_register_lfr3_ops(struct wlan_cm_roam_tx_ops *tx_ops)
{
@ -205,6 +239,8 @@ target_if_cm_roam_register_lfr3_ops(struct wlan_cm_roam_tx_ops *tx_ops)
tx_ops->send_roam_ho_delay_config = target_if_cm_roam_ho_delay_config;
tx_ops->send_exclude_rm_partial_scan_freq =
target_if_cm_exclude_rm_partial_scan_freq;
tx_ops->send_roam_full_scan_6ghz_on_disc =
target_if_cm_roam_full_scan_6ghz_on_disc;
}
#else
static inline void
@ -231,6 +267,13 @@ target_if_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_vdev *vdev,
{
return QDF_STATUS_E_NOSUPPORT;
}
static QDF_STATUS
target_if_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_vdev *vdev,
uint8_t roam_full_scan_6ghz_on_disc)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
/**
@ -1124,6 +1167,10 @@ target_if_cm_roam_send_start(struct wlan_objmgr_vdev *vdev,
if (req->wlan_exclude_rm_partial_scan_freq)
target_if_cm_exclude_rm_partial_scan_freq(
vdev, req->wlan_exclude_rm_partial_scan_freq);
if (req->wlan_roam_full_scan_6ghz_on_disc)
target_if_cm_roam_full_scan_6ghz_on_disc(
vdev, req->wlan_roam_full_scan_6ghz_on_disc);
/* add other wmi commands */
end:
return status;
@ -1355,6 +1402,10 @@ target_if_cm_roam_send_update_config(struct wlan_objmgr_vdev *vdev,
if (req->wlan_exclude_rm_partial_scan_freq)
target_if_cm_exclude_rm_partial_scan_freq(
vdev, req->wlan_exclude_rm_partial_scan_freq);
if (req->wlan_roam_full_scan_6ghz_on_disc)
target_if_cm_roam_full_scan_6ghz_on_disc(
vdev, req->wlan_roam_full_scan_6ghz_on_disc);
}
end:
return status;

View file

@ -302,6 +302,21 @@ cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
return status;
}
QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
uint8_t param_value)
{
QDF_STATUS status;
wlan_cm_roam_set_full_scan_6ghz_on_disc(psoc, param_value);
status = wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(psoc, vdev_id,
param_value);
if (QDF_IS_STATUS_ERROR(status))
mlme_debug("fail to send 6 GHz channels inclusion in full scan");
return status;
}
#else
static inline void
cm_roam_reason_vsie(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
@ -562,6 +577,9 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
start_req->wlan_exclude_rm_partial_scan_freq =
wlan_cm_get_exclude_rm_partial_scan_freq(psoc);
start_req->wlan_roam_full_scan_6ghz_on_disc =
wlan_cm_roam_get_full_scan_6ghz_on_disc(psoc);
status = wlan_cm_tgt_send_roam_start_req(psoc, vdev_id, start_req);
if (QDF_IS_STATUS_ERROR(status))
mlme_debug("fail to send roam start");
@ -617,6 +635,9 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
update_req->wlan_exclude_rm_partial_scan_freq =
wlan_cm_get_exclude_rm_partial_scan_freq(psoc);
update_req->wlan_roam_full_scan_6ghz_on_disc =
wlan_cm_roam_get_full_scan_6ghz_on_disc(psoc);
status = wlan_cm_tgt_send_roam_update_req(psoc, vdev_id, update_req);
if (QDF_IS_STATUS_ERROR(status))
mlme_debug("fail to send update config");

View file

@ -142,6 +142,20 @@ cm_roam_send_ho_delay_config(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint8_t param_value);
/**
* cm_roam_full_scan_6ghz_on_disc() - Include the 6 GHz channels in roam full
* scan only on prior discovery of any 6 GHz support in the environment
* @psoc: PSOC pointer
* @vdev_id: vdev id
* @param_value: Include the 6 GHz channels in roam full scan:
* 1 - Include only on prior discovery of any 6 GHz support in the environment
* 0 - Include all the supported 6 GHz channels by default
*
* Return: QDF_STATUS
*/
QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint8_t param_value);
#else
static inline QDF_STATUS
cm_roam_send_rt_stats_config(struct wlan_objmgr_psoc *psoc,
@ -163,6 +177,13 @@ cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline
QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint8_t param_value)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
/**

View file

@ -183,6 +183,33 @@ wlan_cm_set_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
uint8_t
wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc);
/**
* wlan_cm_roam_set_full_scan_6ghz_on_disc() - set value to include the 6 GHz
* channels in roam full scan only on prior discovery of any 6 GHz support in
* the environment.
* @psoc: PSOC pointer
* @roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full scan:
* 1 - Include only on prior discovery of any 6 GHz support in the environment
* 0 - Include all the supported 6 GHz channels by default
*
* Return: none
*/
void
wlan_cm_roam_set_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
uint8_t roam_full_scan_6ghz_on_disc);
/**
* wlan_cm_roam_get_full_scan_6ghz_on_disc() - Get value to include the 6 GHz
* channels in roam full scan only on prior discovery of any 6 GHz support in
* the environment.
* @psoc: PSOC pointer
*
* Return:
* 1 - Include only on prior discovery of any 6 GHz support in the environment
* 0 - Include all the supported 6 GHz channels by default
*/
uint8_t wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc);
#else
static inline QDF_STATUS
wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
@ -793,5 +820,11 @@ wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc)
{
return 0;
}
static inline uint8_t
wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc)
{
return 0;
}
#endif /* FEATURE_ROAM_OFFLOAD */
#endif /* WLAN_CM_ROAM_API_H__ */

View file

@ -1171,6 +1171,8 @@ enum roam_rt_stats_params {
* @wlan_roam_ho_delay_config: roam HO delay value
* @wlan_exclude_rm_partial_scan_freq: Include/exclude the channels in roam full
* scan that are already scanned as part of partial scan.
* @wlan_roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full
* scan only on prior discovery of any 6 GHz support in the environment.
*/
struct wlan_roam_start_config {
struct wlan_roam_offload_scan_rssi_params rssi_params;
@ -1192,6 +1194,7 @@ struct wlan_roam_start_config {
uint8_t wlan_roam_rt_stats_config;
uint16_t wlan_roam_ho_delay_config;
uint8_t wlan_exclude_rm_partial_scan_freq;
uint8_t wlan_roam_full_scan_6ghz_on_disc;
/* other wmi cmd structures */
};
@ -1240,6 +1243,8 @@ struct wlan_roam_stop_config {
* @wlan_roam_ho_delay_config: roam HO delay value
* @wlan_exclude_rm_partial_scan_freq: Include/exclude the channels in roam full
* scan that are already scanned as part of partial scan.
* @wlan_roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full
* scan only on prior discovery of any 6 GHz support in the environment.
*/
struct wlan_roam_update_config {
struct wlan_roam_beacon_miss_cnt beacon_miss_cnt;
@ -1256,6 +1261,7 @@ struct wlan_roam_update_config {
uint8_t wlan_roam_rt_stats_config;
uint16_t wlan_roam_ho_delay_config;
uint8_t wlan_exclude_rm_partial_scan_freq;
uint8_t wlan_roam_full_scan_6ghz_on_disc;
};
#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
@ -1384,6 +1390,8 @@ struct set_pcl_req {
* @send_roam_ho_delay_config: Send roam Hand-off delay value to FW
* @send_exclude_rm_partial_scan_freq: Include/exclude the channels in roam full
* scan that are already scanned as part of partial scan.
* @send_roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full
* scan only on prior discovery of any 6 GHz support in the environment.
*/
struct wlan_cm_roam_tx_ops {
QDF_STATUS (*send_vdev_set_pcl_cmd)(struct wlan_objmgr_vdev *vdev,
@ -1417,6 +1425,9 @@ struct wlan_cm_roam_tx_ops {
QDF_STATUS (*send_exclude_rm_partial_scan_freq)(
struct wlan_objmgr_vdev *vdev,
uint8_t value);
QDF_STATUS (*send_roam_full_scan_6ghz_on_disc)(
struct wlan_objmgr_vdev *vdev,
uint8_t value);
#endif
};

View file

@ -212,6 +212,21 @@ ucfg_cm_roam_send_ho_delay_config(struct wlan_objmgr_pdev *pdev,
QDF_STATUS
ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id, uint8_t param_value);
/**
* ucfg_cm_roam_full_scan_6ghz_on_disc() - Include the 6 GHz channels in roam
* full scan only on prior discovery of any 6 GHz support in the environment.
* @pdev: Pointer to pdev
* @vdev_id: vdev id
* @param_value: Include the 6 GHz channels in roam full scan:
* 1 - Include only on prior discovery of any 6 GHz support in the environment
* 0 - Include all the supported 6 GHz channels by default
*
* Return: QDF_STATUS
*/
QDF_STATUS ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
uint8_t param_value);
#else
static inline QDF_STATUS
ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
@ -255,4 +270,11 @@ ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev *pdev,
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS
ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id, uint8_t param_value)
{
return QDF_STATUS_SUCCESS;
}
#endif

View file

@ -76,6 +76,23 @@ QDF_STATUS
wlan_cm_tgt_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
uint8_t exclude_rm_partial_scan_freq);
/**
* wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc() - Include the 6 GHz channels
* in roam full scan only on prior discovery of any 6 GHz support in the
* environment.
* @psoc: PSOC pointer
* @roam_inc_6ghz_if_disc: Include the 6 GHz channels in roam full scan:
* 1 - Include only on prior discovery of any 6 GHz support in the environment
* 0 - Include all the supported 6 GHz channels by default
*
* Return: QDF_STATUS
*/
QDF_STATUS
wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
uint8_t roam_full_scan_6ghz_on_disc);
#else
static inline QDF_STATUS
wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc,
@ -105,6 +122,15 @@ wlan_cm_tgt_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
{
return QDF_STATUS_E_FAILURE;
}
static inline QDF_STATUS
wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
uint8_t roam_full_scan_6ghz_on_disc)
{
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)

View file

@ -944,4 +944,31 @@ wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc)
return mlme_obj->cfg.lfr.exclude_rm_partial_scan_freq;
}
void
wlan_cm_roam_set_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
uint8_t roam_full_scan_6ghz_on_disc)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj)
return;
mlme_obj->cfg.lfr.roam_full_scan_6ghz_on_disc =
roam_full_scan_6ghz_on_disc;
}
uint8_t wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj) {
mlme_legacy_err("Failed to get MLME Obj");
return 0;
}
return mlme_obj->cfg.lfr.roam_full_scan_6ghz_on_disc;
}
#endif

View file

@ -156,4 +156,13 @@ ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev *pdev,
return cm_exclude_rm_partial_scan_freq(psoc, vdev_id, param_value);
}
QDF_STATUS ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
uint8_t param_value)
{
struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
return cm_roam_full_scan_6ghz_on_disc(psoc, vdev_id, param_value);
}
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */

View file

@ -266,6 +266,39 @@ wlan_cm_tgt_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
return status;
}
QDF_STATUS wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
uint8_t roam_full_scan_6ghz_on_disc)
{
QDF_STATUS status;
struct wlan_cm_roam_tx_ops *roam_tx_ops;
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_MLME_NB_ID);
if (!vdev)
return QDF_STATUS_E_INVAL;
roam_tx_ops = wlan_cm_roam_get_tx_ops_from_vdev(vdev);
if (!roam_tx_ops || !roam_tx_ops->send_roam_full_scan_6ghz_on_disc) {
mlme_err("vdev %d send_roam_full_scan_6ghz_on_disc is NULL",
vdev_id);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return QDF_STATUS_E_INVAL;
}
status = roam_tx_ops->send_roam_full_scan_6ghz_on_disc(
vdev, roam_full_scan_6ghz_on_disc);
if (QDF_IS_STATUS_ERROR(status))
mlme_debug("vdev %d fail to send inclusion of 6 GHz channels",
vdev_id);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return status;
}
#endif
#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)

View file

@ -4648,6 +4648,8 @@ roam_control_policy[QCA_ATTR_ROAM_CONTROL_MAX + 1] = {
[QCA_ATTR_ROAM_CONTROL_HO_DELAY_FOR_RX] = {.type = NLA_U16},
[QCA_ATTR_ROAM_CONTROL_FULL_SCAN_NO_REUSE_PARTIAL_SCAN_FREQ] = {
.type = NLA_U8},
[QCA_ATTR_ROAM_CONTROL_FULL_SCAN_6GHZ_ONLY_ON_PRIOR_DISCOVERY] = {
.type = NLA_U8},
};
/**
@ -5047,6 +5049,11 @@ hdd_send_roam_scan_period_to_sme(struct hdd_context *hdd_ctx,
#define INCLUDE_ROAM_PARTIAL_SCAN_FREQ 0
#define EXCLUDE_ROAM_PARTIAL_SCAN_FREQ 1
/* Include the supported 6 GHz PSC channels in full scan by default */
#define INCLUDE_6GHZ_IN_FULL_SCAN_BY_DEF 0
/* Include the 6 GHz channels in roam full scan only on prior discovery */
#define INCLUDE_6GHZ_IN_FULL_SCAN_IF_DISC 1
/**
* hdd_set_roam_with_control_config() - Set roam control configuration
* @hdd_ctx: HDD context
@ -5275,6 +5282,25 @@ hdd_set_roam_with_control_config(struct hdd_context *hdd_ctx,
hdd_err("Fail to exclude roam partial scan channels");
}
attr = tb2[QCA_ATTR_ROAM_CONTROL_FULL_SCAN_6GHZ_ONLY_ON_PRIOR_DISCOVERY];
if (attr) {
value = nla_get_u8(attr);
if (value < INCLUDE_6GHZ_IN_FULL_SCAN_BY_DEF ||
value > INCLUDE_6GHZ_IN_FULL_SCAN_IF_DISC) {
hdd_err("Invalid value %d to decide inclusion of 6 GHz channels",
value);
return -EINVAL;
}
hdd_debug("Include 6 GHz channels in roam full scan by %s",
value ? "prior discovery" : "default");
status = ucfg_cm_roam_full_scan_6ghz_on_disc(hdd_ctx->pdev,
vdev_id, value);
if (QDF_IS_STATUS_ERROR(status))
hdd_err("Fail to decide inclusion of 6 GHz channels");
}
return qdf_status_to_os_return(status);
}