qcacld-3.0: Disable auto ps timer on interface down

Auto ps timer is started as part of the interface up
but not disabled as part of the interface down.
Meanwhile if interface down happen hence sme session
get deleted. But if ps timer expire later then it try
to access invalid sme session and lead to abort.
As a part of fix, Disable auto ps timer on interface down.

Change-Id: If67f7ec66d7dea7b8e7e674dc86efe7124244dde
CRs-Fixed: 2061845
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 0b0aa28..e32b203 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -121,6 +121,7 @@
 #include "nan_public_structs.h"
 #include "wlan_reg_ucfg_api.h"
 #include "wlan_hdd_rx_monitor.h"
+#include "sme_power_save_api.h"
 
 #ifdef CNSS_GENL
 #include <net/cnss_nl.h>
@@ -2496,7 +2497,17 @@
 
 	/* Make sure the interface is marked as closed */
 	clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
-	hdd_debug("Disabling queues");
+
+	hdd_debug("Disabling Auto Power save timer");
+	sme_ps_disable_auto_ps_timer(
+		WLAN_HDD_GET_HAL_CTX(adapter),
+		adapter->sessionId);
+
+	/*
+	 * Disable TX on the interface, after this hard_start_xmit() will not
+	 * be called on that interface
+	 */
+	hdd_notice("Disabling queues");
 	wlan_hdd_netif_queue_control(adapter,
 				     WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
 				     WLAN_CONTROL_PATH);