Browse Source

qcacld-3.0: Update T2LM direction if T2LM IE is present

Currently, if T2LM IE is not present in the beacon, probe
or assoc resp frame still host is updating established_t2lm
T2LM info 0. Updating the T2LM info as 0 leads to incorrect
info after T2LM teardown.

To fix this, update the T2LM info if T2LM IE is present in
beacon, probe or assoc resp frame.

Change-Id: If3f4f9b1ee4296a0dca5f85833944fbe28df5d5e
CRs-Fixed: 3541848
Deeksha Gupta 1 year ago
parent
commit
0837347372
1 changed files with 15 additions and 13 deletions
  1. 15 13
      core/mac/src/sys/legacy/src/utils/src/parser_api.c

+ 15 - 13
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -2915,6 +2915,11 @@ sir_convert_probe_frame2_t2lm_struct(tDot11fProbeResponse *pr,
 	struct wlan_t2lm_info t2lm;
 	uint8_t i;
 
+	if (!pr->num_t2lm_ie) {
+		pe_debug("T2LM IEs not present");
+		return status;
+	}
+
 	t2lm_ctx = &bcn_struct->t2lm_ctx;
 	qdf_mem_zero(&t2lm_ctx->established_t2lm.t2lm,
 		     sizeof(struct wlan_t2lm_info));
@@ -2924,11 +2929,6 @@ sir_convert_probe_frame2_t2lm_struct(tDot11fProbeResponse *pr,
 		     sizeof(struct wlan_t2lm_info));
 	t2lm_ctx->upcoming_t2lm.t2lm.direction = WLAN_T2LM_INVALID_DIRECTION;
 
-	if (!pr->num_t2lm_ie) {
-		pe_debug("T2LM IEs not present");
-		return status;
-	}
-
 	pe_debug("Number of T2LM IEs in probe rsp %d", pr->num_t2lm_ie);
 	for (i = 0; i < pr->num_t2lm_ie; i++) {
 		qdf_mem_zero(&ie[0], DOT11F_IE_T2LM_IE_MAX_LEN + 3);
@@ -3862,6 +3862,11 @@ sir_convert_assoc_resp_frame2_t2lm_struct(struct mac_context *mac,
 	struct wlan_t2lm_info t2lm;
 	uint8_t i;
 
+	if (!ar->num_t2lm_ie) {
+		pe_debug("T2LM IEs not present");
+		return status;
+	}
+
 	t2lm_ctx = &p_assoc_rsp->t2lm_ctx;
 	qdf_mem_zero(&t2lm_ctx->established_t2lm.t2lm,
 		     sizeof(struct wlan_t2lm_info));
@@ -3871,11 +3876,6 @@ sir_convert_assoc_resp_frame2_t2lm_struct(struct mac_context *mac,
 		     sizeof(struct wlan_t2lm_info));
 	t2lm_ctx->upcoming_t2lm.t2lm.direction = WLAN_T2LM_INVALID_DIRECTION;
 
-	if (!ar->num_t2lm_ie) {
-		pe_debug("T2LM IEs not present");
-		return status;
-	}
-
 	pe_debug("Number of T2LM IEs in assoc resp %d", ar->num_t2lm_ie);
 	for (i = 0; i < ar->num_t2lm_ie; i++) {
 		qdf_mem_zero(&ie[0], DOT11F_IE_T2LM_IE_MAX_LEN + 3);
@@ -5187,6 +5187,11 @@ sir_convert_beacon_frame2_t2lm_struct(tDot11fBeacon *bcn_frm,
 	struct wlan_t2lm_info t2lm;
 	uint8_t i;
 
+	if (!bcn_frm->num_t2lm_ie) {
+		pe_debug("T2LM IEs not present");
+		return status;
+	}
+
 	t2lm_ctx = &bcn_struct->t2lm_ctx;
 	qdf_mem_zero(&t2lm_ctx->established_t2lm.t2lm,
 		     sizeof(struct wlan_t2lm_info));
@@ -5196,9 +5201,6 @@ sir_convert_beacon_frame2_t2lm_struct(tDot11fBeacon *bcn_frm,
 		     sizeof(struct wlan_t2lm_info));
 	t2lm_ctx->upcoming_t2lm.t2lm.direction = WLAN_T2LM_INVALID_DIRECTION;
 
-	if (!bcn_frm->num_t2lm_ie)
-		return status;
-
 	pe_debug("Number of T2LM IEs in beacon %d", bcn_frm->num_t2lm_ie);
 	for (i = 0; i < bcn_frm->num_t2lm_ie; i++) {
 		qdf_mem_zero(&ie[0], DOT11F_IE_T2LM_IE_MAX_LEN + 3);