浏览代码

qcacld-3.0: Check SME connection status before issuing reassoc

Currently when the supplicant sends a connect with bssid_hint and
prev_bssid, driver issues a roam_invoke (fast reassoc) command to the
FW. However, when this connect is received in the supplicant context
and if the driver is currently processing a disassoc/deauth from the
AP in the mc thread, then the CSR roam connection state would not be
associated but the HDD STA context connection state would still be
associated. In this scenario, since the disconnection is in progress
and VDEV Down might already be sent to the FW, the roam_invoke command
is ignored and FW does not send any response. However the driver
assumes that roaming is in progress and blocks all incoming scan/
connect requests from supplicant leading to a state where no further
connections can go through.

In hdd_reassoc, check the CSR Connection state also to check if
the current state is associated and then issue roam_invoke to FW.

Change-Id: I321e99b060d6ce22517a3dd604b0f4d08dd5918d
CRs-Fixed: 2319641
Vignesh Viswanathan 6 年之前
父节点
当前提交
7c43a7a55f
共有 3 个文件被更改,包括 31 次插入2 次删除
  1. 12 2
      core/hdd/src/wlan_hdd_ioctl.c
  2. 12 0
      core/sme/inc/sme_api.h
  3. 7 0
      core/sme/src/common/sme_api.c

+ 12 - 2
core/hdd/src/wlan_hdd_ioctl.c

@@ -710,8 +710,18 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
 
 	sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
-	/* if not associated, no need to proceed with reassoc */
-	if (eConnectionState_Associated != sta_ctx->conn_info.connState) {
+	/*
+	 * pHddStaCtx->conn_info.connState is set to disconnected only
+	 * after the disconnect done indication from SME. If the SME is
+	 * in the process of disconnecting, the SME Connection state is
+	 * set to disconnected and the pHddStaCtx->conn_info.connState
+	 * will still be associated till the disconnect is done.
+	 * So check both the HDD state and SME state here.
+	 * If not associated, no need to proceed with reassoc
+	 */
+	if ((eConnectionState_Associated != sta_ctx->conn_info.connState) ||
+	    (!sme_is_conn_state_connected(hdd_ctx->mac_handle,
+	    adapter->session_id))) {
 		hdd_warn("Not associated");
 		ret = -EINVAL;
 		goto exit;

+ 12 - 0
core/sme/inc/sme_api.h

@@ -2265,6 +2265,18 @@ static inline QDF_STATUS sme_set_he_bss_color(tHalHandle hal,
 }
 #endif
 
+/**
+ * sme_is_conn_state_connected() -- check if SME connection state is connected
+ * @hal: global hal handle
+ * @session_id: current Session Id
+ *
+ * This API checks if the current SME connection state is connected for the
+ * given session id.
+ *
+ * Return: True if connected, false if any other state.
+ */
+bool sme_is_conn_state_connected(mac_handle_t hal, uint8_t session_id);
+
 /**
  * sme_scan_get_result_for_bssid - gets the scan result from scan cache for the
  * bssid specified

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

@@ -15990,6 +15990,13 @@ static bool sme_get_status_for_candidate(tHalHandle hal,
 	return false;
 }
 
+bool sme_is_conn_state_connected(mac_handle_t hal, uint8_t session_id)
+{
+	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+	return csr_is_conn_state_connected(mac_ctx, session_id);
+}
+
 /**
  * wlan_hdd_get_bss_transition_status() - get bss transition status all cadidates
  * @adapter : Pointer to adapter