qcacld-3.0: Avoid race when uplayer triggers reassoc
When supplicant tries to reassoc AP, it will set PSK
before issue connection. In driver, it invokes function
__wlan_hdd_cfg80211_keymgmt_set_key and then
__wlan_hdd_cfg80211_connect.
__wlan_hdd_cfg80211_keymgmt_set_key puts
eWNI_SME_ROAM_SCAN_OFFLOAD_REQ to PE queue, then puts
WMA_ROAM_SCAN_OFFLOAD_REQ to WMA queue.
__wlan_hdd_cfg80211_connect puts SIR_HAL_ROAM_INVOKE to
WMA queue directly.
If the command SIR_HAL_ROAM_INVOKE is issued to fw before
WMA_ROAM_SCAN_OFFLOAD_REQ, then roaming scan is canceled
because scan mode is set.
To avoid this race, send SIR_HAL_ROAM_INVOKE to PE queue,
and then to WMA queue as well.
Change-Id: I08624efc466085e49fa4201deb221276ec5c260f
Rs-Fixed: 2344710
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index b66e8c7..2383a28 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -3938,6 +3938,39 @@
}
}
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+/**
+ * lim_process_roam_invoke() - process the Roam Invoke req
+ * @mac_ctx: Pointer to Global MAC structure
+ * @msg_buf: Pointer to the SME message buffer
+ *
+ * This function is called by limProcessMessageQueue(). This function sends the
+ * ROAM_INVOKE command to WMA.
+ *
+ * Return: None
+ */
+static void lim_process_roam_invoke(tpAniSirGlobal mac_ctx,
+ uint32_t *msg_buf)
+{
+ struct scheduler_msg msg = {0};
+ QDF_STATUS status;
+
+ msg.type = SIR_HAL_ROAM_INVOKE;
+ msg.bodyptr = msg_buf;
+ msg.reserved = 0;
+
+ status = wma_post_ctrl_msg(mac_ctx, &msg);
+ if (QDF_STATUS_SUCCESS != status)
+ pe_err("Not able to post SIR_HAL_ROAM_INVOKE to WMA");
+}
+#else
+static void lim_process_roam_invoke(tpAniSirGlobal mac_ctx,
+ uint32_t *msg_buf)
+{
+ qdf_mem_free(msg_buf);
+}
+#endif
+
/*
* lim_handle_update_ssid_hidden() - Processes SSID hidden update
* @mac_ctx: Pointer to global mac context
@@ -4967,6 +5000,10 @@
__lim_process_roam_scan_offload_req(pMac, pMsgBuf);
bufConsumed = false;
break;
+ case eWNI_SME_ROAM_INVOKE:
+ lim_process_roam_invoke(pMac, pMsgBuf);
+ bufConsumed = false;
+ break;
case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
/* Update the beaconInterval */
__lim_process_sme_change_bi(pMac, pMsgBuf);