From ad5a78ee9e6a966e936747da1335997202d3dd69 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Tue, 19 May 2020 01:20:53 +0530 Subject: [PATCH] qcacld-3.0: Send disconnect reason code as 0 for beacon miss Currently, host driver sends disconnect reason code as WLAN_REASON_UNSPECIFIED(1) when the station disconnects due to continuous beacon miss and corresponding vendor specific reason code is also sent to userspace. This change is introduced with the commit I99bf4573b59dc810e0a1529fcd48061d10acae4e to provide vendor specific reason codes for all internal disconnections. Driver used to send reason code as 0 for beacon miss before this change. Few applications might still expect the same reason code(0) and current behavior causes backward compatibility issues. So, retain the same reason code 0 for beacon miss failure. Change-Id: I82f215ba15ff6e215cb14ac08933e1491371dfde CRs-Fixed: 2689257 --- core/hdd/src/wlan_hdd_cfg80211.c | 6 ++++++ core/sme/src/csr/csr_api_roam.c | 12 +----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c8bf4c05bde4..a9934b60b87b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -19586,6 +19586,12 @@ wlan_hdd_get_cfg80211_disconnect_reason(struct hdd_adapter *adapter, if (reason >= eSIR_MAC_REASON_PROP_START) { adapter->last_disconnect_reason = wlan_hdd_sir_mac_to_qca_reason(reason); + /* + * Applications expect reason code as 0 for beacon miss failure + * due to backward compatibility. So send ieee80211_reason as 0. + */ + if (reason == eSIR_MAC_BEACON_MISSED) + ieee80211_reason = 0; } else { ieee80211_reason = (enum ieee80211_reasoncode)reason; adapter->last_disconnect_reason = diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index cef6c11e2027..f429f9303fe5 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -3545,18 +3545,8 @@ QDF_STATUS csr_roam_call_callback(struct mac_context *mac, uint32_t sessionId, csr_connect_info(mac, pSession, roam_info, u2); if (mac->session_roam_complete_cb) { - if (roam_info) { + if (roam_info) roam_info->sessionId = (uint8_t) sessionId; - /* - * the reasonCode will be passed to supplicant by - * cfg80211_disconnected. Based on the document, - * the reason code passed to supplicant needs to set - * to 0 if unknown. eSIR_BEACON_MISSED reason code is - * not recognizable so that we set to 0 instead. - */ - if (roam_info->reasonCode == eSIR_MAC_BEACON_MISSED) - roam_info->reasonCode = 0; - } status = mac->session_roam_complete_cb(mac->psoc, sessionId, roam_info, roamId, u1, u2); }