From a335c16780a7f3ee4293877d35c3d94b41fe1c48 Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Thu, 21 Jan 2016 12:12:20 -0800 Subject: [PATCH] qcacld-3.0: Update cfg80211_disconnected interface for Kernel update Commit: 80279fb ("cfg80211: properly send NL80211_ATTR_DISCONNECTED_BY_AP in disconnect") Above commit is merged in Kernel 4.2, it introduces the new parameter to indicate if the disconnect event is generated locally. Change-Id: I016df3b400f5f4b8447676882df79fab6915a8f5 CRs-fixed: 966069 --- core/hdd/src/wlan_hdd_assoc.c | 13 +++++++++---- core/hdd/src/wlan_hdd_cfg80211.c | 7 +++++-- core/hdd/src/wlan_hdd_main.c | 6 +++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index f35fe2360e9a..216020c4a776 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1041,12 +1041,17 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON) pr_info("wlan: disconnected due to poor signal, rssi is %d dB\n", pRoamInfo->rxRssi); cfg80211_disconnected(dev, pRoamInfo-> - reasonCode, NULL, - 0, GFP_KERNEL); + reasonCode, NULL, 0, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) || defined(WITH_BACKPORTS) + true, +#endif + GFP_KERNEL); } else { cfg80211_disconnected(dev, - WLAN_REASON_UNSPECIFIED, - NULL, 0, + WLAN_REASON_UNSPECIFIED, NULL, 0, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) || defined(WITH_BACKPORTS) + true, +#endif GFP_KERNEL); } diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 77d513eac8ac..e86c52bf79f7 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9006,8 +9006,11 @@ disconnected: * 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); + cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED, NULL, 0, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) || defined(WITH_BACKPORTS) + false, +#endif + GFP_KERNEL); #endif return result; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9f0f4925d893..5d86191b6dde 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3127,7 +3127,11 @@ QDF_STATUS hdd_start_all_adapters(hdd_context_t *hdd_ctx) /* indicate disconnected event to nl80211 */ cfg80211_disconnected(adapter->dev, WLAN_REASON_UNSPECIFIED, - NULL, 0, GFP_KERNEL); + NULL, 0, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) || defined(WITH_BACKPORTS) + true, +#endif + GFP_KERNEL); } else if (eConnectionState_Connecting == connState) { /* * Indicate connect failure to supplicant if we were in the