浏览代码

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
Shailendra Singh 1 年之前
父节点
当前提交
e5f0c4c549

+ 1 - 1
target_if/spatial_reuse/src/target_if_spatial_reuse.c

@@ -209,7 +209,7 @@ spatial_reuse_set_sr_enable_disable(struct wlan_objmgr_vdev *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);
 	if (is_sr_enable) {
 		status = spatial_reuse_send_bss_color_bit_map(vdev, pdev);

+ 3 - 1
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c

@@ -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,
 			 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_max_pd_threshold_offset = 0;
 	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;
 		else if (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. */
 		*val |= is_sr_enable << NON_SRG_SPR_ENABLE_POS;