From 286def583354ba88de05cb6bc148964a87b29885 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Fri, 23 Sep 2016 15:38:02 -0700 Subject: [PATCH] qcacld-3.0: Fix NDI teardown issue on "ifconfig down" request This is qcacld-2.0 to qcacld-3.0 propagation. NAN data session is expected to be available across ifconfig up and ifconfig down requests from user space. The userspace will issue ifconfig down when it is done using the interface and will bring up the interface again if required. NAN data interface termination is expected to be done only on NDI delete request from the userspace. Change-Id: Ib9d7c1719077687bdd7e550404e874406ec50758 CRs-Fixed: 962367 --- core/hdd/src/wlan_hdd_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 10738b27a157..2ee4e27da71a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1961,6 +1961,14 @@ static int __hdd_open(struct net_device *dev) WLAN_CONTROL_PATH); } + /* Enable carrier and transmit queues for NDI */ + if (WLAN_HDD_IS_NDI(adapter)) { + hdd_notice("Enabling Tx Queues"); + wlan_hdd_netif_queue_control(adapter, + WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, + WLAN_CONTROL_PATH); + } + return ret; } @@ -2028,6 +2036,18 @@ static int __hdd_stop(struct net_device *dev) wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); + /* + * NAN data interface is different in some sense. The traffic on NDI is + * bursty in nature and depends on the need to transfer. The service + * layer may down the interface after the usage and up again when + * required. In some sense, the NDI is expected to be available + * (like SAP) iface until NDI delete request is issued by the service + * layer. Skip BSS termination and adapter deletion for NAN Data + * interface (NDI). + */ + if (WLAN_HDD_IS_NDI(adapter)) + return 0; + /* * The interface is marked as down for outside world (aka kernel) * But the driver is pretty much alive inside. The driver needs to