summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanumanth Reddy Pothula <c_hpothu@codeaurora.org>2017-02-17 17:35:35 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-02-17 11:32:28 -0800
commitba66850f1539ec2301aa9e38b3568d4539b43aaa (patch)
tree05043face592ba8881a6344b6cb761f0e2f22025
parent9d6801cf80665a82123201c9c8f53e5b8eff1342 (diff)
qcacld-3.0: In STA mode, process stop adapter cleanly
Presently, as part of interface down host clears interface flags and then calls stop adapter, where again same flag is checked and processed only if interface bit is set, leading stop adapter never processed during interface down. Check for SESSION OPEN flag rather interface flag while processing stop adapter. Also during hostapd unregister make sure wireless handler is set to NULL, though interface flag is not set. Change-Id: Iada9080d2ae32d03f7f8b5aa8702fc6c982db630 CRs-Fixed: 2008484
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c9
-rw-r--r--core/hdd/src/wlan_hdd_main.c10
2 files changed, 9 insertions, 10 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 01443fb67f76..3bb1f52a217b 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -6076,10 +6076,6 @@ int hdd_unregister_hostapd(hdd_adapter_t *pAdapter, bool rtnl_held)
hdd_softap_deinit_tx_rx(pAdapter);
- if (!test_bit(DEVICE_IFACE_OPENED, &pAdapter->event_flags)) {
- hdd_info("iface is not opened");
- return 0;
- }
/* if we are being called during driver unload,
* then the dev has already been invalidated.
* if we are being called at other times, then we can
@@ -6095,6 +6091,11 @@ int hdd_unregister_hostapd(hdd_adapter_t *pAdapter, bool rtnl_held)
}
}
+ if (!test_bit(DEVICE_IFACE_OPENED, &pAdapter->event_flags)) {
+ hdd_info("iface is not opened");
+ return 0;
+ }
+
status = wlansap_stop(sapContext);
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("Failed:wlansap_stop");
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 69841382e177..ffee248798e9 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -2010,10 +2010,6 @@ static int __hdd_stop(struct net_device *dev)
return -ENODEV;
}
- /* Make sure the interface is marked as closed */
- clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
- hdd_notice("Disabling OS Tx queues");
-
/*
* Disable TX on the interface, after this hard_start_xmit() will not
* be called on that interface
@@ -2049,6 +2045,8 @@ static int __hdd_stop(struct net_device *dev)
/* DeInit the adapter. This ensures datapath cleanup as well */
hdd_deinit_adapter(hdd_ctx, adapter, true);
+ /* Make sure the interface is marked as closed */
+ clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
/*
* Find if any iface is up. If any iface is up then can't put device to
@@ -3611,8 +3609,8 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
ENTER();
- if (!test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags)) {
- hdd_info("interface %d is not up %lu",
+ if (!test_bit(SME_SESSION_OPENED, &adapter->event_flags)) {
+ hdd_info("session %d is not open %lu",
adapter->device_mode, adapter->event_flags);
return -ENODEV;
}