From 8580e33717c6c35db6f401fcaea442932a62ec37 Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Wed, 27 Dec 2023 18:03:32 +0530 Subject: [PATCH 1/9] qcacld-3.0: Add vendor attribute for high RSSI roam trigger threshold Currently the roam scan high RSSI delta is configured via INI. Define an attribute to allow user configure high RSSI roam trigger threshold. STA is expected to trigger roam if the current connected AP's RSSI gets above this high RSSI threshold. STA's roam attempt on high RSSI threshold aims to find candidates from other better Wi-Fi bands. This attribute value is given priority over the INI. Use a new service bit WMI_SERVICE_5GHZ_HI_RSSI_ROAM_SUPPORT to enable high RSSI roam trigger in 5 GHz as well. Change-Id: Ide48ad2261b603de36bd1b31114b91c3a9d6606f CRs-Fixed: 3586170 --- .../dispatcher/inc/wlan_mlme_public_struct.h | 3 + .../src/target_if_cm_roam_offload.c | 63 ++++++++++++++++++- .../core/src/wlan_cm_roam_offload.c | 47 +++++++++++++- .../core/src/wlan_cm_roam_offload.h | 17 ++++- .../dispatcher/inc/wlan_cm_roam_api.h | 46 +++++++++++++- .../inc/wlan_cm_roam_public_struct.h | 22 ++++++- .../dispatcher/inc/wlan_cm_roam_ucfg_api.h | 27 +++++++- .../dispatcher/inc/wlan_cm_tgt_if_tx_api.h | 16 ++++- .../dispatcher/src/wlan_cm_roam_api.c | 29 ++++++++- .../dispatcher/src/wlan_cm_tgt_if_tx_api.c | 30 ++++++++- components/wmi/src/wmi_unified_roam_tlv.c | 3 +- core/hdd/src/wlan_hdd_cfg80211.c | 26 ++++++++ core/sme/src/csr/csr_api_roam.c | 54 ++++++++++++++++ 13 files changed, 373 insertions(+), 10 deletions(-) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 12d2f7de3c15..ad48cd35c0cd 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1631,6 +1631,8 @@ struct fw_scan_channels { * vsie in Re(assoc) frame * @roam_trigger_bitmap: Bitmap of roaming triggers. * @sta_roam_disable STA roaming disabled by interfaces + * @roam_high_rssi_delta: Delta change in high RSSI at which roam scan is + * triggered in 2.4/5 GHz. * @early_stop_scan_enable: Set early stop scan * @enable_5g_band_pref: Enable preference for 5G from INI * @ese_enabled: Enable ESE feature @@ -1752,6 +1754,7 @@ struct wlan_mlme_lfr_cfg { bool enable_roam_reason_vsie; uint32_t roam_trigger_bitmap; uint32_t sta_roam_disable; + uint8_t roam_high_rssi_delta; #endif bool early_stop_scan_enable; bool enable_5g_band_pref; diff --git a/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c b/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c index 7ad9b0a04ffc..46e1cab26484 100644 --- a/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c +++ b/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -264,6 +264,56 @@ target_if_cm_roam_rssi_diff_6ghz(struct wlan_objmgr_vdev *vdev, return status; } +static QDF_STATUS +target_if_cm_roam_scan_offload_rssi_thresh( + wmi_unified_t wmi_handle, + struct wlan_roam_offload_scan_rssi_params *req); + +/** + * target_if_cm_roam_scan_offload_rssi_params() - Set the RSSI parameters + * for roam offload scan + * @vdev: vdev object + * @roam_rssi_params: structure containing parameters for roam offload scan + * based on RSSI + * + * Return: QDF_STATUS + */ +static QDF_STATUS +target_if_cm_roam_scan_offload_rssi_params( + struct wlan_objmgr_vdev *vdev, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params) +{ + QDF_STATUS status = QDF_STATUS_E_FAILURE; + wmi_unified_t wmi_handle; + + wmi_handle = target_if_cm_roam_get_wmi_handle_from_vdev(vdev); + if (!wmi_handle) + return status; + + status = target_if_cm_roam_scan_offload_rssi_thresh(wmi_handle, + roam_rssi_params); + + return status; +} + +static void +target_if_check_hi_rssi_5ghz_support( + wmi_unified_t wmi_handle, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params) +{ + if ((roam_rssi_params->flags & + ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G) && + wmi_service_enabled(wmi_handle, + wmi_service_5ghz_hi_rssi_roam_support)) { + target_if_debug("FW supports Hi RSSI roam in 5 GHz"); + roam_rssi_params->flags |= + WMI_ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G; + } else { + roam_rssi_params->flags &= + ~ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G; + } +} + static void target_if_cm_roam_register_lfr3_ops(struct wlan_cm_roam_tx_ops *tx_ops) { @@ -274,6 +324,8 @@ target_if_cm_roam_register_lfr3_ops(struct wlan_cm_roam_tx_ops *tx_ops) 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; + tx_ops->send_roam_scan_offload_rssi_params = + target_if_cm_roam_scan_offload_rssi_params; } #else static inline void @@ -314,6 +366,12 @@ target_if_cm_roam_rssi_diff_6ghz(struct wlan_objmgr_vdev *vdev, { return QDF_STATUS_E_NOSUPPORT; } + +static inline void +target_if_check_hi_rssi_5ghz_support( + wmi_unified_t wmi_handle, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params) +{} #endif /** @@ -678,6 +736,9 @@ target_if_cm_roam_scan_offload_rssi_thresh( } } + if (req->hi_rssi_scan_rssi_delta) + target_if_check_hi_rssi_5ghz_support(wmi_handle, req); + target_if_debug("RSO_CFG: vdev %d: db2dbm enabled:%d, good_rssi_threshold:%d, early_stop_thresholds en:%d, min:%d, max:%d, roam_scan_rssi_thresh:%d, roam_rssi_thresh_diff:%d", req->vdev_id, db2dbm_enabled, req->good_rssi_threshold, req->early_stop_scan_enable, diff --git a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c index 9883bfc6a980..647f5e0229b2 100644 --- a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c +++ b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -317,6 +317,51 @@ QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc, return status; } + +QDF_STATUS cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, + uint8_t param_value) +{ + struct wlan_objmgr_vdev *vdev; + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params; + QDF_STATUS status = QDF_STATUS_E_INVAL; + + 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; + } + + 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)); + status = wlan_cm_roam_scan_offload_rssi_thresh(psoc, vdev_id, + roam_rssi_params); + if (!QDF_IS_STATUS_SUCCESS(status)) { + mlme_err("fail to set roam scan offload RSSI threshold params"); + goto mem_free; + } + 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_SUCCESS(status)) + mlme_err("fail to set roam scan high RSSI offset"); + +mem_free: + qdf_mem_free(roam_rssi_params); +rel_vdev_ref: + wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID); + + return status; +} #else static inline void cm_roam_reason_vsie(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, diff --git a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h index 5ae40f27e891..3917d8ac373f 100644 --- a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h +++ b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -156,6 +156,21 @@ cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t param_value); + +/** + * cm_set_roam_scan_high_rssi_offset() - Set the delta change in high RSSI at + * which roam scan is triggered in 2.4/5 GHz. + * @psoc: PSOC pointer + * @vdev_id: vdev id + * @param_value: Set the High RSSI delta for roam scan trigger + * * 1-16 - Set an offset value in this range + * * 0 - Disable + * + * Return: QDF_STATUS + */ +QDF_STATUS +cm_set_roam_scan_high_rssi_offset(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, diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h index 6cdd5965714b..479800eaa880 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -692,6 +692,44 @@ wlan_cm_roam_set_ho_delay_config(struct wlan_objmgr_psoc *psoc, */ uint16_t wlan_cm_roam_get_ho_delay_config(struct wlan_objmgr_psoc *psoc); + +/** + * wlan_cm_set_roam_scan_high_rssi_offset() - Set the delta change in high RSSI + * at which roam scan is triggered in 2.4/5 GHz. + * @psoc: PSOC pointer + * @roam_high_rssi_delta: Set the High RSSI delta for roam scan trigger + * * 1-16 - Set an offset value in this range + * * 0 - Disable + * + * Return: none + */ +void +wlan_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc, + uint8_t roam_high_rssi_delta); + +/** + * wlan_cm_get_roam_scan_high_rssi_offset() - Get the delta change in high RSSI + * at which roam scan is triggered in 2.4/5 GHz. + * @psoc: PSOC pointer + * + * Return: High RSSI delta for roam scan trigger + */ +uint8_t wlan_cm_get_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc); + +/** + * wlan_cm_roam_scan_offload_rssi_thresh() - set roam offload scan rssi + * parameters + * @psoc: PSOC pointer + * @vdev_id: VDEV id + * @roam_rssi_params: roam offload scan rssi related parameters + * + * This function is used to set roam offload scan rssi related parameters + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_cm_roam_scan_offload_rssi_thresh( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params); #else static inline void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc, @@ -826,5 +864,11 @@ wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc) { return 0; } + +static inline uint8_t +wlan_cm_get_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc) +{ + return 0; +} #endif /* FEATURE_ROAM_OFFLOAD */ #endif /* WLAN_CM_ROAM_API_H__ */ diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h index 6118e79b7484..05b4dfc2ec31 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -980,6 +980,19 @@ struct wlan_roam_scan_offload_params { #endif }; +/** + * enum wlan_roam_offload_scan_rssi_flags - Flags for roam scan RSSI threshold + * params, this enums will be used in flags param of the structure + * wlan_roam_offload_scan_rssi_params + * @ROAM_SCAN_RSSI_THRESHOLD_INVALID_FLAG: invalid flag + * @ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G: enable high RSSI roam + * trigger support to roam from 5 GHz to 6 GHz band + */ +enum wlan_roam_offload_scan_rssi_flags { + ROAM_SCAN_RSSI_THRESHOLD_INVALID_FLAG, + ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G = BIT(0), +}; + /** * struct wlan_roam_offload_scan_rssi_params - structure containing * parameters for roam offload scan based on RSSI @@ -1015,6 +1028,7 @@ struct wlan_roam_scan_offload_params { * roam * @roam_data_rssi_threshold: Bad data RSSI threshold to roam * @rx_data_inactivity_time: Rx duration to check data RSSI + * @flags: Flags for roam scan RSSI threshold params */ struct wlan_roam_offload_scan_rssi_params { int8_t rssi_thresh; @@ -1046,6 +1060,7 @@ struct wlan_roam_offload_scan_rssi_params { uint32_t roam_data_rssi_threshold_triggers; int32_t roam_data_rssi_threshold; uint32_t rx_data_inactivity_time; + uint32_t flags; }; /** @@ -1400,6 +1415,8 @@ struct set_pcl_req { * 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. + * @send_roam_scan_offload_rssi_params: Set the RSSI parameters for roam + * offload scan */ struct wlan_cm_roam_tx_ops { QDF_STATUS (*send_vdev_set_pcl_cmd)(struct wlan_objmgr_vdev *vdev, @@ -1436,6 +1453,9 @@ struct wlan_cm_roam_tx_ops { QDF_STATUS (*send_roam_full_scan_6ghz_on_disc)( struct wlan_objmgr_vdev *vdev, uint8_t value); + QDF_STATUS (*send_roam_scan_offload_rssi_params)( + struct wlan_objmgr_vdev *vdev, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params); #endif }; diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h index b4ec5f2543dd..7def60210b3b 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -227,6 +227,24 @@ ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev *pdev, QDF_STATUS ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id, uint8_t param_value); + +/** + * ucfg_cm_set_roam_scan_high_rssi_offset() - Set the delta change in high RSSI + * at which roam scan is triggered in 2.4/5 GHz. + * @psoc: Pointer to psoc object + * @vdev_id: vdev id + * @param_value: Set the High RSSI delta for roam scan trigger + * 0 - Disable + * 1-16 - Set an offset value in this range + * + * Return: QDF_STATUS + */ +static inline QDF_STATUS +ucfg_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint8_t param_value) +{ + return cm_set_roam_scan_high_rssi_offset(psoc, vdev_id, param_value); +} #else static inline QDF_STATUS ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc, @@ -277,4 +295,11 @@ ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev, { return QDF_STATUS_SUCCESS; } + +static inline QDF_STATUS +ucfg_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint8_t param_value) +{ + return QDF_STATUS_SUCCESS; +} #endif diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h index 05486e85645a..60a8c96776de 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -93,6 +93,20 @@ 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); + +/** + * wlan_cm_tgt_send_roam_scan_offload_rssi_params() - Set the RSSI parameters + * for roam offload scan + * @vdev: Pointer to vdev object + * @roam_rssi_params: structure containing parameters for roam offload scan + * based on RSSI + * + * Return: QDF_STATUS + */ +QDF_STATUS +wlan_cm_tgt_send_roam_scan_offload_rssi_params( + struct wlan_objmgr_vdev *vdev, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params); #else static inline QDF_STATUS wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc, diff --git a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c index 578cb0e3ddaf..53fce94e29c3 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c +++ b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -922,7 +922,9 @@ wlan_cm_roam_get_ho_delay_config(struct wlan_objmgr_psoc *psoc) return mlme_obj->cfg.lfr.roam_ho_delay_config; } +#endif +#ifdef WLAN_FEATURE_ROAM_OFFLOAD void wlan_cm_set_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc, uint8_t exclude_rm_partial_scan_freq) @@ -977,4 +979,29 @@ uint8_t wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc) return mlme_obj->cfg.lfr.roam_full_scan_6ghz_on_disc; } + +void +wlan_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc, + uint8_t roam_high_rssi_delta) +{ + 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_high_rssi_delta = roam_high_rssi_delta; +} + +uint8_t +wlan_cm_get_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return 0; + + return mlme_obj->cfg.lfr.roam_high_rssi_delta; +} #endif diff --git a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c index f69e416f59a0..69f7501a2688 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c +++ b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -299,6 +299,34 @@ QDF_STATUS wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc( return status; } + +QDF_STATUS +wlan_cm_tgt_send_roam_scan_offload_rssi_params( + struct wlan_objmgr_vdev *vdev, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params) +{ + QDF_STATUS status; + uint8_t vdev_id; + struct wlan_cm_roam_tx_ops *roam_tx_ops; + + vdev_id = wlan_vdev_get_id(vdev); + + roam_tx_ops = wlan_cm_roam_get_tx_ops_from_vdev(vdev); + if (!roam_tx_ops || !roam_tx_ops->send_roam_scan_offload_rssi_params) { + mlme_err("vdev %d send_roam_scan_offload_rssi_params 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_scan_offload_rssi_params( + vdev, roam_rssi_params); + if (QDF_IS_STATUS_ERROR(status)) + mlme_debug("vdev %d fail to send roam scan offload RSSI params", + vdev_id); + + return status; +} #endif #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c index 287fa9c77d8d..0c6e35797f17 100644 --- a/components/wmi/src/wmi_unified_roam_tlv.c +++ b/components/wmi/src/wmi_unified_roam_tlv.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -215,6 +215,7 @@ static QDF_STATUS send_roam_scan_offload_rssi_thresh_cmd_tlv( rssi_threshold_fp->hirssi_upper_bound = roam_req->hi_rssi_scan_rssi_ub; rssi_threshold_fp->rssi_thresh_offset_5g = roam_req->rssi_thresh_offset_5g; + rssi_threshold_fp->flags = roam_req->flags; buf_ptr += sizeof(wmi_roam_scan_rssi_threshold_fixed_param); WMITLV_SET_HDR(buf_ptr, diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 297ea8fd24d6..15a16ec28070 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4655,6 +4655,7 @@ roam_control_policy[QCA_ATTR_ROAM_CONTROL_MAX + 1] = { .type = NLA_U8}, [QCA_ATTR_ROAM_CONTROL_FULL_SCAN_6GHZ_ONLY_ON_PRIOR_DISCOVERY] = { .type = NLA_U8}, + [QCA_ATTR_ROAM_CONTROL_CONNECTED_HIGH_RSSI_OFFSET] = {.type = NLA_U8}, }; /** @@ -5306,6 +5307,31 @@ hdd_set_roam_with_control_config(struct hdd_context *hdd_ctx, hdd_err("Fail to decide inclusion of 6 GHz channels"); } + attr = tb2[QCA_ATTR_ROAM_CONTROL_CONNECTED_HIGH_RSSI_OFFSET]; + if (attr) { + value = nla_get_u8(attr); + if (!cfg_in_range(CFG_LFR_ROAM_SCAN_HI_RSSI_DELTA, value)) { + hdd_err("High RSSI offset value %d is out of range", + value); + return -EINVAL; + } + + hdd_debug("%s roam scan high RSSI with offset: %d for vdev %d", + value ? "Enable" : "Disable", value, vdev_id); + + if (!value && + !wlan_cm_get_roam_scan_high_rssi_offset(hdd_ctx->psoc)) { + hdd_debug("Roam scan high RSSI is already disabled"); + return -EINVAL; + } + + status = ucfg_cm_set_roam_scan_high_rssi_offset(hdd_ctx->psoc, + vdev_id, value); + if (QDF_IS_STATUS_ERROR(status)) + hdd_err("Fail to set roam scan high RSSI offset for vdev %d", + vdev_id); + } + return qdf_status_to_os_return(status); } diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index e3565fbbd7ff..5d680fdb97ae 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -17882,6 +17882,29 @@ csr_cm_roam_scan_offload_rssi_thresh(struct mac_context *mac_ctx, else params->hi_rssi_scan_rssi_delta = roam_info->cfgParams.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. + */ + if (!WLAN_REG_IS_6GHZ_CHAN_FREQ(session->connectedProfile.op_freq)) { + uint8_t roam_high_rssi_delta; + + roam_high_rssi_delta = + wlan_cm_get_roam_scan_high_rssi_offset(mac_ctx->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(session->connectedProfile.op_freq)) + params->flags |= + ROAM_SCAN_RSSI_THRESHOLD_FLAG_ROAM_HI_RSSI_EN_ON_5G; + } + params->hi_rssi_scan_rssi_ub = roam_info->cfgParams.hi_rssi_scan_rssi_ub; params->raise_rssi_thresh_5g = @@ -18474,6 +18497,37 @@ csr_cm_fill_rso_sae_single_pmk_info(struct mac_context *mac_ctx, return false; } #endif + +QDF_STATUS wlan_cm_roam_scan_offload_rssi_thresh( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + struct wlan_roam_offload_scan_rssi_params *roam_rssi_params) +{ + struct csr_roam_session *session; + struct mac_context *mac_ctx; + + mac_ctx = sme_get_mac_context(); + if (!mac_ctx) { + sme_err("mac_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + + session = CSR_GET_SESSION(mac_ctx, vdev_id); + if (!session) { + sme_err("session is null %d", vdev_id); + return QDF_STATUS_E_FAILURE; + } + + if (WLAN_REG_IS_6GHZ_CHAN_FREQ(session->connectedProfile.op_freq)) { + sme_err("vdev:%d High RSSI offset can't be set in 6 GHz band", + vdev_id); + return QDF_STATUS_E_FAILURE; + } + + csr_cm_roam_scan_offload_rssi_thresh(mac_ctx, session, + roam_rssi_params); + + return QDF_STATUS_SUCCESS; +} #endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD From dc2a8a0860d67aa42c5970d4b6055c8ca37a02b9 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Fri, 29 Dec 2023 01:58:38 -0800 Subject: [PATCH 2/9] Release 2.0.8.34J Release 2.0.8.34J Change-Id: I18e4ae869a2e90be214ee3719e9288bb2ffe31c0 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5298ed90b3d1..261cad8f37ad 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34I" +#define QWLAN_VERSIONSTR "2.0.8.34J" #endif /* QWLAN_VERSION_H */ From 3ec26461cd4636e7d1b66f7bff5e264f61fc8239 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Tue, 9 Jan 2024 14:54:21 +0530 Subject: [PATCH 3/9] qcacld-3.0: Find best 6 GHz power type for connection Find the best 6 GHz power type for connection according to following regulatory policy: 1) SP power type is selected only if AP advertises SP and client supports SP. 2) LPI power type is selected only if AP advertises LPI and client supports LPI. 3) VLP power type is selected for the below cases, a) AP advertises VLP and client supports VLP b) AP advertises SP but client doesn't support SP but supports VLP. c) AP advertises LPI but client doesn't support LPI but supports VLP. Change-Id: I582fb582e1e11b731a1c6cda01f4fc366f166143 CRs-Fixed: 3456192 --- core/mac/inc/sir_api.h | 5 ++- core/mac/src/pe/include/lim_session.h | 5 +-- .../src/pe/lim/lim_process_mlm_rsp_messages.c | 6 ++-- .../src/pe/lim/lim_process_sme_req_messages.c | 20 +++-------- core/mac/src/pe/lim/lim_prop_exts_utils.c | 16 +++++---- core/mac/src/pe/lim/lim_utils.h | 8 ++--- core/mac/src/pe/rrm/rrm_api.c | 4 +-- core/mac/src/pe/sch/sch_beacon_process.c | 36 ++++++++++++------- core/sme/inc/csr_internal.h | 2 -- core/sme/src/csr/csr_api_roam.c | 16 +++------ 10 files changed, 54 insertions(+), 64 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index a595bb0f2cec..f13d7eda15bc 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022,2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1048,9 +1048,8 @@ struct join_req { struct supported_channels supportedChannels; bool enable_bcast_probe_rsp; bool sae_pmk_cached; - bool same_ctry_code; /* If AP Country IE has same country code as */ /* STA programmed country */ - uint8_t ap_power_type_6g; /* AP power type for 6G (LPI, SP, or VLP) */ + uint8_t best_6g_power_type; /* AP power type for 6G (LPI, SP, or VLP) */ /* Pls make this as last variable in struct */ bool force_24ghz_in_ht20; bool force_rsne_override; diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index e72f9888899d..5488a180a145 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -577,8 +578,8 @@ struct pe_session { uint16_t prot_status_code; tSirResultCodes result_code; uint32_t dfs_regdomain; - /* AP power type */ - uint8_t ap_power_type; + uint8_t ap_defined_power_type_6g; + uint8_t best_6g_power_type; }; /*------------------------------------------------------------------------- diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index a468c70e49b3..4e15cbdc1007 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2325,7 +2325,7 @@ void lim_handle_add_bss_rsp(struct mac_context *mac_ctx, } tx_ops = wlan_reg_get_tx_ops(mac_ctx->psoc); - lim_calculate_tpc(mac_ctx, session_entry, 0, false); + lim_calculate_tpc(mac_ctx, session_entry); if (tx_ops->set_tpc_power) tx_ops->set_tpc_power(mac_ctx->psoc, @@ -2810,7 +2810,7 @@ static void lim_process_switch_channel_join_req( goto error; } - lim_calculate_tpc(mac_ctx, session_entry, 0, false); + lim_calculate_tpc(mac_ctx, session_entry); if (tx_ops->set_tpc_power) tx_ops->set_tpc_power(mac_ctx->psoc, diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index e75bf160a7a2..dd4ea287d90b 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1617,6 +1617,8 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf) mlme_obj->reg_tpc_obj.is_power_constraint_abs = !is_pwr_constraint; + session->best_6g_power_type = sme_join_req->best_6g_power_type; + if (wlan_reg_is_ext_tpc_supported(mac_ctx->psoc)) { mlme_obj->reg_tpc_obj.ap_constraint_power = local_power_constraint; @@ -2019,9 +2021,7 @@ uint8_t lim_get_max_tx_power(struct mac_context *mac, } void lim_calculate_tpc(struct mac_context *mac, - struct pe_session *session, - uint8_t ap_pwr_type, - bool ctry_code_match) + struct pe_session *session) { bool is_psd_power = false; bool is_tpe_present = false, is_6ghz_freq = false; @@ -2061,18 +2061,8 @@ void lim_calculate_tpc(struct mac_context *mac, } else { is_6ghz_freq = true; is_psd_power = wlan_reg_is_6g_psd_power(mac->pdev); - /* Power mode calculation for 6G*/ - ap_power_type_6g = session->ap_power_type; - if (LIM_IS_STA_ROLE(session)) { - if (!session->lim_join_req) { - if (!ctry_code_match) - ap_power_type_6g = ap_pwr_type; - } else { - if (!session->lim_join_req->same_ctry_code) - ap_power_type_6g = - session->lim_join_req->ap_power_type_6g; - } - } + if (LIM_IS_STA_ROLE(session)) + ap_power_type_6g = session->best_6g_power_type; } if (mlme_obj->reg_tpc_obj.num_pwr_levels) { diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 008928feb372..5986e77821a9 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022,2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -121,6 +121,7 @@ static void lim_extract_he_op(struct pe_session *session, return; if (!session->he_op.oper_info_6g_present) { pe_debug("6GHz op not present in 6G beacon"); + session->ap_defined_power_type_6g = REG_VERY_LOW_POWER_AP; return; } session->ch_width = session->he_op.oper_info_6g.info.ch_width; @@ -128,11 +129,17 @@ static void lim_extract_he_op(struct pe_session *session, session->he_op.oper_info_6g.info.center_freq_seg0; session->ch_center_freq_seg1 = session->he_op.oper_info_6g.info.center_freq_seg1; - session->ap_power_type = + session->ap_defined_power_type_6g = session->he_op.oper_info_6g.info.reg_info; + if (session->ap_defined_power_type_6g < REG_INDOOR_AP || + session->ap_defined_power_type_6g > REG_MAX_SUPP_AP_TYPE) { + session->ap_defined_power_type_6g = REG_VERY_LOW_POWER_AP; + pe_debug("AP power type invalid, defaulting to VLP"); + } + pe_debug("6G op info: ch_wd %d cntr_freq_seg0 %d cntr_freq_seg1 %d ap pwr type %d", session->ch_width, session->ch_center_freq_seg0, - session->ch_center_freq_seg1, session->ap_power_type); + session->ch_center_freq_seg1, session->ap_defined_power_type_6g); if (!session->ch_center_freq_seg1) return; @@ -706,9 +713,6 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, } } - mac_ctx->roam.roamSession[session_id].ap_power_type = - session->ap_power_type; - get_ese_version_ie_probe_response(mac_ctx, beacon_struct, session); session->country_info_present = false; diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index a78655dbad4b..b181c7a5a5ad 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -188,8 +188,6 @@ uint8_t lim_get_max_tx_power(struct mac_context *mac, * lim_calculate_tpc() - Utility to get maximum tx power * @mac: mac handle * @session: PE Session Entry - * @ap_pwr_type: Ap power type for 6G - * @ctry_code_match: check for country IE and sta programmed ctry match * * This function is used to get the maximum possible tx power from the list * of tx powers mentioned in @attr. @@ -197,9 +195,7 @@ uint8_t lim_get_max_tx_power(struct mac_context *mac, * Return: None */ void lim_calculate_tpc(struct mac_context *mac, - struct pe_session *session, - uint8_t ap_pwr_type, - bool ctry_code_match); + struct pe_session *session); /* AID pool management functions */ void lim_init_peer_idxpool(struct mac_context *, struct pe_session *); diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c index 3e020cef811b..4e6a1fc2a1b2 100644 --- a/core/mac/src/pe/rrm/rrm_api.c +++ b/core/mac/src/pe/rrm/rrm_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -273,7 +273,7 @@ rrm_process_link_measurement_request(struct mac_context *mac, pLinkReq->MaxTxPower.maxTxPower; /* Set is_power_constraint_abs to true to calculate tpc power */ mlme_obj->reg_tpc_obj.is_power_constraint_abs = true; - lim_calculate_tpc(mac, pe_session, 0, false); + lim_calculate_tpc(mac, pe_session); LinkReport.txPower = mlme_obj->reg_tpc_obj.chan_power_info[0].tx_power; diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index eb536e160a3e..723ea4506180 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -609,9 +609,7 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, int8_t regMax = 0, maxTxPower = 0; QDF_STATUS status; bool skip_tpe = false; - uint8_t programmed_country[REG_ALPHA2_LEN + 1]; - enum reg_6g_ap_type pwr_type_6g = REG_INDOOR_AP; - bool ctry_code_match = false; + enum reg_6g_ap_type pwr_type_6g; bool is_power_constraint_abs = false; qdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); @@ -651,15 +649,28 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, pe_err("Channel is 6G but country IE not present"); return; } - wlan_reg_read_current_country(mac_ctx->psoc, - programmed_country); - status = wlan_reg_get_6g_power_type_for_ctry(mac_ctx->psoc, - mac_ctx->pdev, - bcn->countryInfoParam.countryString, - programmed_country, &pwr_type_6g, - &ctry_code_match, REG_MAX_AP_TYPE); + if (bcn->he_op.oper_info_6g_present) { + session->ap_defined_power_type_6g = + bcn->he_op.oper_info_6g.info.reg_info; + if (session->ap_defined_power_type_6g < REG_INDOOR_AP || + session->ap_defined_power_type_6g > + REG_MAX_SUPP_AP_TYPE) { + session->ap_defined_power_type_6g = + REG_VERY_LOW_POWER_AP; + pe_debug("AP power type is invalid, defaulting to VLP"); + } + } else { + pe_debug("AP power type is null, defaulting to VLP"); + session->ap_defined_power_type_6g = + REG_VERY_LOW_POWER_AP; + } + + status = wlan_reg_get_best_6g_power_type( + mac_ctx->psoc, mac_ctx->pdev, &pwr_type_6g, + session->ap_defined_power_type_6g); if (QDF_IS_STATUS_ERROR(status)) return; + session->best_6g_power_type = pwr_type_6g; } if (wlan_reg_is_ext_tpc_supported(mac_ctx->psoc)) { @@ -693,8 +704,7 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, if ((ap_constraint_change && local_constraint) || (tpe_change && !skip_tpe)) { - lim_calculate_tpc(mac_ctx, session, pwr_type_6g, - ctry_code_match); + lim_calculate_tpc(mac_ctx, session); if (tx_ops->set_tpc_power) tx_ops->set_tpc_power(mac_ctx->psoc, diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 89415d42b2bf..067e72b0ca66 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -619,8 +619,6 @@ struct csr_roam_session { qdf_mc_timer_t roam_invoke_timer; struct csr_timer_info roam_invoke_timer_info; #endif - /* AP power type */ - uint8_t ap_power_type; }; struct csr_roamstruct { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 5d680fdb97ae..12b3ad2ac236 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -15028,9 +15028,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, struct wlan_objmgr_vdev *vdev; bool follow_ap_edca; bool reconn_after_assoc_timeout = false; - uint8_t programmed_country[REG_ALPHA2_LEN + 1]; enum reg_6g_ap_type power_type_6g; - bool ctry_code_match; uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if (!pSession) { @@ -15839,18 +15837,12 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, if (wlan_reg_is_6ghz_chan_freq(pBssDescription->chan_freq)) { if (!pIes->Country.present) sme_debug("Channel is 6G but country IE not present"); - wlan_reg_read_current_country(mac->psoc, - programmed_country); - status = wlan_reg_get_6g_power_type_for_ctry(mac->psoc, - mac->pdev, - pIes->Country.country, - programmed_country, &power_type_6g, - &ctry_code_match, + status = wlan_reg_get_best_6g_power_type(mac->psoc, + mac->pdev, &power_type_6g, ap_6g_power_type); if (QDF_IS_STATUS_ERROR(status)) break; - csr_join_req->ap_power_type_6g = power_type_6g; - csr_join_req->same_ctry_code = ctry_code_match; + csr_join_req->best_6g_power_type = power_type_6g; status = csr_iterate_triplets(pIes->Country); } From b1e97d2edbf282e60602f3959fd553debf9651a4 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Tue, 9 Jan 2024 14:56:04 +0530 Subject: [PATCH 4/9] qcacld-3.0: Find 6 GHz power type for connection channel Currently host doesn't check if power type is supported for connection channel while calculating best 6 GHz power type for connection. This results in calculation of incorrect power for connection values if 6 GHz power type is not supported for that particular channel. To address this issue configure power type for connection only if that power type is supported for connection channel. Change-Id: I7e4ccdb962974cc8c415e8d174b2da0bf311f1a5 CRs-Fixed: 3697212 --- core/mac/src/pe/sch/sch_beacon_process.c | 3 ++- core/sme/src/csr/csr_api_roam.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 723ea4506180..3c0914e6c71a 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -667,7 +667,8 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, status = wlan_reg_get_best_6g_power_type( mac_ctx->psoc, mac_ctx->pdev, &pwr_type_6g, - session->ap_defined_power_type_6g); + session->ap_defined_power_type_6g, + bcn->chan_freq); if (QDF_IS_STATUS_ERROR(status)) return; session->best_6g_power_type = pwr_type_6g; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 12b3ad2ac236..02d4ab9c28d5 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15839,7 +15839,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, sme_debug("Channel is 6G but country IE not present"); status = wlan_reg_get_best_6g_power_type(mac->psoc, mac->pdev, &power_type_6g, - ap_6g_power_type); + ap_6g_power_type, pBssDescription->chan_freq); if (QDF_IS_STATUS_ERROR(status)) break; csr_join_req->best_6g_power_type = power_type_6g; From a3a8c7162ccfb6fb65201bcf2ecb6c75615b0d7c Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Fri, 19 Jan 2024 07:18:06 -0800 Subject: [PATCH 5/9] Release 2.0.8.34K Release 2.0.8.34K Change-Id: I8696dfd566f3f2f65f9bcd4eeb95ee09ac180d49 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 261cad8f37ad..2de4178d4774 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34J" +#define QWLAN_VERSIONSTR "2.0.8.34K" #endif /* QWLAN_VERSION_H */ From 525d10c802d55dc10b60a8677cb08dea7769fc01 Mon Sep 17 00:00:00 2001 From: Dundi Raviteja Date: Fri, 29 Dec 2023 15:21:27 +0530 Subject: [PATCH 6/9] qcacld-3.0: Fix possible spinlock acquire after destroy qdf_conc_list_lock from policy manager is destroyed as part of idle shutdown, later when FW down indication comes it is trying to acquire as part of ucfg_dp_bus_bw_compute_timer_stop. So call ucfg_dp_bus_bw_compute_timer_stop function in hdd_soc_recovery_cleanup after checking driver status. Change-Id: I27164a4b11467aee6c925225fe33d4fdbe0b4082 CRs-Fixed: 3689606 --- core/hdd/src/wlan_hdd_driver_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 3fac407753c1..b4b8c4bf0d33 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2015-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -959,7 +959,6 @@ static void hdd_soc_recovery_cleanup(void) /* cancel/flush any pending/active idle shutdown work */ hdd_psoc_idle_timer_stop(hdd_ctx); - hdd_bus_bw_compute_timer_stop(hdd_ctx); /* nothing to do if the soc is already unloaded */ if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) { @@ -972,6 +971,7 @@ static void hdd_soc_recovery_cleanup(void) return; } + hdd_bus_bw_compute_timer_stop(hdd_ctx); hdd_psoc_shutdown_notify(hdd_ctx); } From e09fe8870678d786193514adb1ccafafe08d1216 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Wed, 24 Jan 2024 02:45:38 -0800 Subject: [PATCH 7/9] Release 2.0.8.34L Release 2.0.8.34L Change-Id: If29a8120271d32dd6d935344238b20dbd65bec6b CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 2de4178d4774..55b471acad6c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34K" +#define QWLAN_VERSIONSTR "2.0.8.34L" #endif /* QWLAN_VERSION_H */ From 8d2b166b5544c556446029e5559f2751bce84f7f Mon Sep 17 00:00:00 2001 From: Aditya Kodukula Date: Mon, 24 Jul 2023 20:30:21 -0700 Subject: [PATCH 8/9] qcacld-3.0: Add a sanity check to prevent integer overflow Currently in the function hdd_send_roam_scan_channel_freq_list_to_sme, the num_chan variable is declared as uint8_t and is incremented for each nested attribute PARAM_SCAN_FREQ_LIST. If the number of attributes sent by userspace is more than max value of uint8_t, then an integer overflow occurs. To avoid this issue, add a sanity check to see if num_chan has reached SIR_MAX_SUPPORTED_CHANNEL_LIST before incrementing variable. Change-Id: I601a73a118eb65ebb8575f6ed5ed1f29d915f59e CRs-Fixed: 3568577 --- core/hdd/src/wlan_hdd_cfg80211.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 15a16ec28070..001524cb863b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -4603,12 +4603,13 @@ hdd_send_roam_scan_channel_freq_list_to_sme(struct hdd_context *hdd_ctx, return QDF_STATUS_E_INVAL; } - nla_for_each_nested(curr_attr, tb2[PARAM_SCAN_FREQ_LIST], rem) + nla_for_each_nested(curr_attr, tb2[PARAM_SCAN_FREQ_LIST], rem) { + if (num_chan >= SIR_MAX_SUPPORTED_CHANNEL_LIST) { + hdd_err("number of channels (%d) supported exceeded max (%d)", + num_chan, SIR_MAX_SUPPORTED_CHANNEL_LIST); + return QDF_STATUS_E_INVAL; + } num_chan++; - if (num_chan > SIR_MAX_SUPPORTED_CHANNEL_LIST) { - hdd_err("number of channels (%d) supported exceeded max (%d)", - num_chan, SIR_MAX_SUPPORTED_CHANNEL_LIST); - return QDF_STATUS_E_INVAL; } num_chan = 0; From d32175f446bbdacc6a4449658f43f33893cf9eff Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Tue, 6 Feb 2024 13:27:27 -0800 Subject: [PATCH 9/9] Release 2.0.8.34M Release 2.0.8.34M Change-Id: I389ed6c66c6ac93aa73ca8d5da82b9da5ad0379a CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 55b471acad6c..026733e24a06 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34L" +#define QWLAN_VERSIONSTR "2.0.8.34M" #endif /* QWLAN_VERSION_H */