wlan: Remove obsolete USB and SDIO conditional code

The current driver code has obsolete support for USB and SDIO attached
hardware.  Since the USB and SDIO code is not being used, remove all
of the obsolete ANI_BUS_TYPE_SDIO and ANI_BUS_TYPE_USB code from the
driver.

Change-Id: Ic4f22245e447591c8ea83855c7499165605e9e59
CRs-fixed: 452041
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 0199fdb..c15199c 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -68,20 +68,12 @@
 #include "vos_power.h"
 #include <vos_sched.h>
 #include <macInitApi.h>
-#ifdef ANI_BUS_TYPE_SDIO
-#include <wlan_qct_sal.h>
-#include <wlan_qct_bal.h>
-#endif
 #include <wlan_qct_sys.h>
 #include <wlan_btc_svc.h>
 #include <wlan_nlink_common.h>
 #include <wlan_hdd_main.h>
 #include <wlan_hdd_assoc.h>
 #include <wlan_hdd_dev_pwr.h>
-#ifdef ANI_BUS_TYPE_SDIO
-#include <wlan_sal_misc.h>
-#include <libra_sdioif.h>
-#endif
 #include <wlan_nlink_srv.h>
 #include <wlan_hdd_misc.h>
 
@@ -315,10 +307,7 @@
    eHalStatus halStatus;
    VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
    vos_call_status_type callType;
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev_current = NULL;
-   int attempts = 0;
-#endif
+
    //Stop the Interface TX queue.
    netif_tx_disable(pAdapter->dev);
    netif_carrier_off(pAdapter->dev);
@@ -368,49 +357,12 @@
    vosStatus = vos_stop( pHddCtx->pvosContext );
    VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
 
-#ifdef ANI_BUS_TYPE_SDIO
-   vosStatus = WLANBAL_Stop( pHddCtx->pvosContext );
-   VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-
-   vosStatus = WLANBAL_SuspendChip( pHddCtx->pvosContext );
-   VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-
-   vosStatus = WLANSAL_Stop(pHddCtx->pvosContext);
-   VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-#endif
-
    vosStatus = vos_chipAssertDeepSleep( &callType, NULL, NULL );
    VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
 
    //Vote off any PMIC voltage supplies
    vosStatus = vos_chipPowerDown(NULL, NULL, NULL);
 
-#ifdef ANI_BUS_TYPE_SDIO
-    //Get the Current SDIO Func
-   sdio_func_dev_current = libra_getsdio_funcdev();
-   if(NULL != sdio_func_dev_current) {
-      libra_detect_card_change();
-      do {
-         msleep(100);
-         //Get the SDIO func device
-         sdio_func_dev_current = libra_getsdio_funcdev();
-         if(NULL == sdio_func_dev_current) {
-            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Card Removed Successfully",__func__);
-            break;
-         }
-         else {
-            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed to Remove the Card: Trying Again",__func__);
-            attempts++;
-         }
-      } while (attempts < LIBRA_CARD_REMOVE_DETECT_MAX_COUNT);
-
-      if(LIBRA_CARD_REMOVE_DETECT_MAX_COUNT == attempts) {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed to Remove the Card: Fatal",__func__);
-         goto err_fail;
-      }
-   }
-#endif
-
    pHddCtx->hdd_ps_state = eHDD_SUSPEND_DEEP_SLEEP;
 
    //Restore IMPS config
@@ -421,9 +373,6 @@
    if(pHddCtx->cfg_ini->fIsBmpsEnabled)
       sme_EnablePowerSave(pHddCtx->hHal, ePMC_BEACON_MODE_POWER_SAVE);
 
-#ifdef ANI_BUS_TYPE_SDIO
-err_fail:
-#endif
    return vosStatus;
 }
 
@@ -431,10 +380,6 @@
 {
    VOS_STATUS vosStatus;
    eHalStatus halStatus;
-#ifdef ANI_BUS_TYPE_SDIO
-   int attempts = 0;
-   struct sdio_func *sdio_func_dev = NULL;
-#endif
 
    //Power Up Libra WLAN card first if not already powered up
    vosStatus = vos_chipPowerUp(NULL,NULL,NULL);
@@ -445,108 +390,6 @@
       goto err_deep_sleep;
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   libra_detect_card_change();
-
-   do {
-      sdio_func_dev = libra_getsdio_funcdev();
-      if (NULL == sdio_func_dev) {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN not detected yet.",__func__);
-         attempts++;
-      }
-      else {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN detecton succeeded",__func__);
-         break;
-      }
-
-      if(LIBRA_CARD_INSERT_DETECT_MAX_COUNT == attempts)
-        break;
-
-      msleep(250);
-
-   }while (attempts < LIBRA_CARD_INSERT_DETECT_MAX_COUNT);
-
-   //Retry to detect the card again by Powering Down the chip and Power up the chip
-   //again. This retry is done to recover from CRC Error
-   if (NULL == sdio_func_dev) {
-
-      attempts = 0;
-
-      //Vote off any PMIC voltage supplies
-      vos_chipPowerDown(NULL, NULL, NULL);
-
-      msleep(1000);
-
-      //Power Up Libra WLAN card first if not already powered up
-      vosStatus = vos_chipPowerUp(NULL,NULL,NULL);
-      if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-      {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Retry Libra WLAN not Powered Up. "
-             "exiting", __func__);
-         goto err_deep_sleep;
-      }
-
-      do {
-         sdio_func_dev = libra_getsdio_funcdev();
-         if (NULL == sdio_func_dev) {
-            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Retry Libra WLAN not detected yet.",__func__);
-            attempts++;
-         }
-         else {
-            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Retry Libra WLAN detecton succeeded",__func__);
-            break;
-         }
-
-         if(attempts == 2)
-           break;
-
-         msleep(1000);
-
-      }while (attempts < 3);
-
-   }
-
-   if (NULL == sdio_func_dev) {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN not found!!",__func__);
-         goto err_deep_sleep;
-   }
-
-   SET_NETDEV_DEV(pAdapter->dev, &sdio_func_dev->dev);
-   libra_sdio_setprivdata (sdio_func_dev, pHddCtx);
-   atomic_set(&pHddCtx->sdio_claim_count, 0);
-   pHddCtx->parent_dev = &sdio_func_dev->dev;
-
-   VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, 
-      "%s: calling WLANSAL_Start",__func__);
-   vosStatus = WLANSAL_Start(pHddCtx->pvosContext);
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
-         "%s: Failed to start SAL",__func__);
-      goto err_deep_sleep;
-   }
-
-   VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
-      "%s: calling WLANBAL_ResumeChip",__func__);
-   vosStatus = WLANBAL_ResumeChip( pHddCtx->pvosContext );
-   VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
-         "%s: Failed in WLANBAL_ResumeChip",__func__);
-      goto err_sal_stop;
-   }
-
-   vosStatus = WLANBAL_Start(pHddCtx->pvosContext);
-
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
-               "%s: Failed to start BAL",__func__);
-      goto err_sal_stop;
-   }
-#endif
-
    VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
       "%s: calling hdd_set_sme_config",__func__);
    vosStatus = hdd_set_sme_config( pHddCtx );
@@ -555,11 +398,7 @@
    {
       VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
          "%s: Failed in hdd_set_sme_config",__func__);
-#ifdef ANI_BUS_TYPE_SDIO
-      goto err_bal_stop;
-#else
       goto err_deep_sleep;
-#endif
    }
 
    VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, 
@@ -570,11 +409,7 @@
    {
       VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
          "%s: Failed in vos_start",__func__);
-#ifdef ANI_BUS_TYPE_SDIO
-      goto err_bal_stop;
-#else
       goto err_deep_sleep;
-#endif
    }
 
    VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, 
@@ -609,12 +444,6 @@
 
 err_voss_stop:
    vos_stop(pHddCtx->pvosContext);
-#ifdef ANI_BUS_TYPE_SDIO
-err_bal_stop:
-   WLANBAL_Stop(pHddCtx->pvosContext);
-err_sal_stop:
-   WLANSAL_Stop(pHddCtx->pvosContext);
-#endif
 err_deep_sleep:
    return VOS_STATUS_E_FAILURE;
 
@@ -974,9 +803,7 @@
    hdd_adapter_t *pAdapter = NULL; 
    hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
    VOS_STATUS status;
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev = NULL;
-#endif
+
    hddLog(VOS_TRACE_LEVEL_INFO, "%s: WLAN being suspended by Android OS",__func__);
 
    //Get the global VOSS context.
@@ -1000,35 +827,6 @@
       return;
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   sdio_func_dev = libra_getsdio_funcdev();
-
-   if(sdio_func_dev == NULL)
-   {
-        /* Our card got removed */
-        hddLog(VOS_TRACE_LEVEL_FATAL, "%s: sdio_func_dev is NULL!",__func__);
-        return;
-   }
-
-   if(!sd_is_drvdata_available(sdio_func_dev))
-   {
-        /* Our card got removed */
-        hddLog(VOS_TRACE_LEVEL_FATAL,
-               "%s: HDD context is not available in sdio_func_dev!",__func__);
-        return;
-   }
-
-   sd_claim_host(sdio_func_dev);
-   
-   // Prevent touching the pMac while LOGP reset in progress, we should never get here
-   // as the wake lock is already acquired and it would prevent from entering suspend 
-   if (pHddCtx->isLogpInProgress) {
-      hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Ignore suspend wlan, LOGP in progress!", __func__);
-      sd_release_host(sdio_func_dev);
-      return;
-   }
-#endif
-
    /*loop through all adapters. TBD fix for Concurrency */
    status =  hdd_get_front_adapter ( pHddCtx, &pAdapterNode );
    while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status )
@@ -1128,9 +926,6 @@
       hdd_enter_standby(pHddCtx);
   }
 #endif
-#ifdef ANI_BUS_TYPE_SDIO
-   sd_release_host(sdio_func_dev);
-#endif
 
    return;
 }
@@ -1227,9 +1022,7 @@
    hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
    VOS_STATUS status;
    v_CONTEXT_t pVosContext = NULL;
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev = NULL;
-#endif
+
    hddLog(VOS_TRACE_LEVEL_INFO, "%s: WLAN being resumed by Android OS",__func__);
 
    //Get the global VOSS context.
@@ -1253,33 +1046,6 @@
       return;
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   sdio_func_dev = libra_getsdio_funcdev();
-
-   if(sdio_func_dev == NULL)
-   {
-      /* Our card got removed */
-      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: sdio_func_dev is NULL!",__func__);
-      return;
-   }
-
-   if(!sd_is_drvdata_available(sdio_func_dev))
-   {
-        /* Our card got removed */
-        hddLog(VOS_TRACE_LEVEL_FATAL, "%s: HDD context is not available "
-                                       "in sdio_func_dev!",__func__);
-        return;
-   }
-
-   sd_claim_host(sdio_func_dev);
-   
-   // Prevent touching the pMac while LOGP reset in progress, 
-   if (pHddCtx->isLogpInProgress) {
-      hddLog(VOS_TRACE_LEVEL_INFO, "%s: Ignore resume wlan, LOGP in progress!", __func__);
-      sd_release_host(sdio_func_dev);
-      return;
-   }
-#endif
    pHddCtx->hdd_wlan_suspended = FALSE;
    /*loop through all adapters. Concurrency */
    status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode );
@@ -1349,19 +1115,11 @@
    }    
 #endif
 
-#ifdef ANI_BUS_TYPE_SDIO
-   sd_release_host(sdio_func_dev);
-#endif
    return;
 }
 
 VOS_STATUS hdd_wlan_reset_initialization(void) 
 {
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev = NULL;
-   v_U8_t  regValue = 0;
-   int  err_ret = 0;
-#endif
    v_CONTEXT_t pVosContext = NULL;
 
    hddLog(VOS_TRACE_LEVEL_FATAL, "%s: WLAN being reset",__func__);  
@@ -1379,51 +1137,6 @@
    // Prevent the phone from going to sleep
    hdd_prevent_suspend();
 
-#ifdef ANI_BUS_TYPE_SDIO
-   /* Clear pending interrupt and  disable Interrupts. Use only CMD52 */
-   VOS_TRACE( VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_FATAL, 
-          "%s LOGP in progress. Disabling Interrupt", __func__);
-
-   sdio_func_dev = libra_getsdio_funcdev();
-
-   if(sdio_func_dev == NULL)
-   {
-      /* Our card got removed before LOGP. Continue with reset anyways */
-      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: sdio_func_dev is NULL!",__func__);
-      return VOS_STATUS_SUCCESS;
-   }
-
-   sd_claim_host(sdio_func_dev);
-
-   regValue = 0;
-   libra_sdiocmd52(sdio_func_dev, QWLAN_SIF_SIF_INT_EN_REG,  
-                             &regValue, 1, &err_ret);
-
-   VOS_TRACE( VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_FATAL, 
-      "%s LOGP Cleared SIF_SIF_INT_EN_REG status:%d", __func__,err_ret);
-
-   regValue = 0;
-   libra_sdiocmd52(sdio_func_dev, QWLAN_SIF_BAR4_INT_PEND_REG,  
-                             &regValue, 1, &err_ret);
-
-   VOS_TRACE( VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_FATAL, 
-      "%s LOGP Cleared SIF_BAR4_INT_PEND_REG status :%d", __func__,err_ret);
-
-   regValue = 0;
-   libra_sdiocmd52(sdio_func_dev, QWLAN_SIF_BAR4_INT_ENABLE_REG,  
-                             &regValue, 1, &err_ret);
-
-   VOS_TRACE( VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_FATAL, 
-      "%s LOGP Cleared SIF_BAR4_INT_ENABLE_REG: Status:%d", __func__,err_ret);
-
-   hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Doing Suspend Chip",__func__);
-
-   //Put the chip is standby before asserting deep sleep
-   WLANBAL_SuspendChip_NoLock( pVosContext );
-
-   sd_release_host(sdio_func_dev);
-#endif
-
    return VOS_STATUS_SUCCESS;
 }
 
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index eabb32d..f396ed2 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -75,21 +75,11 @@
   ------------------------------------------------------------------------*/
 //#include <wlan_qct_driver.h>
 #include <wlan_hdd_includes.h>
-#ifdef ANI_BUS_TYPE_SDIO
-#include <wlan_sal_misc.h>
-#endif // ANI_BUS_TYPE_SDIO
 #include <vos_api.h>
 #include <vos_sched.h>
 #include <vos_power.h>
 #include <linux/etherdevice.h>
 #include <linux/firmware.h>
-#ifdef ANI_BUS_TYPE_SDIO
-#include <linux/mmc/sdio_func.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
-// added in 2.6.32, need to define locally if using an earlier kernel
-#define dev_to_sdio_func(d)      container_of(d, struct sdio_func, dev)
-#endif
-#endif // ANI_BUS_TYPE_SDIO
 #ifdef ANI_BUS_TYPE_PLATFORM
 #include <linux/wcnss_wlan.h>
 #endif //ANI_BUS_TYPE_PLATFORM
@@ -3340,9 +3330,6 @@
    eHalStatus halStatus;
    v_CONTEXT_t pVosContext = pHddCtx->pvosContext;
    VOS_STATUS vosStatus;
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev = NULL;
-#endif // ANI_BUS_TYPE_SDIO
 #ifdef CONFIG_CFG80211
     struct wiphy *wiphy = pHddCtx->wiphy;
 #endif 
@@ -3503,24 +3490,6 @@
    
    hdd_stop_all_adapters( pHddCtx );
 
-#ifdef ANI_BUS_TYPE_SDIO
-   sdio_func_dev = libra_getsdio_funcdev();
-
-   if(sdio_func_dev == NULL)
-   {
-        hddLog(VOS_TRACE_LEVEL_FATAL, "%s: sdio_func_dev is NULL!",__func__);
-        VOS_ASSERT(0);
-        return;
-   }
-
-   sd_claim_host(sdio_func_dev);
-
-   /* Disable SDIO IRQ since we are exiting */
-   libra_enable_sdio_irq(sdio_func_dev, 0);
-
-   sd_release_host(sdio_func_dev);
-#endif // ANI_BUS_TYPE_SDIO
-
 #ifdef WLAN_BTAMP_FEATURE
    vosStatus = WLANBAP_Stop(pVosContext);
    if (!VOS_IS_STATUS_SUCCESS(vosStatus))
@@ -3539,40 +3508,6 @@
       VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   vosStatus = WLANBAL_Stop( pVosContext );
-
-   hddLog(VOS_TRACE_LEVEL_ERROR,"WLAN BAL STOP\n");
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
-         "%s: Failed to stop BAL",__func__);
-      VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-   }
-
-    msleep(50);
-   //Put the chip is standby before asserting deep sleep
-   vosStatus = WLANBAL_SuspendChip( pVosContext );
-
-   hddLog(VOS_TRACE_LEVEL_ERROR,"WLAN Suspend Chip\n");
-
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
-         "%s: Failed to suspend chip ",__func__);
-      VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-   }
-   //Invoke SAL stop
-   vosStatus = WLANSAL_Stop( pVosContext );
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
-         "%s: Failed to stop SAL",__func__);
-      VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-   }
-
-#endif // ANI_BUS_TYPE_SDIO
-
    //Assert Deep sleep signal now to put Libra HW in lowest power state
    vosStatus = vos_chipAssertDeepSleep( NULL, NULL, NULL );
    VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
@@ -3611,17 +3546,6 @@
    //This frees pMac(HAL) context. There should not be any call that requires pMac access after this.
    vos_close(pVosContext);
 
-#ifdef ANI_BUS_TYPE_SDIO
-   vosStatus = WLANBAL_Close(pVosContext);
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
-   {
-      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, 
-          "%s: Failed to close BAL",__func__);
-      VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
-   }
-   hddLog(VOS_TRACE_LEVEL_ERROR,"Returned WLAN BAL CLOSE\n\n\n\n");
-#endif // ANI_BUS_TYPE_SDIO
-
    //Close Watchdog
    if(pHddCtx->cfg_ini->fIsLogpEnabled)
       vos_watchdog_close(pVosContext);
@@ -3823,28 +3747,6 @@
    return VOS_STATUS_SUCCESS;
 }
 
-#ifdef ANI_BUS_TYPE_SDIO
-
-#ifndef ANI_MANF_DIAG
-// Routine to initialize the PMU
-void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext)
-{
-/*-------------- Need to fix this correctly while doing Deepsleep testing
-    tANI_U32 regValue = 0;
-
-    regValue  = QWLAN_PMU_LDO_CTRL_REG_PMU_ANA_DEEP_SLEEP_EN_MASK |
-                QWLAN_PMU_LDO_CTRL_REG_PMU_ANA_1P23_LPM_AON_MASK_MASK |
-                QWLAN_PMU_LDO_CTRL_REG_PMU_ANA_1P23_LPM_SW_MASK_MASK |
-                QWLAN_PMU_LDO_CTRL_REG_PMU_ANA_2P3_LPM_MASK_MASK;
-
-    WLANBAL_WriteRegister(pVosContext, QWLAN_PMU_LDO_CTRL_REG_REG, regValue);
----------------------*/
-
-    return;
-}
-#endif
-#endif
-
 /* wake lock APIs for HDD */
 void hdd_prevent_suspend(void)
 {
@@ -4032,9 +3934,6 @@
 #ifdef CONFIG_CFG80211
    struct wiphy *wiphy;
 #endif
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev = dev_to_sdio_func(dev);
-#endif //ANI_BUS_TYPE_SDIO
 
    ENTER();
 #ifdef CONFIG_CFG80211
@@ -4087,12 +3986,6 @@
    //Save the adapter context in global context for future.
    ((VosContextType*)(pVosContext))->pHDDContext = (v_VOID_t*)pHddCtx;
 
-#ifdef ANI_BUS_TYPE_SDIO
-   // Set the private data for the device to our adapter.
-   libra_sdio_setprivdata (sdio_func_dev, pHddCtx);
-   atomic_set(&pHddCtx->sdio_claim_count, 0);
-#endif // ANI_BUS_TYPE_SDIO
-
    pHddCtx->parent_dev = dev;
 
    init_completion(&pHddCtx->full_pwr_comp_var);
@@ -4205,88 +4098,45 @@
    pHddCtx->isLogpInProgress = FALSE;
    vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE);
 
-#ifdef ANI_BUS_TYPE_SDIO
-   status = WLANBAL_Open(pHddCtx->pvosContext);
-   if(!VOS_IS_STATUS_SUCCESS(status))
-   {
-     VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-        "%s: Failed to open BAL",__func__);
-      goto err_wdclose;
-   }
-#endif // ANI_BUS_TYPE_SDIO
-
    status = vos_chipVoteOnXOBuffer(NULL, NULL, NULL);
    if(!VOS_IS_STATUS_SUCCESS(status))
    {
       hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed to configure 19.2 MHz Clock", __func__);
-#ifdef ANI_BUS_TYPE_SDIO
-      goto err_balclose;
-#else
       goto err_wdclose;
-#endif
    }
 
-
-#ifdef ANI_BUS_TYPE_SDIO
-   status = WLANSAL_Start(pHddCtx->pvosContext);
-   if (!VOS_IS_STATUS_SUCCESS(status))
-   {
-      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed to start SAL",__func__);
-      goto err_clkvote;
-   }
-
-  /* Start BAL */
-  status = WLANBAL_Start(pHddCtx->pvosContext);
-
-  if (!VOS_IS_STATUS_SUCCESS(status))
-   {
-     VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-              "%s: Failed to start BAL",__func__);
-     goto err_salstop;
-  }
-#endif // ANI_BUS_TYPE_SDIO
-
-#ifdef MSM_PLATFORM_7x30
-   /* FIXME: Volans 2.0 configuration. Reconfigure 1.3v SW supply to 1.3v. It will be configured to
-    * 1.4v in vos_ChipPowerup() routine above
-    */
-#endif
-
    status = vos_open( &pVosContext, 0);
    if ( !VOS_IS_STATUS_SUCCESS( status ))
    {
-      hddLog(VOS_TRACE_LEVEL_FATAL,"%s: vos_open failed",__func__);
-      goto err_balstop;   
+      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_open failed", __func__);
+      goto err_clkvote;
    }
 
-   /* Save the hal context in Adapter */
    pHddCtx->hHal = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, pVosContext );
 
    if ( NULL == pHddCtx->hHal )
    {
-      hddLog(VOS_TRACE_LEVEL_FATAL,"%s: HAL context is null",__func__);      
+      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: HAL context is null", __func__);
       goto err_vosclose;
    }
 
-#ifdef FEATURE_WLAN_INTEGRATED_SOC
-      /* Vos preStart is calling */
-      /* vos preStart which does cfg download should be called before set sme config which accesses/sets some cfgs */
-      status = vos_preStart( pHddCtx->pvosContext );
-      if ( !VOS_IS_STATUS_SUCCESS( status ) )
-      {
-         hddLog(VOS_TRACE_LEVEL_FATAL,"%s: vos_preStart failed",__func__);
-         goto err_vosclose;
-      }
-#endif
+   status = vos_preStart( pHddCtx->pvosContext );
+   if ( !VOS_IS_STATUS_SUCCESS( status ) )
+   {
+      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_preStart failed", __func__);
+      goto err_vosclose;
+   }
 
-   // Set the SME configuration parameters...
+   /* Note that the vos_preStart() sequence triggers the cfg download.
+      The cfg download must occur before we update the SME config
+      since the SME config operation must access the cfg database */
    status = hdd_set_sme_config( pHddCtx );
 
    if ( VOS_STATUS_SUCCESS != status )
    {
-      hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Failed hdd_set_sme_config",__func__); 
-         goto err_vosclose;
-      }
+      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed hdd_set_sme_config", __func__);
+      goto err_vosclose;
+   }
 
    //Initialize the WMM module
    status = hdd_wmm_init(pHddCtx);
@@ -4360,7 +4210,7 @@
       else
 #endif //WLAN_AUTOGEN_MACADDR_FEATURE
       {
-      hddLog(VOS_TRACE_LEVEL_ERROR,
+         hddLog(VOS_TRACE_LEVEL_ERROR,
                 "%s: Invalid MAC address in NV, using MAC from ini file "
                 MAC_ADDRESS_STR, __func__,
                 MAC_ADDR_ARRAY(pHddCtx->cfg_ini->intfMacAddr[0].bytes));
@@ -4462,12 +4312,8 @@
 
    if( pAdapter == NULL )
    {
-     hddLog(VOS_TRACE_LEVEL_ERROR,"%s: hdd_open_adapter failed",__func__);
-#ifdef ANI_BUS_TYPE_SDIO
-     goto err_balstop;
-#else
-     goto err_close_adapter;
-#endif
+      hddLog(VOS_TRACE_LEVEL_ERROR, "%s: hdd_open_adapter failed", __func__);
+      goto err_close_adapter;
    }
 
 #ifdef WLAN_BTAMP_FEATURE
@@ -4654,28 +4500,8 @@
    }
    vos_close(pVosContext ); 
 
-err_balstop:
-#ifdef ANI_BUS_TYPE_SDIO
-#ifndef ANI_MANF_DIAG
-       wlan_hdd_enable_deepsleep(pHddCtx->pvosContext);
-#endif
-
-   WLANBAL_Stop(pHddCtx->pvosContext);
-   WLANBAL_SuspendChip(pHddCtx->pvosContext);
-#endif
-
-#ifdef ANI_BUS_TYPE_SDIO
-err_salstop:
-   WLANSAL_Stop(pHddCtx->pvosContext);
-
 err_clkvote:
-#endif
-    vos_chipVoteOffXOBuffer(NULL, NULL, NULL);
-
-#ifdef ANI_BUS_TYPE_SDIO
-err_balclose:
-   WLANBAL_Close(pHddCtx->pvosContext);
-#endif // ANI_BUS_TYPE_SDIO
+   vos_chipVoteOffXOBuffer(NULL, NULL, NULL);
 
 err_wdclose:
    if(pHddCtx->cfg_ini->fIsLogpEnabled)
@@ -4731,10 +4557,6 @@
 {
    VOS_STATUS status;
    v_CONTEXT_t pVosContext = NULL;
-#ifdef ANI_BUS_TYPE_SDIO
-   struct sdio_func *sdio_func_dev = NULL;
-   unsigned int attempts = 0;
-#endif // ANI_BUS_TYPE_SDIO
    struct device *dev = NULL;
    int ret_status = 0;
 
@@ -4756,71 +4578,6 @@
       return -EIO;
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   //SDIO Polling should be turned on for card detection. When using Android Wi-Fi GUI
-   //users need not trigger SDIO polling explicitly. However when loading drivers via
-   //command line (Adb shell), users must turn on SDIO polling prior to loading WLAN.
-   do {
-      sdio_func_dev = libra_getsdio_funcdev();
-      if (NULL == sdio_func_dev) {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN not detected yet.",__func__);
-         attempts++;
-      }
-      else {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN detecton succeeded",__func__);
-         dev = &sdio_func_dev->dev;
-         break;
-      }
-
-      if(attempts == 7)
-         break;
-
-      msleep(250);
-
-   }while (attempts < 7);
-
-   //Retry to detect the card again by Powering Down the chip and Power up the chip
-   //again. This retry is done to recover from CRC Error
-   if (NULL == sdio_func_dev) {
-
-      attempts = 0;
-
-      //Vote off any PMIC voltage supplies
-      vos_chipPowerDown(NULL, NULL, NULL);
-
-      msleep(1000);
-
-      //Power Up Libra WLAN card first if not already powered up
-      status = vos_chipPowerUp(NULL,NULL,NULL);
-      if (!VOS_IS_STATUS_SUCCESS(status))
-      {
-         hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Retry Libra WLAN not Powered Up. "
-             "exiting", __func__);
-         return -EIO;
-      }
-
-      do {
-         sdio_func_dev = libra_getsdio_funcdev();
-         if (NULL == sdio_func_dev) {
-            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Retry Libra WLAN not detected yet.",__func__);
-            attempts++;
-         }
-         else {
-            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Retry Libra WLAN detecton succeeded",__func__);
-            dev = &sdio_func_dev->dev;
-            break;
-         }
-
-         if(attempts == 2)
-           break;
-
-         msleep(1000);
-
-      }while (attempts < 3);
-   }
-
-#endif // ANI_BUS_TYPE_SDIO
-
 #ifdef ANI_BUS_TYPE_PCI
 
    dev = wcnss_wlan_get_device();
@@ -4857,21 +4614,6 @@
          break;
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   /* Now Open SAL */
-   status = WLANSAL_Open(pVosContext, 0);
-
-   if(!VOS_IS_STATUS_SUCCESS(status))
-   {
-         hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Failed to open SAL", __func__);
-
-      /* If unable to open, cleanup and return failure */
-      vos_preClose( &pVosContext );
-         ret_status = -1;
-         break;
-   }
-#endif // ANI_BUS_TYPE_SDIO
-
 #ifndef MODULE
       /* For statically linked driver, call hdd_set_conparam to update curr_con_mode
        */
@@ -4879,12 +4621,10 @@
 #endif
 
       // Call our main init function
-      if(hdd_wlan_startup(dev)) {
+      if (hdd_wlan_startup(dev))
+      {
          hddLog(VOS_TRACE_LEVEL_FATAL,"%s: WLAN Driver Initialization failed",
-          __func__);
-#ifdef ANI_BUS_TYPE_SDIO
-         WLANSAL_Close(pVosContext);
-#endif // ANI_BUS_TYPE_SDIO
+                __func__);
          vos_preClose( &pVosContext );
          ret_status = -1;
          break;
@@ -5013,10 +4753,6 @@
       hdd_wlan_exit(pHddCtx);
    }
 
-#ifdef ANI_BUS_TYPE_SDIO
-   WLANSAL_Close(pVosContext);
-#endif // ANI_BUS_TYPE_SDIO
-
    vos_preClose( &pVosContext );
 
 #ifdef TIMER_MANAGER
@@ -5164,9 +4900,6 @@
 {
     v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext;
     VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
-#ifdef FEATURE_WLAN_NON_INTEGRATED_SOC
-    tHalHandle hHalHandle;
-#endif
 
     ENTER();
 
diff --git a/CORE/VOSS/src/vos_power.c b/CORE/VOSS/src/vos_power.c
index a43f1d5..792c097 100644
--- a/CORE/VOSS/src/vos_power.c
+++ b/CORE/VOSS/src/vos_power.c
@@ -93,10 +93,6 @@
 ===========================================================================*/
 #include <vos_power.h>
 
-#ifdef ANI_BUS_TYPE_SDIO
-#include <libra_sdioif.h>
-#endif
-
 #ifdef MSM_PLATFORM
 #include <mach/mpp.h>
 #include <mach/vreg.h>
@@ -623,29 +619,6 @@
 )
 {
 
-#ifdef ANI_BUS_TYPE_SDIO
-#ifdef MSM_PLATFORM
-   struct sdio_func *sdio_func_dev = NULL;
-
-   // Get the SDIO func device
-   sdio_func_dev = libra_getsdio_funcdev();
-   if (sdio_func_dev == NULL)
-   {
-      VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN sdio device is NULL \n"
-             "exiting", __func__);
-   }
-   else 
-   {
-      // Set sdio clock to lower config cycle frequency before chip power down.
-      // Setting this low freq, will also internally in msm_sdcc disable power save.
-      // Once the card is power down and powered up and detected
-      // after the config cycles the clock freq will be set back up
-      // to our capability of 50MHz
-      libra_sdio_set_clock(sdio_func_dev, WLAN_LOW_SD_CONFIG_CLOCK_FREQ);
-   }
-#endif
-#endif
-
 #ifdef MSM_PLATFORM_8660
    if(vos_chip_power_qrf8615(CHIP_POWER_OFF))
       return VOS_STATUS_E_FAILURE;
diff --git a/CORE/WDA/inc/legacy/palTypes.h b/CORE/WDA/inc/legacy/palTypes.h
index d116322..260fb33 100644
--- a/CORE/WDA/inc/legacy/palTypes.h
+++ b/CORE/WDA/inc/legacy/palTypes.h
@@ -97,35 +97,23 @@
 //
 #if defined(ANI_BUS_TYPE_PCI)
 
-#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_USB ) || defined(ANI_BUS_TYPE_SDIO) || defined( ANI_BUS_TYPE_PLATFORM )
+#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_PLATFORM )
 #error "more than one ANI_BUS_TYPE_xxx is defined for this build"
 #endif //
 
 #elif defined( ANI_BUS_TYPE_PCIe )
 
-#if defined( ANI_BUS_TYPE_PCI ) || defined( ANI_BUS_TYPE_USB ) || defined(ANI_BUS_TYPE_SDIO) || defined( ANI_BUS_TYPE_PLATFORM )
-#error "more than one ANI_BUS_TYPE_xxx is defined for this build"
-#endif
-
-#elif defined( ANI_BUS_TYPE_USB )
-
-#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_PCI ) || defined(ANI_BUS_TYPE_SDIO) || defined( ANI_BUS_TYPE_PLATFORM )
-#error "more than one ANI_BUS_TYPE_xxx is defined for this build"
-#endif
-
-#elif defined( ANI_BUS_TYPE_SDIO )
-
-#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_USB ) || defined(ANI_BUS_TYPE_PCI) || defined( ANI_BUS_TYPE_PLATFORM )
+#if defined( ANI_BUS_TYPE_PCI ) || defined( ANI_BUS_TYPE_PLATFORM )
 #error "more than one ANI_BUS_TYPE_xxx is defined for this build"
 #endif
 
 #elif defined( ANI_BUS_TYPE_PLATFORM )
 
-#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_USB ) || defined(ANI_BUS_TYPE_PCI) || defined( ANI_BUS_TYPE_SDIO )
+#if defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI)
 #error "more than one ANI_BUS_TYPE_xxx is defined for this build"
 #endif
 
-#elif !( defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_USB ) || defined(ANI_BUS_TYPE_PCI) || defined(ANI_BUS_TYPE_SDIO) || defined( ANI_BUS_TYPE_PLATFORM ) )
+#elif !( defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI) || defined( ANI_BUS_TYPE_PLATFORM ) )
 
 #error "NONE of the ANI_BUS_TYPE_xxx are defined for this build"