summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArunk Khandavalli <akhandav@codeaurora.org>2016-12-06 18:01:55 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-12-12 10:42:00 -0800
commitc5f98cb7d9bd1843676b4fabb96a4e36dc1154cf (patch)
tree8e5774983a8debc9f20531cc514cfd13d87d27c3
parentc495e7d41d4edf6bbcec9f2fdc935118b039763e (diff)
qcacld-3.0: Check driver state machine and stop iface_change timer during sap start
In a corner case the interface change timer is not getting stopped. One such case can be: 1) Framework issues add interface command for softap 2) Turns off the wifi sta which check for any interface is opened and if no interface is opnened it starts the interface change timer. 3) After this hostapd is attached and tethering becomes functional. Once the interface timer is expired it closes all modules and as part of del_station from the upper layer it tries to access pdev_txrx_ctx causing system crash. So, as part of the hostapd attach check for driver state machine and also stop the interface timer if it is expired. CRs-Fixed: 1094440 Change-Id: Ic973d53f09d901ead4fd0921cf3a593728e09c56
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 0c17bec692ca..a507250c39de 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -234,16 +234,25 @@ void hdd_sap_context_destroy(hdd_context_t *hdd_ctx)
static int __hdd_hostapd_open(struct net_device *dev)
{
hdd_adapter_t *pAdapter = netdev_priv(dev);
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
+ int ret;
ENTER_DEV(dev);
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_HOSTAPD_OPEN_REQUEST, NO_SESSION, 0));
- if (cds_is_load_or_unload_in_progress()) {
- hdd_err("Driver load/unload in progress, ignore, state: 0x%x",
- cds_get_driver_state());
- goto done;
+ ret = wlan_hdd_validate_context(hdd_ctx);
+ if (ret)
+ return ret;
+ /*
+ * Check statemachine state and also stop iface change timer if running
+ */
+ ret = hdd_wlan_start_modules(hdd_ctx, pAdapter, false);
+
+ if (ret) {
+ hdd_err("Failed to start WLAN modules return");
+ return ret;
}
set_bit(DEVICE_IFACE_OPENED, &pAdapter->event_flags);
@@ -252,7 +261,6 @@ static int __hdd_hostapd_open(struct net_device *dev)
wlan_hdd_netif_queue_control(pAdapter,
WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
WLAN_CONTROL_PATH);
-done:
EXIT();
return 0;
}