Browse Source

qcacld-3.0: Fix ac fallback issue when TSPEC id deleted

When TSPEC session is deleted, the access category of the data packets
should be downgraded to next lower AC. But this is not happening due to
acm mask is not getting updated when bss descriptor is NULL.

To fix this ssue, update acm mask from bss descriptor only when beacon
IEs are not present.
Also move qos related logic to LIM and bring missig changes which were
there before connection manager.

Change-Id: I9da80cf492b01762b4cc0a7b73271a0f5fe4b4a4
CRs-Fixed: 3011069
Bapiraju Alla 3 years ago
parent
commit
6874af8035

+ 9 - 0
components/mlme/core/inc/wlan_mlme_main.h

@@ -72,6 +72,13 @@ enum size_of_len_field {
 	TWO_BYTE = 2
 };
 
+enum medium_access_type {
+	MEDIUM_ACCESS_AUTO = 0,
+	MEDIUM_ACCESS_DCF,
+	MEDIUM_ACCESS_11E_EDCF,
+	MEDIUM_ACCESS_WMM_EDCF_DSCP,
+};
+
 struct pwr_channel_info {
 	uint32_t first_freq;
 	uint8_t num_chan;
@@ -313,6 +320,7 @@ struct ft_context {
  * derived from JOIN_REQ and REASSOC_REQ. If a particular AC bit is set, it
  * means the AC is both trigger enabled and delivery enabled.
  * @qos_enabled: is qos enabled
+ * @qos_type: qos type calculated from bss
  * @ft_info: ft related info
  * @hlp_ie: hldp ie
  * @hlp_ie_len: hlp ie length
@@ -330,6 +338,7 @@ struct mlme_connect_info {
 #endif
 	uint8_t uapsd_per_ac_bitmask;
 	bool qos_enabled;
+	enum medium_access_type qos_type;
 	struct ft_context ft_info;
 #ifdef WLAN_FEATURE_FILS_SK
 	uint8_t *hlp_ie;

+ 65 - 9
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2680,6 +2680,70 @@ static QDF_STATUS lim_iterate_triplets(tDot11fIECountry country_ie)
 	return QDF_STATUS_SUCCESS;
 }
 
+static void lim_set_qos_to_cfg(struct pe_session *session,
+			       enum medium_access_type qos_type)
+{
+	bool qos_enabled;
+	bool wme_enabled;
+
+	switch (qos_type) {
+	case MEDIUM_ACCESS_WMM_EDCF_DSCP:
+		qos_enabled = false;
+		wme_enabled = true;
+		break;
+	case MEDIUM_ACCESS_11E_EDCF:
+		qos_enabled = true;
+		wme_enabled = false;
+		break;
+	default:
+	case MEDIUM_ACCESS_DCF:
+		qos_enabled = false;
+		wme_enabled = false;
+		break;
+	}
+
+	session->limWmeEnabled = wme_enabled;
+	session->limQosEnabled = qos_enabled;
+}
+
+static void lim_update_qos(struct mac_context *mac_ctx,
+			   struct pe_session *session)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(session->vdev);
+	if (!mlme_priv)
+		return;
+
+	if ((session->dot11mode != MLME_DOT11_MODE_11N) &&
+	    (mac_ctx->roam.configParam.WMMSupportMode == eCsrRoamWmmNoQos)) {
+		/*
+		 * Joining BSS is not 11n capable and WMM is disabled on client.
+		 * Disable QoS and WMM
+		 */
+		mlme_priv->connect_info.qos_type = MEDIUM_ACCESS_DCF;
+	}
+
+	if ((session->dot11mode == MLME_DOT11_MODE_11N ||
+	     session->dot11mode == MLME_DOT11_MODE_11AC) &&
+	      (mlme_priv->connect_info.qos_type !=
+		MEDIUM_ACCESS_WMM_EDCF_DSCP &&
+	       mlme_priv->connect_info.qos_type !=
+		MEDIUM_ACCESS_11E_EDCF)) {
+		/*
+		 * Joining BSS is 11n capable and WMM is disabled on AP.
+		 * Assume all HT AP's are QOS AP's and enable WMM
+		 */
+		mlme_priv->connect_info.qos_type =
+					MEDIUM_ACCESS_WMM_EDCF_DSCP;
+	}
+
+	lim_set_qos_to_cfg(session, mlme_priv->connect_info.qos_type);
+	mlme_priv->connect_info.qos_enabled = session->limWmeEnabled;
+	pe_debug("QOS %d WMM %d", session->limQosEnabled,
+		 session->limWmeEnabled);
+}
+
 static QDF_STATUS
 lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 		    struct bss_description *bss_desc)
@@ -2827,15 +2891,7 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 
 	session->statypeForBss = STA_ENTRY_PEER;
 
-	if (mac_ctx->roam.roamSession[session->vdev_id].fWMMConnection)
-		session->limWmeEnabled = true;
-	else
-		session->limWmeEnabled = false;
-
-	if (mac_ctx->roam.roamSession[session->vdev_id].fQOSConnection)
-		session->limQosEnabled = true;
-	else
-		session->limQosEnabled = false;
+	lim_update_qos(mac_ctx, session);
 
 	if (session->lim_join_req->bssDescription.adaptive_11r_ap)
 		session->is_adaptive_11r_connection =

+ 0 - 15
core/sme/inc/csr_api.h

@@ -381,21 +381,6 @@ typedef enum {
 	eCSR_CONNECT_STATE_TYPE_NDI_STARTED,
 } eCsrConnectState;
 
-/*
- * This parameter is no longer supported in the Profile.
- * Need to set this in the global properties for the adapter.
- */
-typedef enum eCSR_MEDIUM_ACCESS {
-	eCSR_MEDIUM_ACCESS_AUTO = 0,
-	eCSR_MEDIUM_ACCESS_DCF,
-	eCSR_MEDIUM_ACCESS_11e_eDCF,
-	eCSR_MEDIUM_ACCESS_11e_HCF,
-
-	eCSR_MEDIUM_ACCESS_WMM_eDCF_802dot1p,
-	eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP,
-	eCSR_MEDIUM_ACCESS_WMM_eDCF_NoClassify,
-} eCsrMediaAccessType;
-
 typedef enum {
 	eCSR_OPERATING_CHANNEL_ALL = 0,
 	eCSR_OPERATING_CHANNEL_AUTO = eCSR_OPERATING_CHANNEL_ALL,

+ 1 - 1
core/sme/inc/csr_internal.h

@@ -122,7 +122,7 @@ struct csr_channel {
 };
 
 struct bss_config_param {
-	eCsrMediaAccessType qosType;
+	enum medium_access_type qosType;
 	tSirMacSSid SSID;
 	enum csr_cfgdot11mode uCfgDot11Mode;
 	tSirMacCapabilityInfo BssCap;

+ 1 - 1
core/sme/inc/csr_support.h

@@ -53,7 +53,7 @@ struct csr_timer_info {
 #define CSR_IS_QOS_BSS(pIes)  \
 		((pIes)->WMMParams.present || (pIes)->WMMInfoAp.present)
 
-eCsrMediaAccessType
+enum medium_access_type
 csr_get_qos_from_bss_desc(struct mac_context *mac_ctx,
 			  struct bss_description *pSirBssDesc,
 			  tDot11fBeaconIEs *pIes);

+ 11 - 21
core/sme/src/csr/csr_api_roam.c

@@ -2347,9 +2347,9 @@ QDF_STATUS csr_roam_prepare_bss_config_from_profile(struct mac_context *mac,
 	     qAPisEnabled) ||
 	    ((eCSR_CFG_DOT11_MODE_11N == pBssConfig->uCfgDot11Mode &&
 	      qAPisEnabled))) {
-		pBssConfig->qosType = eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP;
+		pBssConfig->qosType = MEDIUM_ACCESS_WMM_EDCF_DSCP;
 	} else {
-		pBssConfig->qosType = eCSR_MEDIUM_ACCESS_DCF;
+		pBssConfig->qosType = MEDIUM_ACCESS_DCF;
 	}
 
 	/* short slot time */
@@ -2364,7 +2364,7 @@ QDF_STATUS csr_roam_prepare_bss_config_from_profile(struct mac_context *mac,
 }
 
 static QDF_STATUS csr_set_qos_to_cfg(struct mac_context *mac, uint32_t sessionId,
-				     eCsrMediaAccessType qosType)
+				     enum medium_access_type qosType)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint32_t QoSEnabled;
@@ -2373,28 +2373,16 @@ static QDF_STATUS csr_set_qos_to_cfg(struct mac_context *mac, uint32_t sessionId
 	 * qosType being configured.
 	 */
 	switch (qosType) {
-	case eCSR_MEDIUM_ACCESS_WMM_eDCF_802dot1p:
+	case MEDIUM_ACCESS_WMM_EDCF_DSCP:
 		QoSEnabled = false;
 		WmeEnabled = true;
 		break;
-	case eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP:
-		QoSEnabled = false;
-		WmeEnabled = true;
-		break;
-	case eCSR_MEDIUM_ACCESS_WMM_eDCF_NoClassify:
-		QoSEnabled = false;
-		WmeEnabled = true;
-		break;
-	case eCSR_MEDIUM_ACCESS_11e_eDCF:
-		QoSEnabled = true;
-		WmeEnabled = false;
-		break;
-	case eCSR_MEDIUM_ACCESS_11e_HCF:
+	case MEDIUM_ACCESS_11E_EDCF:
 		QoSEnabled = true;
 		WmeEnabled = false;
 		break;
 	default:
-	case eCSR_MEDIUM_ACCESS_DCF:
+	case MEDIUM_ACCESS_DCF:
 		QoSEnabled = false;
 		WmeEnabled = false;
 		break;
@@ -5970,6 +5958,7 @@ QDF_STATUS cm_csr_handle_join_req(struct wlan_objmgr_vdev *vdev,
 	tDot11fBeaconIEs *ie_struct;
 	struct bss_description *bss_desc;
 	uint32_t ie_len, bss_len;
+	struct mlme_legacy_priv *mlme_priv;
 
 	/*
 	 * This API is to update legacy struct and should be removed once
@@ -6018,9 +6007,10 @@ QDF_STATUS cm_csr_handle_join_req(struct wlan_objmgr_vdev *vdev,
 				      SME_QOS_CSR_JOIN_REQ, NULL);
 	}
 
-	csr_set_qos_to_cfg(mac_ctx, vdev_id,
-			   csr_get_qos_from_bss_desc(mac_ctx, bss_desc,
-						     ie_struct));
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (mlme_priv)
+		mlme_priv->connect_info.qos_type =
+			csr_get_qos_from_bss_desc(mac_ctx, bss_desc, ie_struct);
 
 	if ((wlan_reg_11d_enabled_on_host(mac_ctx->psoc)) &&
 	     !ie_struct->Country.present)

+ 7 - 7
core/sme/src/csr/csr_util.c

@@ -869,12 +869,12 @@ static bool csr_is_bss_description_wme(struct mac_context *mac,
 	return fWme;
 }
 
-eCsrMediaAccessType
+enum medium_access_type
 csr_get_qos_from_bss_desc(struct mac_context *mac_ctx,
 			  struct bss_description *pSirBssDesc,
 			  tDot11fBeaconIEs *pIes)
 {
-	eCsrMediaAccessType qosType = eCSR_MEDIUM_ACCESS_DCF;
+	enum medium_access_type qosType = MEDIUM_ACCESS_DCF;
 
 	if (!pIes) {
 		QDF_ASSERT(pIes);
@@ -886,22 +886,22 @@ csr_get_qos_from_bss_desc(struct mac_context *mac_ctx,
 		 * override and use WMM.
 		 */
 		if (csr_is_bss_description_wme(mac_ctx, pSirBssDesc, pIes))
-			qosType = eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP;
+			qosType = MEDIUM_ACCESS_WMM_EDCF_DSCP;
 		else {
 			/* If the QoS bit is on, then the AP is
 			 * advertising 11E QoS.
 			 */
 			if (csr_is_qos_bss_desc(pSirBssDesc))
-				qosType = eCSR_MEDIUM_ACCESS_11e_eDCF;
+				qosType = MEDIUM_ACCESS_11E_EDCF;
 			else
-				qosType = eCSR_MEDIUM_ACCESS_DCF;
+				qosType = MEDIUM_ACCESS_DCF;
 
 			/* Scale back based on the types turned on
 			 * for the adapter.
 			 */
-			if (eCSR_MEDIUM_ACCESS_11e_eDCF == qosType
+			if (qosType == MEDIUM_ACCESS_11E_EDCF
 			    && !csr_is11e_supported(mac_ctx))
-				qosType = eCSR_MEDIUM_ACCESS_DCF;
+				qosType = MEDIUM_ACCESS_DCF;
 		}
 
 	} while (0);

+ 0 - 6
core/sme/src/qos/sme_qos.c

@@ -6087,12 +6087,6 @@ sme_qos_is_acm(struct mac_context *mac, struct bss_description *pSirBssDesc,
 	bool ret_val = false;
 	tDot11fBeaconIEs *pIesLocal;
 
-	if (!pSirBssDesc) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			  "%s: %d: pSirBssDesc is NULL", __func__, __LINE__);
-		return false;
-	}
-
 	if (pIes)
 		/* IEs were provided so use them locally */
 		pIesLocal = pIes;