wlan: Remove early suspend notifications

WLAN driver used to listen to early suspend notifications to apply
Multicast and Broadcast filters at firmware. However the early
suspend notification are getting removed from Android Kernel. WLAN
Driver now listens to SETSUSPEND ioctl instead of early suspend for
it's early suspend activities.

CRs-Fixed: 446854
Change-Id: Iad78c239084f908c35b0c07cecaa9d4d49f98068
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index c028274..31804f5 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -187,6 +187,7 @@
 static void wlan_hdd_restart_init(hdd_context_t *pHddCtx);
 static void wlan_hdd_restart_deinit(hdd_context_t *pHddCtx);
 void wlan_hdd_restart_timer_cb(v_PVOID_t usrDataForCallback);
+void hdd_set_wlan_suspend_mode(bool suspend);
 
 v_U16_t hdd_select_queue(struct net_device *dev,
     struct sk_buff *skb);
@@ -307,13 +308,9 @@
 /*---------------------------------------------------------------------------
  *   Function definitions
  *-------------------------------------------------------------------------*/
-extern int isWDresetInProgress(void);
-#ifdef CONFIG_HAS_EARLYSUSPEND
-extern void register_wlan_suspend(void);
-extern void unregister_wlan_suspend(void);
+int isWDresetInProgress(void);
 void hdd_unregister_mcast_bcast_filter(hdd_context_t *pHddCtx);
 void hdd_register_mcast_bcast_filter(hdd_context_t *pHddCtx);
-#endif
 //variable to hold the insmod parameters
 static int con_mode;
 #ifndef MODULE
@@ -513,6 +510,14 @@
 
            ret = sapSetPreferredChannel(dev, ptr);
        }
+       else if(strncmp(command, "SETSUSPENDMODE", 14) == 0)
+       {
+           int suspend = 0;
+           tANI_U8 *ptr = (tANI_U8*)command + 15;
+
+           suspend = *ptr - '0';
+           hdd_set_wlan_suspend_mode(suspend);
+       }
        else {
            hddLog( VOS_TRACE_LEVEL_WARN, "%s: Unsupported GUI command %s",
                    __func__, command);
@@ -2791,14 +2796,6 @@
    //netif_tx_disable(pWlanDev);
    //netif_carrier_off(pWlanDev);
 
-#ifdef CONFIG_HAS_EARLYSUSPEND
-   // unregister suspend/resume callbacks
-   if(pHddCtx->cfg_ini->nEnableSuspend)
-   {
-      unregister_wlan_suspend();
-   }
-#endif
-
 #ifdef FEATURE_WLAN_INTEGRATED_SOC
 #ifdef WLAN_SOFTAP_FEATURE
    if (VOS_STA_SAP_MODE == hdd_get_conparam())
@@ -2990,9 +2987,7 @@
    nl_srv_exit();
 
    //This requires pMac access, Call this before vos_close().
-#ifdef CONFIG_HAS_EARLYSUSPEND
    hdd_unregister_mcast_bcast_filter(pHddCtx);
-#endif
 
    //Close the scheduler before calling vos_close to make sure no thread is 
    // scheduled after the each module close is called i.e after all the data 
@@ -3933,14 +3928,6 @@
       goto err_unregister_pmops;
    }
 
-#ifdef CONFIG_HAS_EARLYSUSPEND
-   // Register suspend/resume callbacks
-   if(pHddCtx->cfg_ini->nEnableSuspend)
-   {
-      register_wlan_suspend();
-   }
-#endif
-
    // register net device notifier for device change notification
    ret = register_netdevice_notifier(&hdd_netdev_notifier);
 
@@ -3973,9 +3960,7 @@
    }
 #endif
 
-#ifdef CONFIG_HAS_EARLYSUSPEND
    hdd_register_mcast_bcast_filter(pHddCtx);
-#endif
 #ifdef CONFIG_CFG80211
 #ifdef WLAN_SOFTAP_FEATURE
    if (VOS_STA_SAP_MODE != hdd_get_conparam())