Sfoglia il codice sorgente

qcacld-3.0: Use ROAM_11KV_CTRL cmd to enable/disable FW roaming

Use ROAM_11KV_CTRL WMI vdev command to enable/disable the roaming
functionality in FW.

Change-Id: If3bb344ec7058d4149d0064975d7c91f213fd105
CRs-Fixed: 2727671
Kiran Kumar Lokere 4 anni fa
parent
commit
09d979b3d1

+ 2 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1340,6 +1340,7 @@ enum station_keepalive_method {
  * @force_rsne_override:            Force rsnie override from user
  * @single_tid:                     Set replay counter for all TID
  * @allow_tpc_from_ap:              Support for AP power constraint
+ * @usr_disabled_roaming:           User config for roaming disable
  */
 struct wlan_mlme_sta_cfg {
 	uint32_t sta_keep_alive_period;
@@ -1359,6 +1360,7 @@ struct wlan_mlme_sta_cfg {
 	bool single_tid;
 	bool allow_tpc_from_ap;
 	enum station_keepalive_method sta_keepalive_method;
+	bool usr_disabled_roaming;
 };
 
 /**

+ 10 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h

@@ -486,6 +486,16 @@ struct wlan_roam_11k_offload_params {
 	struct wlan_roam_neighbor_report_params neighbor_report_params;
 };
 
+/**
+ * struct roam_disable_cfg - Firmware roam module disable parameters
+ * @vdev_id: vdev for which the roaming has to be enabled/disabled
+ * @cfg:  Config to enable/disable FW roam module
+ */
+struct roam_disable_cfg {
+	uint8_t vdev_id;
+	uint8_t cfg;
+};
+
 /**
  * struct wlan_roam_disconnect_params - Emergency deauth/disconnect roam params
  * @vdev_id: VDEV on which the parameters should be applied

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

@@ -246,7 +246,8 @@ enum eWniMsgTypes {
 	eWNI_SME_MONITOR_MODE_VDEV_UP = SIR_SME_MSG_TYPES_BEGIN + 161,
 	eWNI_SME_UPDATE_SESSION_EDCA_TXQ_PARAMS = SIR_SME_MSG_TYPES_BEGIN + 162,
 	eWNI_SME_ROAM_SEND_SET_PCL_REQ = SIR_SME_MSG_TYPES_BEGIN + 163,
-	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 164
+	eWNI_SME_ROAM_DISABLE_CFG = SIR_SME_MSG_TYPES_BEGIN + 164,
+	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 165
 };
 
 typedef struct sAniCfgTxRateCtrs {

+ 2 - 1
core/mac/src/include/sir_params.h

@@ -594,9 +594,10 @@ struct sir_cfg_action_frm_tb_ppdu {
 #ifndef ROAM_OFFLOAD_V1
 #define SIR_HAL_INIT_ROAM_OFFLOAD_PARAM     (SIR_HAL_ITC_MSG_TYPES_BEGIN + 380)
 #endif
+#define SIR_HAL_INIT_ROAM_DISABLE_CFG       (SIR_HAL_ITC_MSG_TYPES_BEGIN + 381)
 
 /*
- * Unused SIR_HAL_ITC_MSG_TYPES_BEGIN + 381 to
+ * Unused SIR_HAL_ITC_MSG_TYPES_BEGIN + 382 to
  * SIR_HAL_ITC_MSG_TYPES_BEGIN + 386
  */
 #define SIR_HAL_GET_PEER_INFO_EXT           (SIR_HAL_ITC_MSG_TYPES_BEGIN + 387)

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

@@ -1764,6 +1764,7 @@ static void lim_process_messages(struct mac_context *mac_ctx,
 	case eWNI_SME_ROAM_SEND_SET_PCL_REQ:
 #ifndef ROAM_OFFLOAD_V1
 	case eWNI_SME_ROAM_INIT_PARAM:
+	case eWNI_SME_ROAM_DISABLE_CFG:
 	case eWNI_SME_ROAM_SEND_PER_REQ:
 #endif
 	case eWNI_SME_SET_ADDBA_ACCEPT:

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

@@ -3513,6 +3513,22 @@ static void lim_send_roam_offload_init(struct mac_context *mac_ctx,
 	}
 }
 
+static void lim_send_roam_disable_cfg(struct mac_context *mac_ctx,
+				      uint32_t *msg_buf)
+{
+	struct scheduler_msg wma_msg = {0};
+	QDF_STATUS status;
+
+	wma_msg.type = WMA_ROAM_DISABLE_CFG;
+	wma_msg.bodyptr = msg_buf;
+
+	status = wma_post_ctrl_msg(mac_ctx, &wma_msg);
+	if (QDF_STATUS_SUCCESS != status) {
+		pe_err("Posting WMA_ROAM_DISABLE_CFG failed");
+		qdf_mem_free(msg_buf);
+	}
+}
+
 /**
  * lim_send_roam_per_command() - Process roam send PER command from csr
  * @mac_ctx: Pointer to Global MAC structure
@@ -3572,6 +3588,11 @@ static void lim_send_roam_per_command(struct mac_context *mac_ctx,
 {
 	qdf_mem_free(msg_buf);
 }
+static void lim_send_roam_disable_cfg(struct mac_context *mac_ctx,
+				      uint32_t *msg_buf)
+{
+	qdf_mem_free(msg_buf);
+}
 #endif
 static inline void lim_send_roam_set_pcl(struct mac_context *mac_ctx,
 					 struct set_pcl_req *msg_buf)
@@ -4656,6 +4677,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_DISABLE_CFG:
+		lim_send_roam_disable_cfg(mac, msg_buf);
+		bufConsumed = false;
+		break;
 	case eWNI_SME_ROAM_SEND_PER_REQ:
 		lim_send_roam_per_command(mac, msg_buf);
 		bufConsumed = false;

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

@@ -1415,6 +1415,17 @@ QDF_STATUS
 csr_send_roam_offload_init_msg(struct mac_context *mac, uint32_t vdev_id,
 			       bool enable);
 
+/**
+ * csr_send_roam_disable_cfg_msg() - Send roam module enable/disable cfg to fw
+ * @mac: mac context
+ * @vdev_id: vdev id
+ * @cfg: roaming enable/disable cfg
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS csr_send_roam_disable_cfg_msg(struct mac_context *mac,
+					 uint32_t vdev_id, uint8_t cfg);
+
 typedef void (*csr_ani_callback)(int8_t *ani, void *context);
 
 #ifdef WLAN_FEATURE_11W

+ 19 - 0
core/sme/src/common/sme_api.c

@@ -6230,6 +6230,8 @@ QDF_STATUS sme_config_fast_roaming(mac_handle_t mac_handle, uint8_t session_id,
 	enum roam_offload_state state;
 	QDF_STATUS status;
 	bool supplicant_disabled_roaming;
+	uint32_t set_val = 0;
+	enum roam_offload_state  cur_state;
 
 	/*
 	 * supplicant_disabled_roaming flag is altered when supplicant sends
@@ -6247,6 +6249,20 @@ QDF_STATUS sme_config_fast_roaming(mac_handle_t mac_handle, uint8_t session_id,
 			return QDF_STATUS_SUCCESS;
 		return  QDF_STATUS_E_FAILURE;
 	}
+	cur_state = mlme_get_roam_state(mac_ctx->psoc, session_id);
+	if (cur_state == WLAN_ROAM_INIT) {
+		if (!is_fast_roam_enabled)
+			set_val =
+			WMI_VDEV_ROAM_11KV_CTRL_DISABLE_FW_TRIGGER_ROAMING;
+		status = csr_send_roam_disable_cfg_msg(mac_ctx, session_id,
+						       set_val);
+
+		if (!QDF_IS_STATUS_SUCCESS(status)) {
+			sme_err("ROAM: update fast roaming failed, status: %d",
+				status);
+		}
+	}
+	mac_ctx->mlme_cfg->sta.usr_disabled_roaming = !is_fast_roam_enabled;
 
 	supplicant_disabled_roaming =
 		mlme_get_supplicant_disabled_roaming(mac_ctx->psoc,
@@ -14108,6 +14124,7 @@ QDF_STATUS sme_fast_reassoc(mac_handle_t mac_handle,
 	if (QDF_IS_STATUS_ERROR(sme_acquire_global_lock(&mac->sme)))
 		return QDF_STATUS_E_FAILURE;
 
+	mlme_set_supplicant_disabled_roaming(mac->psoc, vdev_id, 0);
 	status = csr_fast_reassoc(mac_handle, profile, bssid, ch_freq, vdev_id,
 				  connected_bssid);
 
@@ -15265,6 +15282,8 @@ void sme_set_he_testbed_def(mac_handle_t mac_handle, uint8_t vdev_id)
 	if (QDF_IS_STATUS_ERROR(status))
 		sme_err("Failed to set enable bcast probe resp in FW, %d",
 			status);
+
+	mac_ctx->mlme_cfg->sta.usr_disabled_roaming = true;
 }
 
 void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)

+ 34 - 0
core/sme/src/csr/csr_api_roam.c

@@ -18675,6 +18675,14 @@ csr_roam_switch_to_init(struct mac_context *mac, uint8_t vdev_id,
 
 	/* Set PCL before sending RSO start */
 	policy_mgr_set_pcl_for_existing_combo(mac->psoc, PM_STA_MODE, vdev_id);
+	if (mac->mlme_cfg->sta.usr_disabled_roaming) {
+		status = csr_send_roam_disable_cfg_msg(mac, vdev_id,
+			WMI_VDEV_ROAM_11KV_CTRL_DISABLE_FW_TRIGGER_ROAMING);
+
+		if (!QDF_IS_STATUS_SUCCESS(status))
+			sme_err("ROAM: fast roaming disable failed. status %d",
+				status);
+	}
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -22367,6 +22375,32 @@ csr_send_roam_offload_init_msg(struct mac_context *mac, uint32_t vdev_id,
 }
 #endif
 
+QDF_STATUS csr_send_roam_disable_cfg_msg(struct mac_context *mac,
+					 uint32_t vdev_id, uint8_t cfg)
+{
+	struct scheduler_msg message = {0};
+	QDF_STATUS status;
+	struct roam_disable_cfg *params;
+
+	params = qdf_mem_malloc(sizeof(*params));
+	if (!params)
+		return QDF_STATUS_E_NOMEM;
+
+	params->vdev_id = vdev_id;
+	params->cfg = cfg;
+
+	message.bodyptr = params;
+	message.type = eWNI_SME_ROAM_DISABLE_CFG;
+	status = scheduler_post_message(QDF_MODULE_ID_SME, QDF_MODULE_ID_PE,
+					QDF_MODULE_ID_PE, &message);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		sme_err("ROAM: Failed to post ROAM_DISABLE_CFG msg");
+		qdf_mem_free(params);
+	}
+
+	return status;
+}
+
 QDF_STATUS
 csr_roam_update_cfg(struct mac_context *mac, uint8_t vdev_id, uint8_t reason)
 {

+ 9 - 0
core/wma/inc/wma_api.h

@@ -828,6 +828,15 @@ int wma_wlm_stats_rsp(void *wma_ctx, uint8_t *event, uint32_t len);
 void wma_update_roam_offload_flag(void *handle,
 				  struct roam_init_params *params);
 #endif
+/**
+ * wma_set_roam_disable_cfg() - Set roam module disable cfg to fw
+ * @wma: wma handle
+ * @params: Roaming module enable/disable params
+ *
+ * Return: none
+ */
+void wma_set_roam_disable_cfg(void *handle, struct roam_disable_cfg *params);
+
 /**
  * wma_self_peer_create() - create self peer in objmgr
  * @vdev_mlme: vdev mlme component private object

+ 1 - 0
core/wma/inc/wma_types.h

@@ -440,6 +440,7 @@
 #endif
 
 #define WMA_DATA_STALL_TRIGGER 6
+#define WMA_ROAM_DISABLE_CFG                 SIR_HAL_INIT_ROAM_DISABLE_CFG
 
 /* Bit 6 will be used to control BD rate for Management frames */
 #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40

+ 4 - 0
core/wma/src/wma_main.c

@@ -8977,6 +8977,10 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 		qdf_mem_free(msg->bodyptr);
 		break;
 #endif
+	case WMA_ROAM_DISABLE_CFG:
+		wma_set_roam_disable_cfg(wma_handle, msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
+		break;
 	case WMA_ROAM_SCAN_CH_REQ:
 		wma_get_roam_scan_ch(wma_handle->wmi_handle, msg->bodyval);
 		break;

+ 25 - 0
core/wma/src/wma_utils.c

@@ -4097,6 +4097,31 @@ void wma_update_roam_offload_flag(void *handle,
 }
 #endif
 
+void wma_set_roam_disable_cfg(void *handle, struct roam_disable_cfg *params)
+{
+	tp_wma_handle wma = handle;
+	struct wma_txrx_node *iface;
+	QDF_STATUS status;
+
+	if (!wma_is_vdev_valid(params->vdev_id)) {
+		wma_err("vdev_id: %d is not active", params->vdev_id);
+		return;
+	}
+
+	iface = &wma->interfaces[params->vdev_id];
+
+	if ((iface->type != WMI_VDEV_TYPE_STA) ||
+	    (iface->sub_type != 0)) {
+		wma_err("this isn't a STA: %d", params->vdev_id);
+		return;
+	}
+
+	status = wma_vdev_set_param(wma->wmi_handle, params->vdev_id,
+				    WMI_VDEV_PARAM_ROAM_11KV_CTRL, params->cfg);
+	if (QDF_IS_STATUS_ERROR(status))
+		wma_err("Failed to set WMI_VDEV_PARAM_ROAM_11KV_CTRL");
+}
+
 QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;