From fee16fbe5aefb95329daedf6067ea76f27f6684d Mon Sep 17 00:00:00 2001 From: Sheenam Monga Date: Thu, 3 Nov 2022 19:51:14 +0530 Subject: [PATCH] qcacmn: Handle SRG and NON-SRG pd threshold Currently, only single pd_threshold is fetched and treated as SRG and NON-SRG pd threshold instead of handling both threshold separately. Fix is to get SRG and NON-SRG pd threshold from userspace instead of single pd threshold. Change-Id: I414843dfd08068c81531d0e96d71fb68d8bfccd1 CRs-Fixed: 3328201 --- .../src/target_if_spatial_reuse.c | 10 +++-- .../lmac_if/inc/wlan_lmac_if_def.h | 3 +- .../dispatcher/inc/wlan_vdev_mlme_api.h | 10 +++-- .../dispatcher/src/wlan_vdev_mlme_api.c | 39 ++++++++++--------- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/target_if/spatial_reuse/src/target_if_spatial_reuse.c b/target_if/spatial_reuse/src/target_if_spatial_reuse.c index c306a416d1..d85424c436 100644 --- a/target_if/spatial_reuse/src/target_if_spatial_reuse.c +++ b/target_if/spatial_reuse/src/target_if_spatial_reuse.c @@ -174,18 +174,19 @@ spatial_reuse_send_pd_threshold(struct wlan_objmgr_pdev *pdev, /** * spatial_reuse_set_sr_enable_disable: To send wmi command to enable/disable SR - * * @vdev: object manager vdev * @pdev: object manager pdev * @is_sr_enable: sr enable/disable - * @pd_threshold: pd threshold + * @srg_pd_threshold: SRG pd threshold + * @non_srg_pd_threshold: NON-SRG pd threshold * * Return: Success/Failure */ static QDF_STATUS spatial_reuse_set_sr_enable_disable(struct wlan_objmgr_vdev *vdev, struct wlan_objmgr_pdev *pdev, - bool is_sr_enable, int32_t pd_threshold) + bool is_sr_enable, int32_t srg_pd_threshold, + int32_t non_srg_pd_threshold) { uint32_t val = 0; uint8_t sr_ctrl; @@ -201,7 +202,8 @@ spatial_reuse_set_sr_enable_disable(struct wlan_objmgr_vdev *vdev, (sr_ctrl & NON_SRG_OFFSET_PRESENT)) || (sr_ctrl & SRG_INFO_PRESENT)) { if (is_sr_enable) { - wlan_mlme_update_sr_data(vdev, &val, pd_threshold, + wlan_mlme_update_sr_data(vdev, &val, srg_pd_threshold, + non_srg_pd_threshold, is_sr_enable); wlan_vdev_obj_lock(vdev); wlan_vdev_mlme_set_he_spr_enabled(vdev, true); diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index ce19a771d1..9c091f7937 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -1490,7 +1490,8 @@ struct wlan_lmac_if_spatial_reuse_tx_ops { QDF_STATUS(*target_if_set_sr_enable_disable)( struct wlan_objmgr_vdev *vdev, struct wlan_objmgr_pdev *pdev, - bool is_sr_enable, int32_t pd_threshold); + bool is_sr_enable, int32_t srg_pd_threshold, + int32_t non_srg_pd_threshold); }; #endif diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mlme_api.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mlme_api.h index 4027330224..2b4a2fccf6 100644 --- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mlme_api.h +++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mlme_api.h @@ -318,10 +318,10 @@ wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc, #ifdef WLAN_FEATURE_SR /** * wlan_mlme_update_sr_data() - Updates SR values - * * @vdev: Object manager VDEV object * @val: SR value - * @pd_threshold: pd threshold sent by userspace + * @srg_pd_threshold: SRG PD threshold sent by userspace + * @non_srg_pd_threshold: NON SRG PD threshold sent by userspace * @is_sr_enable: SR enable/disable from userspace * * API to Update SR value based on AP advertisement and provided by userspace @@ -330,11 +330,13 @@ wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc, */ void wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val, - int32_t pd_threshold, bool is_sr_enable); + int32_t srg_pd_threshold, int32_t non_srg_pd_threshold, + bool is_sr_enable); #else static inline void wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val, - int32_t pd_threshold, bool is_sr_enable) + int32_t srg_pd_threshold, int32_t non_srg_pd_threshold, + bool is_sr_enable) {} #endif #endif diff --git a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c index 5570984c7a..e6cd3e83e3 100644 --- a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c +++ b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c @@ -400,47 +400,50 @@ wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc, #ifdef WLAN_FEATURE_SR void wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val, - int32_t pd_threshold, bool is_sr_enable) + int32_t srg_pd_threshold, int32_t non_srg_pd_threshold, + bool is_sr_enable) { - uint8_t non_srg_pd_threshold = 0, srg_pd_threshold = 0; - uint8_t srg_min_pd_threshold_offset, srg_max_pd_threshold_offset; + uint8_t ap_non_srg_pd_threshold = 0; + uint8_t ap_srg_min_pd_threshold_offset, ap_srg_max_pd_threshold_offset; uint8_t sr_ctrl; sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev); if (!(sr_ctrl & NON_SRG_PD_SR_DISALLOWED) && (sr_ctrl & NON_SRG_OFFSET_PRESENT)) { - non_srg_pd_threshold = + ap_non_srg_pd_threshold = wlan_vdev_mlme_get_pd_offset(vdev) + NON_SR_PD_THRESHOLD_MIN; /** * Update non_srg_pd_threshold with provide - * pd_threshold, if pd threshold is with in the - * range else keep the same as advertised by AP. + * non_srg_pd_threshold for non-srg, if pd threshold is + * with in the range else keep the same as + * advertised by AP. */ - if (pd_threshold && non_srg_pd_threshold > pd_threshold) - non_srg_pd_threshold = pd_threshold; + if (non_srg_pd_threshold && + non_srg_pd_threshold > ap_non_srg_pd_threshold) + non_srg_pd_threshold = ap_non_srg_pd_threshold; /* 31st BIT - Enable/Disable Non-SRG based spatial reuse. */ *val |= is_sr_enable << NON_SRG_SPR_ENABLE_POS; } if (sr_ctrl & SRG_INFO_PRESENT) { - wlan_vdev_mlme_get_srg_pd_offset(vdev, - &srg_max_pd_threshold_offset, - &srg_min_pd_threshold_offset); + wlan_vdev_mlme_get_srg_pd_offset( + vdev, &ap_srg_max_pd_threshold_offset, + &ap_srg_min_pd_threshold_offset); /** - * Update rg_pd_threshold with provide - * pd_threshold, if pd threshold is with in the + * Update srg_pd_threshold with provide + * srg_pd_threshold, if pd threshold is with in the * SRG range else keep the max of advertised by AP. */ - if (pd_threshold && - pd_threshold < (srg_max_pd_threshold_offset + + if (srg_pd_threshold && + srg_pd_threshold < (ap_srg_max_pd_threshold_offset + NON_SR_PD_THRESHOLD_MIN) && - pd_threshold > (srg_min_pd_threshold_offset + + srg_pd_threshold > (ap_srg_min_pd_threshold_offset + NON_SR_PD_THRESHOLD_MIN)) - srg_pd_threshold = pd_threshold + + srg_pd_threshold = srg_pd_threshold + NON_SR_PD_THRESHOLD_MIN; else - srg_pd_threshold = srg_max_pd_threshold_offset + + srg_pd_threshold = ap_srg_max_pd_threshold_offset + NON_SR_PD_THRESHOLD_MIN; /* 30th BIT - Enable/Disable SRG based spatial reuse. */