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
This commit is contained in:
Vidyullatha Kanchanapally 2016-05-24 15:49:44 +05:30 • committed by qcabuildsw
commit 87b224f183

View file

@ -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;
}