qcacld-3.0: Configure STA with default non-SRG SR parameters

Currently, STA cannot perform SR when SAP does not include SR
IE in Beacon/Probe response/Assoc response.

This change is done to configure default non-SRG OBSS PD
parameters in FW in this case.

Change-Id: Ic37e5f011cb7e07ebbe4acef56b8c36c4e08c285
CRs-Fixed: 3551808
This commit is contained in:
Gangadhar Kavalastramath
2023-09-07 17:44:20 +05:30
committed by Rahul Choudhary
parent b548b3b901
commit e9e8c4d57c
3 changed files with 38 additions and 71 deletions

View File

@@ -256,8 +256,7 @@ int mlme_sr_is_enable(struct wlan_objmgr_vdev *vdev)
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);
return ((!(sr_ctrl & NON_SRG_PD_SR_DISALLOWED) && return (!sr_ctrl || !(sr_ctrl & NON_SRG_PD_SR_DISALLOWED) ||
(sr_ctrl & NON_SRG_OFFSET_PRESENT)) ||
(sr_ctrl & SRG_INFO_PRESENT)); (sr_ctrl & SRG_INFO_PRESENT));
} }
@@ -296,11 +295,6 @@ mlme_sr_handle_conc(struct wlan_objmgr_vdev *vdev,
} }
sr_tx_ops = &tx_ops->spatial_reuse_tx_ops; sr_tx_ops = &tx_ops->spatial_reuse_tx_ops;
if (!sr_tx_ops) {
mlme_err("sr_tx_ops is NULL");
return;
}
if (en_sr_curr_vdev) { if (en_sr_curr_vdev) {
wlan_vdev_mlme_set_sr_disable_due_conc(vdev, true); wlan_vdev_mlme_set_sr_disable_due_conc(vdev, true);
wlan_vdev_mlme_set_sr_disable_due_conc(conc_vdev, true); wlan_vdev_mlme_set_sr_disable_due_conc(conc_vdev, true);
@@ -402,6 +396,7 @@ void mlme_sr_update(struct wlan_objmgr_vdev *vdev, bool enable)
wlan_mlme_update_sr_data(vdev, &val, 0, 0, true); wlan_mlme_update_sr_data(vdev, &val, 0, 0, true);
} else { } else {
/* VDEV down, disable SR */ /* VDEV down, disable SR */
wlan_vdev_mlme_set_he_spr_enabled(vdev, false);
wlan_vdev_mlme_set_sr_ctrl(vdev, 0); wlan_vdev_mlme_set_sr_ctrl(vdev, 0);
wlan_vdev_mlme_set_non_srg_pd_offset(vdev, 0); wlan_vdev_mlme_set_non_srg_pd_offset(vdev, 0);
} }

View File

@@ -663,7 +663,7 @@ static bool hdd_check_mode_support_for_sr(struct hdd_adapter *adapter,
uint8_t sr_ctrl) uint8_t sr_ctrl)
{ {
if ((adapter->device_mode == QDF_STA_MODE) && if ((adapter->device_mode == QDF_STA_MODE) &&
(!hdd_cm_is_vdev_connected(adapter->deflink) || !sr_ctrl || (!hdd_cm_is_vdev_connected(adapter->deflink) ||
((sr_ctrl & NON_SRG_PD_SR_DISALLOWED) && ((sr_ctrl & NON_SRG_PD_SR_DISALLOWED) &&
!(sr_ctrl & SRG_INFO_PRESENT)))) { !(sr_ctrl & SRG_INFO_PRESENT)))) {
hdd_err("mode %d doesn't supports SR", adapter->device_mode); hdd_err("mode %d doesn't supports SR", adapter->device_mode);
@@ -707,7 +707,6 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
struct sk_buff *skb; struct sk_buff *skb;
struct cdp_pdev_obss_pd_stats_tlv stats; struct cdp_pdev_obss_pd_stats_tlv stats;
uint8_t sr_device_modes; uint8_t sr_device_modes;
bool is_pd_threshold_present = false;
hdd_enter_dev(wdev->netdev); hdd_enter_dev(wdev->netdev);
@@ -727,7 +726,6 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
hdd_err("Null VDEV"); hdd_err("Null VDEV");
return -EINVAL; return -EINVAL;
} }
sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev);
/** /**
* Reject command if SR concurrency is not allowed and * Reject command if SR concurrency is not allowed and
* only STA mode is set in ini to enable SR. * only STA mode is set in ini to enable SR.
@@ -776,6 +774,15 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
ucfg_spatial_reuse_get_sr_config(vdev, &sr_ctrl, &non_srg_max_pd_offset, ucfg_spatial_reuse_get_sr_config(vdev, &sr_ctrl, &non_srg_max_pd_offset,
&is_sr_enable); &is_sr_enable);
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl) &&
(sr_oper != QCA_WLAN_SR_OPERATION_GET_PARAMS)) {
hdd_err("SR operation not allowed, sr_ctrl = %x, mode = %d",
sr_ctrl, adapter->device_mode);
ret = -EINVAL;
goto exit;
}
if (sr_oper != QCA_WLAN_SR_OPERATION_SR_ENABLE && !is_sr_enable) { if (sr_oper != QCA_WLAN_SR_OPERATION_SR_ENABLE && !is_sr_enable) {
hdd_err("SR operation not allowed"); hdd_err("SR operation not allowed");
ret = -EINVAL; ret = -EINVAL;
@@ -818,9 +825,7 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
srg_pd_threshold = srg_pd_threshold =
nla_get_s32( nla_get_s32(
tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_SRG_PD_THRESHOLD]); tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_SRG_PD_THRESHOLD]);
is_pd_threshold_present = true; wlan_vdev_mlme_set_pd_threshold_present(vdev, true);
wlan_vdev_mlme_set_pd_threshold_present(
vdev, is_pd_threshold_present);
} }
if (is_sr_enable && if (is_sr_enable &&
@@ -829,37 +834,25 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
nla_get_s32( nla_get_s32(
tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_NON_SRG_PD_THRESHOLD] tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_NON_SRG_PD_THRESHOLD]
); );
is_pd_threshold_present = true; wlan_vdev_mlme_set_pd_threshold_present(vdev, true);
wlan_vdev_mlme_set_pd_threshold_present(
vdev, is_pd_threshold_present);
}
if (is_pd_threshold_present) {
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl)) {
ret = -EINVAL;
goto exit;
}
} }
hdd_debug("setting sr enable %d with pd threshold srg: %d non srg: %d", hdd_debug("setting sr enable %d with pd threshold srg: %d non srg: %d",
is_sr_enable, srg_pd_threshold, non_srg_pd_threshold); is_sr_enable, srg_pd_threshold, non_srg_pd_threshold);
/* Set the variables */ /* Set the variables */
ucfg_spatial_reuse_set_sr_enable(vdev, is_sr_enable); ucfg_spatial_reuse_set_sr_enable(vdev, is_sr_enable);
if (hdd_check_mode_support_for_sr(adapter, sr_ctrl)) { status = ucfg_spatial_reuse_setup_req(vdev, hdd_ctx->pdev,
status = ucfg_spatial_reuse_setup_req( is_sr_enable,
vdev, hdd_ctx->pdev, is_sr_enable, srg_pd_threshold,
srg_pd_threshold, non_srg_pd_threshold); non_srg_pd_threshold);
if (status != QDF_STATUS_SUCCESS) { if (status != QDF_STATUS_SUCCESS) {
hdd_err("failed to enable Spatial Reuse feature"); hdd_err("failed to enable Spatial Reuse feature");
ret = -EINVAL; ret = -EINVAL;
goto exit; goto exit;
}
} }
break; break;
case QCA_WLAN_SR_OPERATION_GET_STATS: case QCA_WLAN_SR_OPERATION_GET_STATS:
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl)) {
ret = -EINVAL;
goto exit;
}
status = policy_mgr_get_mac_id_by_session_id( status = policy_mgr_get_mac_id_by_session_id(
hdd_ctx->psoc, hdd_ctx->psoc,
adapter->deflink->vdev_id, adapter->deflink->vdev_id,
@@ -892,10 +885,6 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
ret = wlan_cfg80211_vendor_cmd_reply(skb); ret = wlan_cfg80211_vendor_cmd_reply(skb);
break; break;
case QCA_WLAN_SR_OPERATION_CLEAR_STATS: case QCA_WLAN_SR_OPERATION_CLEAR_STATS:
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl)) {
ret = -EINVAL;
goto exit;
}
status = policy_mgr_get_mac_id_by_session_id( status = policy_mgr_get_mac_id_by_session_id(
hdd_ctx->psoc, hdd_ctx->psoc,
adapter->deflink->vdev_id, adapter->deflink->vdev_id,
@@ -912,10 +901,6 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
} }
break; break;
case QCA_WLAN_SR_OPERATION_PSR_AND_NON_SRG_OBSS_PD_PROHIBIT: case QCA_WLAN_SR_OPERATION_PSR_AND_NON_SRG_OBSS_PD_PROHIBIT:
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl)) {
ret = -EINVAL;
goto exit;
}
if (tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_HESIGA_VAL15_ENABLE]) if (tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_HESIGA_VAL15_ENABLE])
sr_he_siga_val15_allowed = nla_get_u8( sr_he_siga_val15_allowed = nla_get_u8(
tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_HESIGA_VAL15_ENABLE] tb2[QCA_WLAN_VENDOR_ATTR_SR_PARAMS_HESIGA_VAL15_ENABLE]
@@ -933,10 +918,6 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
} }
break; break;
case QCA_WLAN_SR_OPERATION_PSR_AND_NON_SRG_OBSS_PD_ALLOW: case QCA_WLAN_SR_OPERATION_PSR_AND_NON_SRG_OBSS_PD_ALLOW:
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl)) {
ret = -EINVAL;
goto exit;
}
if (!QDF_IS_STATUS_SUCCESS(ucfg_spatial_reuse_send_sr_prohibit( if (!QDF_IS_STATUS_SUCCESS(ucfg_spatial_reuse_send_sr_prohibit(
vdev, false))) { vdev, false))) {
hdd_debug("Prohibit command can not be sent"); hdd_debug("Prohibit command can not be sent");
@@ -945,10 +926,6 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
} }
break; break;
case QCA_WLAN_SR_OPERATION_GET_PARAMS: case QCA_WLAN_SR_OPERATION_GET_PARAMS:
if (!hdd_check_mode_support_for_sr(adapter, sr_ctrl)) {
ret = -EINVAL;
goto exit;
}
wlan_vdev_mlme_get_srg_pd_offset(vdev, &srg_max_pd_offset, wlan_vdev_mlme_get_srg_pd_offset(vdev, &srg_max_pd_offset,
&srg_min_pd_offset); &srg_min_pd_offset);
non_srg_max_pd_offset = non_srg_max_pd_offset =

View File

@@ -507,29 +507,24 @@ static void lim_detect_change_in_srp(struct mac_context *mac_ctx,
tpSchBeaconStruct bcn) tpSchBeaconStruct bcn)
{ {
tDot11fIEspatial_reuse sr_ie; tDot11fIEspatial_reuse sr_ie;
int32_t ret = 0;
sr_ie = sta->parsed_ies.srp_ie; sr_ie = sta->parsed_ies.srp_ie;
if (!sr_ie.present) { if (sr_ie.present || bcn->srp_ie.present) {
return; ret = qdf_mem_cmp(&sr_ie, &bcn->srp_ie,
} else if (!bcn->srp_ie.present) { sizeof(tDot11fIEspatial_reuse));
pe_err_rl("SRP IE is missing in beacon, disable SR");
} else if (!qdf_mem_cmp(&sr_ie, &bcn->srp_ie, if (ret) {
sizeof(tDot11fIEspatial_reuse))) { /*
/* No change in beacon SRP IE */ * If SRP IE has changes, update the new params.
return; */
sta->parsed_ies.srp_ie = bcn->srp_ie;
lim_update_vdev_sr_elements(session, sta);
lim_handle_sr_cap(session->vdev,
SR_REASON_CODE_BCN_IE_CHANGE);
}
} }
/*
* If SRP IE has changes, update the new params.
* Else if the SRP IE is missing, disable SR
*/
sta->parsed_ies.srp_ie = bcn->srp_ie;
if (bcn->srp_ie.present)
lim_update_vdev_sr_elements(session, sta);
else
wlan_vdev_mlme_set_sr_ctrl(session->vdev, SR_DISABLE);
lim_handle_sr_cap(session->vdev, SR_REASON_CODE_BCN_IE_CHANGE);
} }
#else #else
static void lim_detect_change_in_srp(struct mac_context *mac_ctx, static void lim_detect_change_in_srp(struct mac_context *mac_ctx,