qcacmn: Limit non-SRG PD threshold upto MAX allowed limit

Limit non-SRG PD threshold for upto minimum of MAX allowed limit
and AP advertised value and check AP nonSRG PD threshold
with correct signedness.
Change for debug print to display param value in hex.

Change-Id: I630aa894c856226a886161ced648073782f379bc
CRs-Fixed: 3598056
This commit is contained in:
Shailendra Singh
2023-09-08 17:50:18 +05:30
committed by Rahul Choudhary
parent ff56ef27f4
commit e5f0c4c549
2 changed files with 4 additions and 2 deletions

View File

@@ -209,7 +209,7 @@ spatial_reuse_set_sr_enable_disable(struct wlan_objmgr_vdev *vdev,
wlan_vdev_obj_unlock(vdev); wlan_vdev_obj_unlock(vdev);
} }
mlme_debug("srp param val: %u, enable: %d", mlme_debug("srp param val: %x, enable: %d",
val, is_sr_enable); val, is_sr_enable);
if (is_sr_enable) { if (is_sr_enable) {
status = spatial_reuse_send_bss_color_bit_map(vdev, pdev); status = spatial_reuse_send_bss_color_bit_map(vdev, pdev);

View File

@@ -410,7 +410,7 @@ wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val,
int32_t srg_pd_threshold, int32_t non_srg_pd_threshold, int32_t srg_pd_threshold, int32_t non_srg_pd_threshold,
bool is_sr_enable) bool is_sr_enable)
{ {
uint8_t ap_non_srg_pd_threshold = 0; int8_t ap_non_srg_pd_threshold = 0;
uint8_t ap_srg_min_pd_threshold_offset = 0; uint8_t ap_srg_min_pd_threshold_offset = 0;
uint8_t ap_srg_max_pd_threshold_offset = 0; uint8_t ap_srg_max_pd_threshold_offset = 0;
uint8_t sr_ctrl; uint8_t sr_ctrl;
@@ -439,6 +439,8 @@ wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val,
non_srg_pd_threshold = ap_non_srg_pd_threshold; non_srg_pd_threshold = ap_non_srg_pd_threshold;
else if (non_srg_pd_threshold < SR_PD_THRESHOLD_MIN) else if (non_srg_pd_threshold < SR_PD_THRESHOLD_MIN)
non_srg_pd_threshold = SR_PD_THRESHOLD_MIN; non_srg_pd_threshold = SR_PD_THRESHOLD_MIN;
if (non_srg_pd_threshold > SR_PD_THRESHOLD_MAX)
non_srg_pd_threshold = SR_PD_THRESHOLD_MAX;
/* 31st BIT - Enable/Disable Non-SRG based spatial reuse. */ /* 31st BIT - Enable/Disable Non-SRG based spatial reuse. */
*val |= is_sr_enable << NON_SRG_SPR_ENABLE_POS; *val |= is_sr_enable << NON_SRG_SPR_ENABLE_POS;