|
@@ -1166,6 +1166,7 @@ cm_roam_scan_offload_rssi_thresh(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
|
|
struct wlan_mlme_psoc_ext_obj *mlme_obj;
|
|
|
struct wlan_mlme_lfr_cfg *lfr_cfg;
|
|
|
struct rso_config_params *rso_config;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
|
|
|
mlme_obj = mlme_get_psoc_ext_obj(psoc);
|
|
|
if (!mlme_obj)
|
|
@@ -1200,6 +1201,40 @@ cm_roam_scan_offload_rssi_thresh(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
|
|
else
|
|
|
params->hi_rssi_scan_rssi_delta =
|
|
|
rso_cfg->cfg_param.hi_rssi_scan_rssi_delta;
|
|
|
+ /*
|
|
|
+ * When the STA operating band is 2.4/5 GHz and if the high RSSI delta
|
|
|
+ * is configured through vendor command then the priority should be
|
|
|
+ * given to it and the high RSSI delta value will be overridden with it.
|
|
|
+ */
|
|
|
+ vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
|
|
+ WLAN_MLME_CM_ID);
|
|
|
+ if (!vdev) {
|
|
|
+ mlme_err("Cannot set high RSSI offset as vdev object is NULL for vdev %d",
|
|
|
+ vdev_id);
|
|
|
+ } else {
|
|
|
+ qdf_freq_t op_freq;
|
|
|
+
|
|
|
+ op_freq = wlan_get_operation_chan_freq(vdev);
|
|
|
+ if (!WLAN_REG_IS_6GHZ_CHAN_FREQ(op_freq)) {
|
|
|
+ uint8_t roam_high_rssi_delta;
|
|
|
+
|
|
|
+ roam_high_rssi_delta =
|
|
|
+ wlan_cm_get_roam_scan_high_rssi_offset(psoc);
|
|
|
+ if (roam_high_rssi_delta)
|
|
|
+ params->hi_rssi_scan_rssi_delta =
|
|
|
+ roam_high_rssi_delta;
|
|
|
+ /*
|
|
|
+ * Firmware will use this flag to enable 5 to 6 GHz
|
|
|
+ * high RSSI roam
|
|
|
+ */
|
|
|
+ if (roam_high_rssi_delta &&
|
|
|
+ WLAN_REG_IS_5GHZ_CH_FREQ(op_freq))
|
|
|
+ params->flags |=
|
|
|
+ ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G;
|
|
|
+ }
|
|
|
+ wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
|
|
|
+ }
|
|
|
+
|
|
|
params->hi_rssi_scan_rssi_ub =
|
|
|
rso_cfg->cfg_param.hi_rssi_scan_rssi_ub;
|
|
|
params->raise_rssi_thresh_5g = lfr_cfg->rssi_boost_threshold_5g;
|
|
@@ -3721,6 +3756,59 @@ cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
+
|
|
|
+QDF_STATUS cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc,
|
|
|
+ uint8_t vdev_id,
|
|
|
+ uint8_t param_value)
|
|
|
+{
|
|
|
+ struct rso_config *rso_cfg;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+ struct wlan_roam_offload_scan_rssi_params *roam_rssi_params;
|
|
|
+ QDF_STATUS status = QDF_STATUS_E_INVAL;
|
|
|
+ qdf_freq_t op_freq;
|
|
|
+
|
|
|
+ vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
|
|
+ WLAN_MLME_CM_ID);
|
|
|
+ if (!vdev) {
|
|
|
+ mlme_err("vdev object is NULL for vdev %d", vdev_id);
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ op_freq = wlan_get_operation_chan_freq(vdev);
|
|
|
+ if (WLAN_REG_IS_6GHZ_CHAN_FREQ(op_freq)) {
|
|
|
+ mlme_err("vdev:%d High RSSI offset can't be set in 6 GHz band",
|
|
|
+ vdev_id);
|
|
|
+ goto rel_vdev_ref;
|
|
|
+ }
|
|
|
+
|
|
|
+ rso_cfg = wlan_cm_get_rso_config(vdev);
|
|
|
+ if (!rso_cfg)
|
|
|
+ goto rel_vdev_ref;
|
|
|
+
|
|
|
+ roam_rssi_params = qdf_mem_malloc(sizeof(*roam_rssi_params));
|
|
|
+ if (!roam_rssi_params)
|
|
|
+ goto rel_vdev_ref;
|
|
|
+
|
|
|
+ wlan_cm_set_roam_scan_high_rssi_offset(psoc, param_value);
|
|
|
+ qdf_mem_zero(roam_rssi_params, sizeof(*roam_rssi_params));
|
|
|
+ cm_roam_scan_offload_rssi_thresh(psoc, vdev_id,
|
|
|
+ roam_rssi_params, rso_cfg);
|
|
|
+ mlme_debug("vdev:%d Configured high RSSI delta=%d, 5 GHZ roam flag=%d",
|
|
|
+ vdev_id, roam_rssi_params->hi_rssi_scan_rssi_delta,
|
|
|
+ (roam_rssi_params->flags &
|
|
|
+ ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G));
|
|
|
+
|
|
|
+ status = wlan_cm_tgt_send_roam_scan_offload_rssi_params(
|
|
|
+ vdev, roam_rssi_params);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ mlme_err("fail to set roam scan high RSSI offset");
|
|
|
+
|
|
|
+ qdf_mem_free(roam_rssi_params);
|
|
|
+rel_vdev_ref:
|
|
|
+ wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
#endif
|
|
|
|
|
|
#ifdef WLAN_ADAPTIVE_11R
|