From 87b224f183bdbfb51c4ce63ee90caae64739b09b Mon Sep 17 00:00:00 2001 From: Vidyullatha Kanchanapally Date: Tue, 24 May 2016 15:49:44 +0530 Subject: qcacld-3.0: Get operating channel only when connected or bss started qcacld-2.0 to qcacld-3.0 propagation wlan_hdd_mgmt_tx can be called in not-connected state in case of station mode. Here the operating channel is fetched from the connected info without actually checking whether the sta interface is connected or not and hence can lead to making a wrong decision whether or not to request ROC. Fix the above issue by fetching the operating channel only in connected state. In not-connected state driver always goes for requesting a ROC. Add similar check in case of soft ap and P2P-GO to get operating channel only when the bss is started. Change-Id: I91571f3b6a4f68487afcddd3152f469ff502eb6b CRs-Fixed: 957469 --- core/hdd/src/wlan_hdd_p2p.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 193a0d26d926..ea3df68c7a47 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1326,14 +1326,18 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET])); } - if (pAdapter->device_mode == QDF_SAP_MODE) { + if ((pAdapter->device_mode == QDF_SAP_MODE) && + (test_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags))) { home_ch = pAdapter->sessionCtx.ap.operatingChannel; - } else if (pAdapter->device_mode == QDF_STA_MODE) { + } else if ((pAdapter->device_mode == QDF_STA_MODE) && + (pAdapter->sessionCtx.station.conn_info.connState == + eConnectionState_Associated)) { home_ch = pAdapter->sessionCtx.station.conn_info.operationChannel; } else { goAdapter = hdd_get_adapter(pAdapter->pHddCtx, QDF_P2P_GO_MODE); - if (goAdapter) + if (goAdapter && + (test_bit(SOFTAP_BSS_STARTED, &goAdapter->event_flags))) home_ch = goAdapter->sessionCtx.ap.operatingChannel; } -- cgit v1.2.3