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
This commit is contained in:
Sheenam Monga
2022-11-03 19:51:14 +05:30
کامیت شده توسط Madan Koyyalamudi
والد 58ee0d8e0b
کامیت fee16fbe5a
4فایلهای تغییر یافته به همراه35 افزوده شده و 27 حذف شده

مشاهده پرونده

@@ -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 * spatial_reuse_set_sr_enable_disable: To send wmi command to enable/disable SR
*
* @vdev: object manager vdev * @vdev: object manager vdev
* @pdev: object manager pdev * @pdev: object manager pdev
* @is_sr_enable: sr enable/disable * @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 * Return: Success/Failure
*/ */
static QDF_STATUS static QDF_STATUS
spatial_reuse_set_sr_enable_disable(struct wlan_objmgr_vdev *vdev, spatial_reuse_set_sr_enable_disable(struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_pdev *pdev, 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; uint32_t val = 0;
uint8_t sr_ctrl; 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 & NON_SRG_OFFSET_PRESENT)) ||
(sr_ctrl & SRG_INFO_PRESENT)) { (sr_ctrl & SRG_INFO_PRESENT)) {
if (is_sr_enable) { 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); is_sr_enable);
wlan_vdev_obj_lock(vdev); wlan_vdev_obj_lock(vdev);
wlan_vdev_mlme_set_he_spr_enabled(vdev, true); wlan_vdev_mlme_set_he_spr_enabled(vdev, true);

مشاهده پرونده

@@ -1490,7 +1490,8 @@ struct wlan_lmac_if_spatial_reuse_tx_ops {
QDF_STATUS(*target_if_set_sr_enable_disable)( QDF_STATUS(*target_if_set_sr_enable_disable)(
struct wlan_objmgr_vdev *vdev, struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_pdev *pdev, 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 #endif

مشاهده پرونده

@@ -318,10 +318,10 @@ wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc,
#ifdef WLAN_FEATURE_SR #ifdef WLAN_FEATURE_SR
/** /**
* wlan_mlme_update_sr_data() - Updates SR values * wlan_mlme_update_sr_data() - Updates SR values
*
* @vdev: Object manager VDEV object * @vdev: Object manager VDEV object
* @val: SR value * @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 * @is_sr_enable: SR enable/disable from userspace
* *
* API to Update SR value based on AP advertisement and provided by 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 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 srg_pd_threshold, int32_t non_srg_pd_threshold,
bool is_sr_enable);
#else #else
static inline void static inline 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 srg_pd_threshold, int32_t non_srg_pd_threshold,
bool is_sr_enable)
{} {}
#endif #endif
#endif #endif

مشاهده پرونده

@@ -400,47 +400,50 @@ wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc,
#ifdef WLAN_FEATURE_SR #ifdef WLAN_FEATURE_SR
void 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 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 ap_non_srg_pd_threshold = 0;
uint8_t srg_min_pd_threshold_offset, srg_max_pd_threshold_offset; uint8_t ap_srg_min_pd_threshold_offset, ap_srg_max_pd_threshold_offset;
uint8_t sr_ctrl; uint8_t sr_ctrl;
sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev); sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev);
if (!(sr_ctrl & NON_SRG_PD_SR_DISALLOWED) && if (!(sr_ctrl & NON_SRG_PD_SR_DISALLOWED) &&
(sr_ctrl & NON_SRG_OFFSET_PRESENT)) { (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; wlan_vdev_mlme_get_pd_offset(vdev) + NON_SR_PD_THRESHOLD_MIN;
/** /**
* Update non_srg_pd_threshold with provide * Update non_srg_pd_threshold with provide
* pd_threshold, if pd threshold is with in the * non_srg_pd_threshold for non-srg, if pd threshold is
* range else keep the same as advertised by AP. * with in the range else keep the same as
* advertised by AP.
*/ */
if (pd_threshold && non_srg_pd_threshold > pd_threshold) if (non_srg_pd_threshold &&
non_srg_pd_threshold = 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. */ /* 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;
} }
if (sr_ctrl & SRG_INFO_PRESENT) { if (sr_ctrl & SRG_INFO_PRESENT) {
wlan_vdev_mlme_get_srg_pd_offset(vdev, wlan_vdev_mlme_get_srg_pd_offset(
&srg_max_pd_threshold_offset, vdev, &ap_srg_max_pd_threshold_offset,
&srg_min_pd_threshold_offset); &ap_srg_min_pd_threshold_offset);
/** /**
* Update rg_pd_threshold with provide * Update srg_pd_threshold with provide
* pd_threshold, if pd threshold is with in the * srg_pd_threshold, if pd threshold is with in the
* SRG range else keep the max of advertised by AP. * SRG range else keep the max of advertised by AP.
*/ */
if (pd_threshold && if (srg_pd_threshold &&
pd_threshold < (srg_max_pd_threshold_offset + srg_pd_threshold < (ap_srg_max_pd_threshold_offset +
NON_SR_PD_THRESHOLD_MIN) && 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)) NON_SR_PD_THRESHOLD_MIN))
srg_pd_threshold = pd_threshold + srg_pd_threshold = srg_pd_threshold +
NON_SR_PD_THRESHOLD_MIN; NON_SR_PD_THRESHOLD_MIN;
else else
srg_pd_threshold = srg_max_pd_threshold_offset + srg_pd_threshold = ap_srg_max_pd_threshold_offset +
NON_SR_PD_THRESHOLD_MIN; NON_SR_PD_THRESHOLD_MIN;
/* 30th BIT - Enable/Disable SRG based spatial reuse. */ /* 30th BIT - Enable/Disable SRG based spatial reuse. */