Parcourir la source

qcacld-3.0: Fix disconnect event missing for kernel

For reassociate case, when disconnect is triggered by
wlan_hdd_try_disconnect, then disconnect event is not
indicated to kernel in disconnect handler -
hdd_dis_connect_handler.  And if the csr_roam_connect
get failure for some reason, the kernel will only get
error code from driver connect request interface and
the connected bss information in kernel will not get
cleared. Then kernel / driver will be out of sync.
To fix that, for such csr_roam_connect failure case,
let driver return successful status code from driver
connect interface and indicate connection result failure
event to kernel to clear kernel bss information.

Change-Id: I5367262751e63c04553deeb7607cbe13c70f8e15
CRs-Fixed: 2940994
Liangwei Dong il y a 3 ans
Parent
commit
6f560d48cb
1 fichiers modifiés avec 9 ajouts et 6 suppressions
  1. 9 6
      core/hdd/src/wlan_hdd_cfg80211.c

+ 9 - 6
core/hdd/src/wlan_hdd_cfg80211.c

@@ -19000,7 +19000,7 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 				    enum nl80211_chan_width ch_width)
 {
 	int status = 0;
-	QDF_STATUS qdf_status;
+	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 	struct hdd_context *hdd_ctx;
 	struct hdd_station_ctx *hdd_sta_ctx;
 	uint32_t roam_id = INVALID_ROAM_ID;
@@ -19307,14 +19307,17 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 		if ((QDF_STATUS_SUCCESS != qdf_status) &&
 		    (QDF_STA_MODE == adapter->device_mode ||
 		     QDF_P2P_CLIENT_MODE == adapter->device_mode)) {
-			hdd_err("Vdev %d connect failed with status %d",
+			hdd_err("Vdev %d connect failed with status %d to krnl",
 				adapter->vdev_id, qdf_status);
 			/* change back to NotAssociated */
 			hdd_conn_set_connection_state(adapter,
 						      eConnectionState_NotConnected);
-			qdf_runtime_pm_allow_suspend(
-					&hdd_ctx->runtime_context.connect);
-			hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
+			hdd_connect_result(adapter->dev,
+					   NULL, NULL, NULL, 0, NULL, 0,
+					   WLAN_STATUS_UNSPECIFIED_FAILURE,
+					   GFP_KERNEL, false,
+					   eSIR_SME_INVALID_PARAMETERS);
+			status = 0;
 		}
 
 		/* Reset connect_in_progress */
@@ -19337,7 +19340,7 @@ ret_status:
 	 * Enable roaming on other STA adapter for failure case.
 	 * For success case, it is enabled in assoc completion handler
 	 */
-	if (status)
+	if (status || qdf_status != QDF_STATUS_SUCCESS)
 		wlan_hdd_enable_roaming(adapter, RSO_CONNECT_START);
 
 	return status;