Browse Source

qcacld-3.0: Handle A-EDCA based on STA-SAP concurrency

Handle A-EDCA based on STA-SAP concurrency. Also, update
RTS profile based on the concurrency such that:
1) For STA and SAP concurrency, send STA's AP EDCA
   params to fw. Also, for SAP or P2P Go, update the
   value in Broadcast EDCA params as well so that it
   should be broadcasted to other stations connected
   to that BSS. Also, update the RTS profile value to
   0x11. It will let FW disable SIFS bursting and send
   RTS for every frame.
2) For standalone STA (can even happen after SAP/P2P Go
   disconnects), if the parameters are updated, reset
   them to original parameters and send them to FW.
   Also, update the RTS profile value to the value
   it was set before.
3) For standalone SAP (can even happen after STA
   disconnects), if the parameters are updated, reset
   them to original parameters and send them to FW and
   reset the  Broadcast EDCA params as well so that it
   should be broadcasted to other stations connected
   to that BSS Also, update the RTS profile value to
   which it was set before.

Change-Id: Idb2b04b1b0bddb51cea9c5665847d04817a90aca
CRs-Fixed: 2949484
Utkarsh Bhatnagar 3 years ago
parent
commit
3f9add4ec4

+ 27 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -1491,6 +1491,18 @@ struct policy_mgr_hdd_cbacks {
 			struct ch_params *ch_params);
 };
 
+/**
+ * struct policy_mgr_conc_cbacks - lim Callbacks to be invoked
+ * from policy manager
+ * @connection_info_update: check and update params based on STA/SAP
+ *                          concurrency.such as EDCA params and RTS threshold.
+ *                          If updated, it will also send the updated parameters
+ *                          to FW.
+ */
+
+struct policy_mgr_conc_cbacks {
+	void (*connection_info_update)(void);
+};
 
 /**
  * struct policy_mgr_tdls_cbacks - TDLS Callbacks to be invoked
@@ -2366,6 +2378,21 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc,
 		struct policy_mgr_hdd_cbacks *hdd_cbacks);
 
+/**
+ * policy_mgr_register_conc_cb() - register Lim callbacks
+ * @psoc: PSOC object information
+ * @hdd_cbacks: function pointers from lim
+ *
+ * API, allows Lim to register callbacks to be invoked by policy
+ * mgr
+ *
+ * Return: SUCCESS,
+ *         Failure (if registration fails)
+ */
+
+QDF_STATUS policy_mgr_register_conc_cb(struct wlan_objmgr_psoc *psoc,
+				struct policy_mgr_conc_cbacks *conc_cbacks);
+
 /**
  * policy_mgr_deregister_hdd_cb() - Deregister HDD callbacks
  * @psoc: PSOC object information

+ 3 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -632,6 +632,9 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 		if (pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb)
 			pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb(mcc_mode);
 	}
+
+	if (pm_ctx->conc_cbacks.connection_info_update)
+		pm_ctx->conc_cbacks.connection_info_update();
 }
 
 /**

+ 3 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -2229,6 +2229,9 @@ QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc,
 		sizeof(*pm_conc_connection_list));
 	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
 
+	if (pm_ctx->conc_cbacks.connection_info_update)
+		pm_ctx->conc_cbacks.connection_info_update();
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 3 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -294,6 +294,8 @@ struct policy_mgr_cfg {
  * interaction with Policy Manager
  * @cdp_cbacks: callbacks to be registered by SME for
  * interaction with Policy Manager
+ * @conc_cbacks: callbacks to be registered by lim for
+ * interaction with Policy Manager
  * @sap_mandatory_channels: The user preferred master list on
  *                        which SAP can be brought up. This
  *                        mandatory channel freq list would be as per
@@ -340,6 +342,7 @@ struct policy_mgr_psoc_priv_obj {
 	struct policy_mgr_tdls_cbacks tdls_cbacks;
 	struct policy_mgr_cdp_cbacks cdp_cbacks;
 	struct policy_mgr_dp_cbacks dp_cbacks;
+	struct policy_mgr_conc_cbacks conc_cbacks;
 	uint32_t sap_mandatory_channels[NUM_CHANNELS];
 	uint32_t sap_mandatory_channels_len;
 	bool do_sap_unsafe_ch_check;

+ 16 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c

@@ -613,6 +613,22 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc)
 	return status;
 }
 
+QDF_STATUS policy_mgr_register_conc_cb(struct wlan_objmgr_psoc *psoc,
+				struct policy_mgr_conc_cbacks *conc_cbacks)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	pm_ctx->conc_cbacks.connection_info_update =
+					conc_cbacks->connection_info_update;
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc,
 		struct policy_mgr_sme_cbacks *sme_cbacks)
 {

+ 8 - 0
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -46,6 +46,7 @@
 #include "wlan_hdd_power.h"
 #include "wlan_hdd_napi.h"
 #include "wlan_roam_debug.h"
+#include "wma_api.h"
 
 void hdd_handle_disassociation_event(struct hdd_adapter *adapter,
 				     struct qdf_mac_addr *peer_macaddr)
@@ -176,6 +177,13 @@ void __hdd_cm_disconnect_handler_post_user_update(struct hdd_adapter *adapter)
 	/* Clear saved connection information in HDD */
 	hdd_conn_remove_connect_info(sta_ctx);
 
+	/* Setting the RTS profile to original value */
+	if (sme_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_ENABLE_RTSCTS,
+				cfg_get(hdd_ctx->psoc,
+					CFG_ENABLE_FW_RTS_PROFILE),
+				VDEV_CMD))
+		hdd_debug("Failed to set RTS_PROFILE");
+
 	hdd_init_scan_reject_params(hdd_ctx);
 	ucfg_pmo_flush_gtk_offload_req(adapter->vdev);
 

+ 7 - 0
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -1496,6 +1496,13 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter)
 			hdd_err("WLAN_AP_DISCONNECT event failed");
 	}
 
+	/* Setting the RTS profile to original value */
+	if (sme_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_ENABLE_RTSCTS,
+				cfg_get(hdd_ctx->psoc,
+					CFG_ENABLE_FW_RTS_PROFILE),
+				VDEV_CMD))
+		hdd_debug("Failed to set RTS_PROFILE");
+
 	return status;
 }
 

+ 2 - 0
core/mac/src/include/dph_global.h

@@ -53,6 +53,8 @@ typedef struct sDphQosParams {
 	uint8_t addtsPresent;
 	tSirAddtsReqInfo addts;
 	tSirMacQosCapabilityStaIE capability;
+	/*AP EDCA params, extracted from assoc resp*/
+	tSirMacEdcaParamSetIE peer_edca_params;
 } tDphQosParams;
 
 /**

+ 5 - 1
core/mac/src/pe/include/sch_api.h

@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2011-2015, 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2015, 2017-2019, 2021 The Linux Foundation. All rights
+ * reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -44,6 +45,9 @@ void sch_set_default_edca_params(struct mac_context *mac, struct pe_session *pe_
 /* update only local qos params */
 void sch_qos_update_local(struct mac_context *mac, struct pe_session *pe_session);
 
+/* update the edca profile parameters based on STA-SAP concurrency */
+void sch_qos_concurrency_update(void);
+
 /* update the edca profile parameters */
 void sch_edca_profile_update(struct mac_context *mac,
 			     struct pe_session *pe_session);

+ 15 - 0
core/mac/src/pe/lim/lim_api.c

@@ -728,6 +728,19 @@ static QDF_STATUS lim_unregister_sap_bcn_callback(struct mac_context *mac_ctx)
 	return status;
 }
 
+static void lim_register_policy_mgr_callback(struct wlan_objmgr_psoc *psoc)
+{
+	struct policy_mgr_conc_cbacks conc_cbacks;
+
+	qdf_mem_zero(&conc_cbacks, sizeof(conc_cbacks));
+	conc_cbacks.connection_info_update = lim_send_conc_params_update;
+
+	if (QDF_STATUS_SUCCESS != policy_mgr_register_conc_cb(psoc,
+							      &conc_cbacks)) {
+		pe_err("failed to register policy manager callbacks");
+	}
+}
+
 static int pe_hang_event_notifier_call(struct notifier_block *block,
 				       unsigned long state,
 				       void *data)
@@ -841,6 +854,8 @@ QDF_STATUS pe_open(struct mac_context *mac, struct cds_config_info *cds_cfg)
 	lim_nan_register_callbacks(mac);
 	p2p_register_callbacks(mac);
 	lim_register_sap_bcn_callback(mac);
+	if (mac->mlme_cfg->edca_params.enable_edca_params)
+		lim_register_policy_mgr_callback(mac->psoc);
 
 	if (!QDF_IS_STATUS_SUCCESS(
 	    cds_shutdown_notifier_register(pe_shutdown_notifier_cb, mac))) {

+ 8 - 0
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -230,6 +230,10 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx,
 		if (assoc_rsp->edcaPresent) {
 			QDF_STATUS status;
 
+			qdf_mem_copy(&sta_ds->qos.peer_edca_params,
+				     &assoc_rsp->edca,
+				     sizeof(assoc_rsp->edca));
+
 			status =
 				sch_beacon_edca_process(mac_ctx,
 					&assoc_rsp->edca, session_entry);
@@ -250,6 +254,10 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx,
 	if (session_entry->limWmeEnabled && assoc_rsp->wmeEdcaPresent) {
 		QDF_STATUS status;
 
+		qdf_mem_copy(&sta_ds->qos.peer_edca_params,
+			     &assoc_rsp->edca,
+			     sizeof(assoc_rsp->edca));
+
 		status = sch_beacon_edca_process(mac_ctx, &assoc_rsp->edca,
 				session_entry);
 		pe_debug("WME Edca set update based on AssocRsp: status %d",

+ 5 - 1
core/mac/src/pe/lim/lim_process_probe_rsp_frame.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -244,6 +244,9 @@ lim_process_probe_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_Packet_info
 				session_entry) != QDF_STATUS_SUCCESS) {
 				pe_err("EDCA param process error");
 			} else if (sta_ds) {
+				qdf_mem_copy(&sta_ds->qos.peer_edca_params,
+					     &probe_rsp->edcaParams,
+					     sizeof(probe_rsp->edcaParams));
 				/*
 				 * If needed, downgrade the
 				 * EDCA parameters
@@ -255,6 +258,7 @@ lim_process_probe_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_Packet_info
 				lim_send_edca_params(mac_ctx,
 					session_entry->gLimEdcaParamsActive,
 					session_entry->vdev_id, false);
+				sch_qos_concurrency_update();
 			} else {
 				pe_err("SelfEntry missing in Hash");
 			}

+ 254 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -5187,6 +5187,260 @@ void lim_set_vht_caps(struct mac_context *p_mac, struct pe_session *p_session_en
 	}
 }
 
+/*
+ * Firmware will send RTS for every frame and also will disable SIFS bursting
+ * if value 0x11 is sent for RTS profile.
+ */
+#define A_EDCA_SCC_RTS_PROFILE_VALUE 0x11
+#define MAX_NUMBER_OF_SINGLE_PORT_CONC_CONNECTIONS 2
+
+static void lim_update_sta_edca_params(struct mac_context *mac,
+				       struct pe_session *sta_session)
+{
+	uint8_t i;
+
+	for (i = QCA_WLAN_AC_BE; i < QCA_WLAN_AC_ALL; i++) {
+		sta_session->gLimEdcaParamsActive[i] =
+						sta_session->gLimEdcaParams[i];
+	}
+	lim_send_edca_params(mac,
+			     sta_session->gLimEdcaParamsActive,
+			     sta_session->vdev_id, false);
+}
+
+/**
+ * lim_check_conc_and_send_edca() - Function to check and update EDCA params
+ *                                  and RTS profile based on STA/SAP
+ *                                  concurrency. If updated, it will also send
+ *                                  the updated parameters to FW. It will update
+ * EDCA params and RTS profile such that:
+ *       1) For STA and SAP concurrency, send STA's AP EDCA params to fw.
+ *          Also, for SAP or P2P Go, update the value in Broadcast EDCA params
+ *          as well so that it should be broadcasted to other stations connected
+ *          to that BSS. Also, update the RTS profile value to 0x11 for which
+ *          FW will send RTS for every frame and will also disable SIFS
+ *          bursting.
+ *
+ *       2) For standalone STA (can even happen after SAP/P2P Go
+ *          disconnects), if the parameters are updated, reset them to original
+ *          parameters and send them to FW. Also, update the RTS profile
+ *          value to which it was set before.
+ *
+ *       3) For standalone SAP (can even happen after STA disconnects),
+ *          if the parameters are updated, reset them to original
+ *          parameters and send them to FW and reset the  Broadcast EDCA params
+ *          as well so that it should be broadcasted to other stations connected
+ *          to that BSS Also, update the RTS profile value to which it was set
+ *          before.
+ *
+ * This update is needed because throughput drop was seen because of
+ * inconsistency in the EDCA params used in STA-SAP or STA-P2P_GO concurrency.
+ *
+ * Return: void
+ */
+
+static void lim_check_conc_and_send_edca(struct mac_context *mac,
+					 struct pe_session *sta_session,
+					 struct pe_session *sap_session)
+{
+	bool params_update_required = false;
+	uint8_t i;
+	tpDphHashNode sta_ds = NULL;
+	QDF_STATUS status;
+	uint16_t assoc_id;
+
+	if (sta_session && sap_session &&
+	    (sta_session->curr_op_freq ==
+	     sap_session->curr_op_freq)) {
+	/* RTS profile update to FW */
+		wma_cli_set_command(sap_session->vdev_id,
+				    WMI_VDEV_PARAM_ENABLE_RTSCTS,
+				    A_EDCA_SCC_RTS_PROFILE_VALUE,
+				    VDEV_CMD);
+		wma_cli_set_command(sta_session->vdev_id,
+				    WMI_VDEV_PARAM_ENABLE_RTSCTS,
+				    A_EDCA_SCC_RTS_PROFILE_VALUE,
+				    VDEV_CMD);
+
+		sta_ds = dph_lookup_hash_entry(mac,
+					       sta_session->bssId,
+					       &assoc_id,
+					       &sta_session->dph.dphHashTable);
+
+		if (!sta_ds) {
+			pe_debug("No STA DS entry found for " QDF_MAC_ADDR_FMT,
+				 QDF_MAC_ADDR_REF(sta_session->bssId));
+			return;
+		}
+
+		if (!sta_ds->qos.peer_edca_params.length) {
+			pe_debug("No sta_ds edca_params present");
+			return;
+		}
+
+	/*
+	 * Here what we do is disable A-EDCA by sending the edca params of
+	 * connected AP which we got as part of assoc resp So as these EDCA
+	 * params are updated per mac , its fine to send for SAP which will
+	 * be used for STA as well on the same channel. No need to send for
+	 * both SAP and STA.
+	 */
+
+		sap_session->gLimEdcaParamsBC[QCA_WLAN_AC_BE] =
+				sta_ds->qos.peer_edca_params.acbe;
+		sap_session->gLimEdcaParamsBC[QCA_WLAN_AC_BK] =
+				sta_ds->qos.peer_edca_params.acbk;
+		sap_session->gLimEdcaParamsBC[QCA_WLAN_AC_VI] =
+				sta_ds->qos.peer_edca_params.acvi;
+		sap_session->gLimEdcaParamsBC[QCA_WLAN_AC_VO] =
+				sta_ds->qos.peer_edca_params.acvo;
+
+		sap_session->gLimEdcaParamsActive[QCA_WLAN_AC_BE] =
+				sta_ds->qos.peer_edca_params.acbe;
+		sap_session->gLimEdcaParamsActive[QCA_WLAN_AC_BK] =
+				sta_ds->qos.peer_edca_params.acbk;
+		sap_session->gLimEdcaParamsActive[QCA_WLAN_AC_VI] =
+				sta_ds->qos.peer_edca_params.acvi;
+		sap_session->gLimEdcaParamsActive[QCA_WLAN_AC_VO] =
+				sta_ds->qos.peer_edca_params.acvo;
+
+		for (i = QCA_WLAN_AC_BE; i < QCA_WLAN_AC_ALL; i++) {
+			sta_session->gLimEdcaParamsActive[i] =
+				sap_session->gLimEdcaParamsActive[i];
+		}
+		/* For AP, the bssID is stored in LIM Global context. */
+		lim_send_edca_params(mac, sap_session->gLimEdcaParamsActive,
+				     sap_session->vdev_id, false);
+
+		sap_session->gLimEdcaParamSetCount++;
+		status = sch_set_fixed_beacon_fields(mac, sap_session);
+		if (QDF_IS_STATUS_ERROR(status))
+			pe_debug("Unable to set beacon fields!");
+
+	} else if (!sap_session && sta_session) {
+	/*
+	 * Enable A-EDCA for standalone STA. The original EDCA parameters are
+	 * stored in gLimEdcaParams (computed by sch_beacon_edca_process()),
+	 * if active parameters are not equal that means they have been updated
+	 * because of conncurrency and are need to be restored now
+	 */
+
+		wma_cli_set_command(sta_session->vdev_id,
+				    WMI_VDEV_PARAM_ENABLE_RTSCTS,
+				    cfg_get(mac->psoc,
+					    CFG_ENABLE_FW_RTS_PROFILE),
+				    VDEV_CMD);
+		for (i = QCA_WLAN_AC_BE; i < QCA_WLAN_AC_ALL; i++) {
+			if (qdf_mem_cmp(&sta_session->gLimEdcaParamsActive[i],
+					&sta_session->gLimEdcaParams[i],
+					sizeof(tSirMacEdcaParamRecord))) {
+				pe_debug("local sta EDCA params are not equal to Active EDCA params, hence update required");
+				params_update_required = true;
+				break;
+			}
+		}
+
+		if (params_update_required) {
+			lim_update_sta_edca_params(mac,
+						   sta_session);
+		}
+	} else {
+	/*
+	 * For STA+SAP/GO DBS, STA+SAP/GO MCC or standalone SAP/GO
+	 */
+
+		wma_cli_set_command(sap_session->vdev_id,
+				    WMI_VDEV_PARAM_ENABLE_RTSCTS,
+				    cfg_get(mac->psoc,
+					    CFG_ENABLE_FW_RTS_PROFILE),
+				    VDEV_CMD);
+		if (sta_session)
+			wma_cli_set_command(sta_session->vdev_id,
+					    WMI_VDEV_PARAM_ENABLE_RTSCTS,
+					    cfg_get(mac->psoc,
+						    CFG_ENABLE_FW_RTS_PROFILE),
+					    VDEV_CMD);
+
+		for (i = QCA_WLAN_AC_BE; i < QCA_WLAN_AC_ALL; i++) {
+			if (qdf_mem_cmp(&sap_session->gLimEdcaParamsActive[i],
+					&sap_session->gLimEdcaParams[i],
+					sizeof(tSirMacEdcaParamRecord))) {
+				pe_debug("local sap EDCA params are not equal to Active EDCA params, hence update required");
+				params_update_required = true;
+				break;
+			}
+		}
+
+		if (params_update_required) {
+			for (i = QCA_WLAN_AC_BE; i < QCA_WLAN_AC_ALL; i++) {
+				sap_session->gLimEdcaParamsActive[i] =
+					sap_session->gLimEdcaParams[i];
+			}
+			lim_send_edca_params(mac,
+					     sap_session->gLimEdcaParamsActive,
+					     sap_session->vdev_id, false);
+			sch_qos_update_broadcast(mac, sap_session);
+
+	/*
+	 * In case of mcc, where cb can come from scc to mcc swtich where we
+	 * need to restore the default parameters
+	 */
+			if (sta_session) {
+				lim_update_sta_edca_params(mac,
+							   sta_session);
+				}
+		}
+	}
+}
+
+void lim_send_conc_params_update(void)
+{
+	struct pe_session *sta_session = NULL;
+	struct pe_session *sap_session = NULL;
+	uint8_t i;
+	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
+
+	if (!mac->mlme_cfg->edca_params.enable_edca_params ||
+	    (policy_mgr_get_connection_count(mac->psoc) >
+	     MAX_NUMBER_OF_SINGLE_PORT_CONC_CONNECTIONS)) {
+		pe_debug("A-EDCA not enabled or max number of connections: %d",
+			 policy_mgr_get_connection_count(mac->psoc));
+		return;
+	}
+
+	for (i = 0; i < mac->lim.maxBssId; i++) {
+		/*
+		 * Finding whether STA or Go session exists
+		 */
+		if (sta_session && sap_session)
+			break;
+
+		if ((mac->lim.gpSession[i].valid) &&
+		    (mac->lim.gpSession[i].limSystemRole ==
+		     eLIM_STA_ROLE)) {
+			sta_session = &mac->lim.gpSession[i];
+			continue;
+		}
+		if ((mac->lim.gpSession[i].valid) &&
+		    ((mac->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE) ||
+		    (mac->lim.gpSession[i].limSystemRole ==
+		     eLIM_P2P_DEVICE_GO))) {
+			sap_session = &mac->lim.gpSession[i];
+			continue;
+		}
+	}
+
+	if (!(sta_session || sap_session)) {
+		pe_debug("No sta or sap or P2P go session");
+		return;
+	}
+
+	pe_debug("Valid STA session: %d Valid SAP session: %d",
+		 (sta_session ? sta_session->valid : 0),
+		 (sap_session ? sap_session->valid : 0));
+	lim_check_conc_and_send_edca(mac, sta_session, sap_session);
+}
+
 /**
  * lim_validate_received_frame_a1_addr() - To validate received frame's A1 addr
  * @mac_ctx: pointer to mac context

+ 10 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -2681,4 +2681,14 @@ void lim_process_tpe_ie_from_beacon(struct mac_context *mac,
 				    struct pe_session *session,
 				    struct bss_description *bss_desc,
 				    bool *has_tpe_updated);
+
+/**
+ * lim_send_conc_params_update() - Function to check and update params based on
+ *                                  STA/SAP concurrency.such as EDCA params
+ *                                  and RTS profile. If updated, it will also
+ *                                  also send the updated parameters to FW.
+ *
+ * Return: void
+ */
+void lim_send_conc_params_update(void);
 #endif /* __LIM_UTILS_H */

+ 4 - 0
core/mac/src/pe/sch/sch_beacon_process.c

@@ -383,6 +383,9 @@ sch_bcn_process_sta(struct mac_context *mac_ctx,
 	    (bcn->edcaPresent && session->limQosEnabled)) {
 		if (bcn->edcaParams.qosInfo.count !=
 		    session->gLimEdcaParamSetCount) {
+			qdf_mem_copy(&sta->qos.peer_edca_params,
+				     &bcn->edcaParams,
+				     sizeof(bcn->edcaParams));
 			status = sch_beacon_edca_process(mac_ctx,
 							 &bcn->edcaParams,
 							 session);
@@ -395,6 +398,7 @@ sch_bcn_process_sta(struct mac_context *mac_ctx,
 				lim_send_edca_params(mac_ctx,
 					session->gLimEdcaParamsActive,
 					session->vdev_id, false);
+				sch_qos_concurrency_update();
 			} else {
 				pe_err("Self Entry missing in Hash Table");
 			}

+ 18 - 2
core/mac/src/pe/sch/sch_message.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -27,6 +27,7 @@
 #include "sch_api.h"
 #include "wlan_mlme_api.h"
 #include <wlan_reg_services_api.h>
+#include "lim_utils.h"
 
 /* / Minimum beacon interval allowed (in Kus) */
 #define SCH_BEACON_INTERVAL_MIN  10
@@ -356,9 +357,10 @@ void sch_qos_update_local(struct mac_context *mac, struct pe_session *pe_session
 	}
 
 	set_sch_edca_params(mac, params, pe_session);
+	lim_set_active_edca_params(mac, pe_session->gLimEdcaParams, pe_session);
 
 	/* For AP, the bssID is stored in LIM Global context. */
-	lim_send_edca_params(mac, pe_session->gLimEdcaParams,
+	lim_send_edca_params(mac, pe_session->gLimEdcaParamsActive,
 			     pe_session->vdev_id, false);
 }
 
@@ -484,6 +486,19 @@ get_wmm_local_params(struct mac_context *mac_ctx,
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * sch_qos_concurrency_update() - This function updates the local and
+ *                                broadcast based on STA and SAP
+ *                                concurrency. It also updates the
+ * edcaParamSetCount, if Broadcast EDCA params are updated based on Concurrency.
+ *
+ * Return  none
+ */
+void sch_qos_concurrency_update(void)
+{
+	lim_send_conc_params_update();
+}
+
 /**
  * sch_edca_profile_update() - This function updates the local and broadcast
  * EDCA params in the gLimEdcaParams structure. It also updates the
@@ -498,6 +513,7 @@ void sch_edca_profile_update(struct mac_context *mac, struct pe_session *pe_sess
 	if (LIM_IS_AP_ROLE(pe_session)) {
 		sch_qos_update_local(mac, pe_session);
 		sch_qos_update_broadcast(mac, pe_session);
+		sch_qos_concurrency_update();
 	}
 }