Browse Source

qcacld-3.0: Add check for NDI role in __lim_fresh_scan_reqd

This is qcacld-2.0 to qcacld-3.0 propagation

Add NDI role check in __lim_fresh_scan_reqd to allow request for fresh scan.

Change-Id: Icea6228c6491d8b7d0588a699fe7f16d0dd0d3f1
CRs-Fixed: 1030380
Naveen Rawat 8 years ago
parent
commit
b6a951a21d
1 changed files with 33 additions and 21 deletions
  1. 33 21
      core/mac/src/pe/lim/lim_process_sme_req_messages.c

+ 33 - 21
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -360,32 +360,44 @@ __lim_fresh_scan_reqd(tpAniSirGlobal mac_ctx, uint8_t return_fresh_results)
 	}
 
 	for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
+
+		if (mac_ctx->lim.gpSession[i].valid == false)
+			continue;
+
 		lim_log(mac_ctx, LOG1,
 			FL("session %d, bsstype %d, limSystemRole %d, limSmeState %d"),
 			i, mac_ctx->lim.gpSession[i].bssType,
 			mac_ctx->lim.gpSession[i].limSystemRole,
 			mac_ctx->lim.gpSession[i].limSmeState);
-		if (mac_ctx->lim.gpSession[i].valid == true) {
-			if (!((((mac_ctx->lim.gpSession[i].bssType ==
-					eSIR_INFRASTRUCTURE_MODE)) &&
-				(mac_ctx->lim.gpSession[i].limSmeState ==
-					eLIM_SME_LINK_EST_STATE)) ||
-			      (((mac_ctx->lim.gpSession[i].bssType ==
-					eSIR_IBSS_MODE)) &&
-			       (mac_ctx->lim.gpSession[i].limSmeState ==
-					eLIM_SME_NORMAL_STATE)) ||
-			      ((((mac_ctx->lim.gpSession[i].bssType ==
-					eSIR_INFRA_AP_MODE) &&
-				(mac_ctx->lim.gpSession[i].pePersona ==
-					QDF_P2P_GO_MODE)) ||
-			      (mac_ctx->lim.gpSession[i].limSystemRole ==
-					eLIM_AP_ROLE)) &&
-			      (mac_ctx->lim.gpSession[i].limSmeState ==
-					eLIM_SME_NORMAL_STATE)))) {
-				valid_state = false;
-				break;
-			}
-		}
+
+		if (mac_ctx->lim.gpSession[i].bssType == eSIR_NDI_MODE)
+			continue;
+
+		if (mac_ctx->lim.gpSession[i].bssType ==
+				eSIR_INFRASTRUCTURE_MODE &&
+				mac_ctx->lim.gpSession[i].limSmeState ==
+				eLIM_SME_LINK_EST_STATE)
+			continue;
+
+		if (mac_ctx->lim.gpSession[i].bssType == eSIR_IBSS_MODE &&
+				mac_ctx->lim.gpSession[i].limSmeState ==
+				eLIM_SME_NORMAL_STATE)
+			continue;
+
+		if (mac_ctx->lim.gpSession[i].bssType == eSIR_INFRA_AP_MODE &&
+				mac_ctx->lim.gpSession[i].pePersona ==
+				QDF_P2P_GO_MODE &&
+				mac_ctx->lim.gpSession[i].limSmeState ==
+				eLIM_SME_NORMAL_STATE)
+			continue;
+
+		if (mac_ctx->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE &&
+				mac_ctx->lim.gpSession[i].limSmeState ==
+				eLIM_SME_NORMAL_STATE)
+			continue;
+
+		valid_state = false;
+		break;
 	}
 
 	lim_log(mac_ctx, LOG1, FL("valid_state: %d"), valid_state);