Jelajahi Sumber

qcacld-3.0: Send PER config command before WMI_ROAM_SCAN_MODE command

The host driver sends WMI_ROAM_PER_CONFIG_CMDID command after
WMI_ROAM_SCAN_MODE as part of RSO start/update. But the
expectation from firmware is that host should send this after
WMI_VDEV_PARAM_ROAM_FW_OFFLOAD but before WMI_ROAM_SCAN_MODE.
Also the WMI_VDEV_PARAM_ROAM_FW_OFFLOAD is sent after set key
response from csr->lim->wma->wmi. But the
WMI_ROAM_PER_CONFIG_CMDID is directly posted wma (csr->wma->wmi)
which can cause this command to go before the
WMI_VDEV_PARAM_ROAM_FW_OFFLOAD is sent to firmware.
One more instance where the WMI_ROAM_PER_CONFIG_CMDID can go
before vdev roam fw offload init is if the userspace sends
blacklist update command before offload init happens.

So route the WMI_ROAM_PER_CONFIG_CMDID via lim before posting
it to wma and add changes in rso update config to block the
blacklist command being sent in ROAM_DEINIT state.
Also Call csr_roam_offload_per_scan before csr_roam_send_rso_cmd
in csr_roam_offload_scan to send WMI_ROAM_PER_CONFIG_CMDID before
WMI_ROAM_SCAN_MODE.

Change-Id: I2600cfeafcc3e3ebfac6694c1f2cdb5df0366411
CRs-Fixed: 2596257
Pragaspathi Thilagaraj 5 tahun lalu
induk
melakukan
9cece7211d

+ 3 - 2
core/mac/inc/wni_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 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,7 +244,8 @@ enum eWniMsgTypes {
 	eWNI_SME_VDEV_DELETE_REQ = SIR_SME_MSG_TYPES_BEGIN + 157,
 	eWNI_SME_VDEV_DELETE_RSP = SIR_SME_MSG_TYPES_BEGIN + 158,
 	eWNI_SME_ROAM_INIT_PARAM = SIR_SME_MSG_TYPES_BEGIN + 159,
-	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 160
+	eWNI_SME_ROAM_SEND_PER_REQ = SIR_SME_MSG_TYPES_BEGIN + 160,
+	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 161
 };
 
 typedef struct sAniCfgTxRateCtrs {

+ 2 - 1
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2020 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
@@ -1747,6 +1747,7 @@ static void lim_process_messages(struct mac_context *mac_ctx,
 		/* fall through */
 	case eWNI_SME_ROAM_SCAN_OFFLOAD_REQ:
 	case eWNI_SME_ROAM_INIT_PARAM:
+	case eWNI_SME_ROAM_SEND_PER_REQ:
 	case eWNI_SME_SET_ADDBA_ACCEPT:
 	case eWNI_SME_UPDATE_EDCA_PROFILE:
 	case WNI_SME_UPDATE_MU_EDCA_PARAMS:

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

@@ -3719,12 +3719,41 @@ static void lim_send_roam_offload_init(struct mac_context *mac_ctx,
 		qdf_mem_free(msg_buf);
 	}
 }
+
+/**
+ * lim_send_roam_per_command() - Process roam send PER command from csr
+ * @mac_ctx: Pointer to Global MAC structure
+ * @msg_buf: Pointer to SME message buffer
+ *
+ * Return: None
+ */
+static void lim_send_roam_per_command(struct mac_context *mac_ctx,
+				      uint32_t *msg_buf)
+{
+	struct scheduler_msg wma_msg = {0};
+	QDF_STATUS status;
+
+	wma_msg.type = WMA_SET_PER_ROAM_CONFIG_CMD;
+	wma_msg.bodyptr = msg_buf;
+
+	status = wma_post_ctrl_msg(mac_ctx, &wma_msg);
+	if (QDF_STATUS_SUCCESS != status) {
+		pe_err("Posting WMA_ROAM_INIT_PARAM failed");
+		qdf_mem_free(msg_buf);
+	}
+}
 #else
 static void lim_send_roam_offload_init(struct mac_context *mac_ctx,
 				       uint32_t *msg_buf)
 {
 	qdf_mem_free(msg_buf);
 }
+
+static void lim_send_roam_per_command(struct mac_context *mac_ctx,
+				      uint32_t *msg_buf)
+{
+	qdf_mem_free(msg_buf);
+}
 #endif
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
@@ -4804,6 +4833,10 @@ bool lim_process_sme_req_messages(struct mac_context *mac,
 		lim_send_roam_offload_init(mac, msg_buf);
 		bufConsumed = false;
 		break;
+	case eWNI_SME_ROAM_SEND_PER_REQ:
+		lim_send_roam_per_command(mac, msg_buf);
+		bufConsumed = false;
+		break;
 	case eWNI_SME_ROAM_INVOKE:
 		lim_process_roam_invoke(mac, msg_buf);
 		bufConsumed = false;

+ 16 - 27
core/sme/src/csr/csr_api_roam.c

@@ -19195,40 +19195,26 @@ csr_create_per_roam_request(struct mac_context *mac_ctx,
 static QDF_STATUS
 csr_roam_offload_per_scan(struct mac_context *mac_ctx, uint8_t session_id)
 {
-	tpCsrNeighborRoamControlInfo roam_info =
-		&mac_ctx->roam.neighborRoamInfo[session_id];
 	struct wmi_per_roam_config_req *req_buf;
 	struct scheduler_msg msg = {0};
-
-	/*
-	 * No need to update in case of stop command, FW takes care of stopping
-	 * this internally
-	 */
-	if (roam_info->last_sent_cmd == ROAM_SCAN_OFFLOAD_STOP)
-		return QDF_STATUS_SUCCESS;
+	QDF_STATUS status;
 
 	if (!mac_ctx->mlme_cfg->lfr.per_roam_enable) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-			 "PER based roaming is disabled in configuration");
+		sme_debug("PER based roaming ini is disabled");
 		return QDF_STATUS_SUCCESS;
 	}
 
 	req_buf = csr_create_per_roam_request(mac_ctx, session_id);
-	if (!req_buf) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			 "Failed to create req packet");
+	if (!req_buf)
 		return QDF_STATUS_E_FAILURE;
-	}
-	msg.type = WMA_SET_PER_ROAM_CONFIG_CMD;
+
+	msg.type = eWNI_SME_ROAM_SEND_PER_REQ;
 	msg.reserved = 0;
 	msg.bodyptr = req_buf;
-	if (!QDF_IS_STATUS_SUCCESS(scheduler_post_message(QDF_MODULE_ID_SME,
-							  QDF_MODULE_ID_WMA,
-							  QDF_MODULE_ID_WMA,
-							  &msg))) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-			"%s: Unable to post WMA_SET_PER_ROAM_CONFIG_CMD to WMA",
-			__func__);
+	status = scheduler_post_message(QDF_MODULE_ID_SME, QDF_MODULE_ID_PE,
+					QDF_MODULE_ID_PE, &msg);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		sme_debug("Unable to post WMA_SET_PER_ROAM_CONFIG_CMD to WMA");
 		qdf_mem_free(req_buf);
 	}
 	return QDF_STATUS_SUCCESS;
@@ -20089,6 +20075,12 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
 	prev_roaming_state = mlme_get_roam_state(mac_ctx->psoc, session_id);
 	policy_mgr_set_pcl_for_existing_combo(mac_ctx->psoc, PM_STA_MODE);
 
+	/* Update PER config to FW. No need to update in case of stop command,
+	 * FW takes care of stopping this internally
+	 */
+	if (command != ROAM_SCAN_OFFLOAD_STOP)
+		csr_roam_offload_per_scan(mac_ctx, session_id);
+
 	if (!QDF_IS_STATUS_SUCCESS(
 		csr_roam_send_rso_cmd(mac_ctx, session_id, req_buf))) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
@@ -20103,8 +20095,6 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
 	/* update the last sent cmd */
 	roam_info->last_sent_cmd = command;
 
-	/* Update PER config to FW after sending the command */
-	csr_roam_offload_per_scan(mac_ctx, session_id);
 	return status;
 }
 
@@ -22254,8 +22244,7 @@ csr_send_roam_offload_init_msg(struct mac_context *mac, uint32_t vdev_id,
 QDF_STATUS
 csr_roam_update_cfg(struct mac_context *mac, uint8_t vdev_id, uint8_t reason)
 {
-	if (!MLME_IS_ROAM_INITIALIZED(mac->psoc, vdev_id) &&
-	    reason != REASON_ROAM_SET_BLACKLIST_BSSID) {
+	if (!MLME_IS_ROAM_INITIALIZED(mac->psoc, vdev_id)) {
 		sme_err("Update cfg received in roam uninitialized state");
 		return QDF_STATUS_E_INVAL;
 	}