|
@@ -404,47 +404,61 @@ void
|
|
wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val,
|
|
wlan_mlme_update_sr_data(struct wlan_objmgr_vdev *vdev, int *val,
|
|
int32_t pd_threshold, bool is_sr_enable)
|
|
int32_t pd_threshold, bool is_sr_enable)
|
|
{
|
|
{
|
|
- uint8_t non_srg_pd_threshold;
|
|
|
|
- /*To do initialization removal*/
|
|
|
|
- uint8_t srg_pd_threshold = 0;
|
|
|
|
-
|
|
|
|
- non_srg_pd_threshold =
|
|
|
|
|
|
+ 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 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 =
|
|
wlan_vdev_mlme_get_pd_offset(vdev) + NON_SR_PD_THRESHOLD_MIN;
|
|
wlan_vdev_mlme_get_pd_offset(vdev) + NON_SR_PD_THRESHOLD_MIN;
|
|
- /*
|
|
|
|
- * To do
|
|
|
|
- * set srg_pd_min and max offset in lim_update_vdev_sr_elements
|
|
|
|
- * srp_ie->srg_info.info.srg_pd_min_offset.
|
|
|
|
- * Get here and chcek provided threshold is in range or not
|
|
|
|
- */
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 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.
|
|
|
|
+ */
|
|
|
|
+ if (pd_threshold && non_srg_pd_threshold > pd_threshold)
|
|
|
|
+ non_srg_pd_threshold = 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);
|
|
|
|
+ /**
|
|
|
|
+ * Update rg_pd_threshold with provide
|
|
|
|
+ * 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 +
|
|
|
|
+ NON_SR_PD_THRESHOLD_MIN) &&
|
|
|
|
+ pd_threshold > (srg_min_pd_threshold_offset +
|
|
|
|
+ NON_SR_PD_THRESHOLD_MIN))
|
|
|
|
+ srg_pd_threshold = pd_threshold +
|
|
|
|
+ NON_SR_PD_THRESHOLD_MIN;
|
|
|
|
+ else
|
|
|
|
+ srg_pd_threshold = srg_max_pd_threshold_offset +
|
|
|
|
+ NON_SR_PD_THRESHOLD_MIN;
|
|
|
|
+
|
|
|
|
+ /* 30th BIT - Enable/Disable SRG based spatial reuse. */
|
|
|
|
+ *val |= is_sr_enable << SRG_SPR_ENABLE_POS;
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 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.
|
|
|
|
- */
|
|
|
|
- if (pd_threshold && non_srg_pd_threshold > pd_threshold)
|
|
|
|
- non_srg_pd_threshold = pd_threshold;
|
|
|
|
/* bit | purpose
|
|
/* bit | purpose
|
|
* -----------------
|
|
* -----------------
|
|
* 0 - 7 | Param Value for non-SRG based Spatial Reuse
|
|
* 0 - 7 | Param Value for non-SRG based Spatial Reuse
|
|
* 8 - 15| Param value for SRG based Spatial Reuse
|
|
* 8 - 15| Param value for SRG based Spatial Reuse
|
|
- * 16 - 28| Reserved
|
|
|
|
- * 29 | Param value is in dBm units rather than dB units
|
|
|
|
- * 30 | Enable/Disable SRG based spatial reuse.
|
|
|
|
- * | If set to 0, ignore bits 8-15.
|
|
|
|
- * 16 - 28| Reserved
|
|
|
|
* 29 | Param value is in dBm units rather than dB units
|
|
* 29 | Param value is in dBm units rather than dB units
|
|
- * 30 | Enable/Disable SRG based spatial reuse.
|
|
|
|
- * | If set to 0, ignore bits 8-15.
|
|
|
|
- * 31 | Enable/Disable Non-SRG based spatial reuse.
|
|
|
|
- * | If set to 0, ignore bits 0-7.
|
|
|
|
*/
|
|
*/
|
|
*val |=
|
|
*val |=
|
|
(uint8_t)(non_srg_pd_threshold << NON_SRG_MAX_PD_OFFSET_POS);
|
|
(uint8_t)(non_srg_pd_threshold << NON_SRG_MAX_PD_OFFSET_POS);
|
|
*val |=
|
|
*val |=
|
|
(uint8_t)(srg_pd_threshold << SRG_THRESHOLD_MAX_PD_POS);
|
|
(uint8_t)(srg_pd_threshold << SRG_THRESHOLD_MAX_PD_POS);
|
|
*val |= SR_PARAM_VAL_DBM_UNIT << SR_PARAM_VAL_DBM_POS;
|
|
*val |= SR_PARAM_VAL_DBM_UNIT << SR_PARAM_VAL_DBM_POS;
|
|
- *val |= is_sr_enable << NON_SRG_SPR_ENABLE_POS;
|
|
|
|
- *val |= is_sr_enable << SRG_SPR_ENABLE_POS;
|
|
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|