Wlan: Send disconnect event for userspace initiated disconnect
qcacld-2.0 to pronto propagation.
From kernel 3.11 onwards, cfg80211_disconnect will not be notifying
the userspace with disconnected event. Indicate disconnect event to
nl80211 and thereby to the supplicant for userpsace initiated
disconnect
Change-Id: I4724d9b8c645991121bca8c489c0a8e152434fbb
CRs-Fixed: 918706
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 2a6e7c5..9c5642c 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -14559,6 +14559,15 @@
FL("Set HDD connState to eConnectionState_NotConnected"));
pHddStaCtx->conn_info.connState = eConnectionState_NotConnected;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ /* Sending disconnect event to userspace for kernel version < 3.11
+ * is handled by __cfg80211_disconnect call to __cfg80211_disconnected
+ */
+ hddLog(LOG1, FL("Send disconnected event to userspace"));
+ cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED,
+ NULL, 0, GFP_KERNEL);
+#endif
+
EXIT();
return result;
}