Переглянути джерело

qcacld-3.0: Fix missing connection info update after hw mode change

Ensure that the vdev to mac mapping, tx and rx spatial stream
parameters are updated in the connection info table as part of set
hardware mode change response for all the possible scenarios.
Currently these parameters are not getting updated during hidden
ssid and channel switch connection update. Due to this the
connection info table is not reflecting the correct spatial streams
for the above mentioned scenarios, after hw mode change.

Change-Id: I42bbb40a6c99b68aa2038d3e5357580e616c76c9
CRs-Fixed: 996090
Chandrasekaran, Manishekar 9 роки тому
батько
коміт
4dd215edaf
1 змінених файлів з 76 додано та 69 видалено
  1. 76 69
      core/sme/src/common/sme_api.c

+ 76 - 69
core/sme/src/common/sme_api.c

@@ -192,86 +192,93 @@ static QDF_STATUS sme_process_set_hw_mode_resp(tpAniSirGlobal mac, uint8_t *msg)
 		command->u.set_hw_mode_cmd.reason,
 		command->u.set_hw_mode_cmd.session_id);
 
-	if (callback) {
-		if (!param) {
-			sms_log(mac, LOGE,
-			    FL("Callback failed since HW mode params is NULL"));
-		} else if (reason == SIR_UPDATE_REASON_HIDDEN_STA) {
-			/* In the case of hidden SSID, connection update
-			 * (set hw mode) is done after the scan with reason
-			 * code eCsrScanForSsid completes. The connect/failure
-			 * needs to be handled after the response of set hw
-			 * mode
-			 */
-			saved_cmd = (tSmeCmd *)mac->sme.saved_scan_cmd;
-			if (!saved_cmd) {
-				sms_log(mac, LOGP,
+	if (!callback) {
+		sms_log(mac, LOGE, FL("Callback does not exist"));
+		goto end;
+	}
+
+	if (!param) {
+		sms_log(mac, LOGE,
+			FL("Callback failed since HW mode params is NULL"));
+		goto end;
+	}
+
+	/* Irrespective of the reason for which the hw mode change request
+	 * was issued, the policy manager connection table needs to be updated
+	 * with the new vdev-mac id mapping, tx/rx spatial streams etc., if the
+	 * set hw mode was successful.
+	 */
+	callback(param->status,
+			param->cfgd_hw_mode_index,
+			param->num_vdev_mac_entries,
+			param->vdev_mac_map);
+
+	if (reason == SIR_UPDATE_REASON_HIDDEN_STA) {
+		/* In the case of hidden SSID, connection update
+		 * (set hw mode) is done after the scan with reason
+		 * code eCsrScanForSsid completes. The connect/failure
+		 * needs to be handled after the response of set hw
+		 * mode
+		 */
+		saved_cmd = (tSmeCmd *)mac->sme.saved_scan_cmd;
+		if (!saved_cmd) {
+			sms_log(mac, LOGP,
 					FL("saved cmd is NULL, Check this"));
-				goto end;
-			}
-			if (param->status == SET_HW_MODE_STATUS_OK) {
-				sms_log(mac, LOG1,
+			goto end;
+		}
+		if (param->status == SET_HW_MODE_STATUS_OK) {
+			sms_log(mac, LOG1,
 					FL("search for ssid success"));
-				csr_scan_handle_search_for_ssid(mac,
+			csr_scan_handle_search_for_ssid(mac,
 					saved_cmd);
-			} else {
-				sms_log(mac, LOG1,
+		} else {
+			sms_log(mac, LOG1,
 					FL("search for ssid failure"));
-				csr_scan_handle_search_for_ssid_failure(mac,
+			csr_scan_handle_search_for_ssid_failure(mac,
 					saved_cmd);
-			}
-			if (saved_cmd->u.roamCmd.pRoamBssEntry)
-				qdf_mem_free(
+		}
+		if (saved_cmd->u.roamCmd.pRoamBssEntry)
+			qdf_mem_free(
 					saved_cmd->u.roamCmd.pRoamBssEntry);
-			if (saved_cmd->u.scanCmd.u.scanRequest.SSIDs.SSIDList)
-				qdf_mem_free(saved_cmd->u.scanCmd.u.
-						scanRequest.SSIDs.SSIDList);
-			if (saved_cmd->u.scanCmd.pToRoamProfile)
-				qdf_mem_free(saved_cmd->u.scanCmd.
-						pToRoamProfile);
-			if (saved_cmd) {
-				qdf_mem_free(saved_cmd);
-				saved_cmd = NULL;
-				mac->sme.saved_scan_cmd = NULL;
-			}
-		} else if (reason == SIR_UPDATE_REASON_CHANNEL_SWITCH) {
-			csr_roam_call_callback(mac,
-					command->u.set_hw_mode_cmd.session_id,
-					&roam_info, 0,
-					eCSR_ROAM_STATUS_UPDATE_HW_MODE,
-					eCSR_ROAM_RESULT_UPDATE_HW_MODE);
-		} else if (reason == SIR_UPDATE_REASON_CHANNEL_SWITCH_STA) {
-			struct sir_saved_csa_params *msg;
-
-			sms_log(mac, LOG1, FL("process channel switch sta"));
-			msg = qdf_mem_malloc(sizeof(*msg));
-			if (!msg) {
-				sms_log(mac, LOGE,
+		if (saved_cmd->u.scanCmd.u.scanRequest.SSIDs.SSIDList)
+			qdf_mem_free(saved_cmd->u.scanCmd.u.
+					scanRequest.SSIDs.SSIDList);
+		if (saved_cmd->u.scanCmd.pToRoamProfile)
+			qdf_mem_free(saved_cmd->u.scanCmd.
+					pToRoamProfile);
+		if (saved_cmd) {
+			qdf_mem_free(saved_cmd);
+			saved_cmd = NULL;
+			mac->sme.saved_scan_cmd = NULL;
+		}
+	} else if (reason == SIR_UPDATE_REASON_CHANNEL_SWITCH) {
+		csr_roam_call_callback(mac,
+				command->u.set_hw_mode_cmd.session_id,
+				&roam_info, 0,
+				eCSR_ROAM_STATUS_UPDATE_HW_MODE,
+				eCSR_ROAM_RESULT_UPDATE_HW_MODE);
+	} else if (reason == SIR_UPDATE_REASON_CHANNEL_SWITCH_STA) {
+		struct sir_saved_csa_params *msg;
+
+		sms_log(mac, LOG1, FL("process channel switch sta"));
+		msg = qdf_mem_malloc(sizeof(*msg));
+		if (!msg) {
+			sms_log(mac, LOGE,
 					FL("memory alloc fail for csa "));
-				goto end;
-			}
+			goto end;
+		}
 
-			msg->message_type = SIR_LIM_CSA_POST_HW_MODE_CHANGE;
-			msg->length = sizeof(*msg);
-			msg->session_id = command->u.set_hw_mode_cmd.session_id;
+		msg->message_type = SIR_LIM_CSA_POST_HW_MODE_CHANGE;
+		msg->length = sizeof(*msg);
+		msg->session_id = command->u.set_hw_mode_cmd.session_id;
 
-			status = cds_send_mb_message_to_mac(msg);
-			if (!QDF_IS_STATUS_SUCCESS(status))
-				sms_log(mac, LOGE,
+		status = cds_send_mb_message_to_mac(msg);
+		if (!QDF_IS_STATUS_SUCCESS(status))
+			sms_log(mac, LOGE,
 					FL("failed to process csa params"));
-			else
-				sms_log(mac, LOG1,
+		else
+			sms_log(mac, LOG1,
 					FL("csa after hw mode change"));
-		} else {
-			sms_log(mac, LOGE,
-			      FL("Calling HDD callback for HW mode response"));
-			callback(param->status,
-				 param->cfgd_hw_mode_index,
-				 param->num_vdev_mac_entries,
-				 param->vdev_mac_map);
-		}
-	} else {
-		sms_log(mac, LOGE, FL("Callback does not exist"));
 	}
 
 end: