qcacld-2.0: During unload avoid sending disconnect twice for IBSS

When leave ibss is called, disconnect ibss command is posted to
SME and leave ibss function returns without waiting for disconnect
to get complete.

Now if unload is started before ibss disconnect is completed, as
part of stop adapter again ibss disconnect command is posted to SME
as HDD state is still not disconnected.

The first disconnect sets the BSSID to zero and thus once second
disconnect calls disconnect handler, warning is seen as BSSID passed
to ipa event handler is zero.

As part of fix add wait for disconnect completion in leave ibss and
move the BSSID check after SAP device mode check.

Change-Id: I83cdac1514833d21aa19052cde9b32476348f0c4
CRs-Fixed: 1017319
This commit is contained in:
Abhishek Singh 2016-05-17 14:09:16 +05:30 committed by L R
parent 17241f1b71
commit b732c807eb
2 changed files with 12 additions and 3 deletions

View File

@ -18153,6 +18153,15 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
FL("sme_RoamDisconnect failed hal_status(%d)"), hal_status);
return -EAGAIN;
}
status = wait_for_completion_timeout(
&pAdapter->disconnect_comp_var,
msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
if (!status) {
hddLog(LOGE,
FL("wait on disconnect_comp_var failed"));
return -ETIMEDOUT;;
}
EXIT();
return 0;
}

View File

@ -4106,9 +4106,6 @@ int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
if (type >= IPA_WLAN_EVENT_MAX)
return -EINVAL;
if (WARN_ON(is_zero_ether_addr(mac_addr)))
return -EINVAL;
if (!hdd_ipa || !hdd_ipa_is_enabled(hdd_ipa->hdd_ctx)) {
HDD_IPA_LOG(VOS_TRACE_LEVEL_ERROR, "IPA OFFLOAD NOT ENABLED");
return -EINVAL;
@ -4123,6 +4120,9 @@ int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
return 0;
}
if (WARN_ON(is_zero_ether_addr(mac_addr)))
return -EINVAL;
/* During IPA UC resource loading/unloading
* new event issued.
* Store event seperatly and handle later */