wlan: fix driver load failure with legacy regulatory code

When driver is compiled without CONFIG_ENABLE_LINUX_REG flag
the function vos_getCurrentCountryCode() is declared and used
but never defined which results in failure to load the driver.
Make sure that the function is not used when using legacy
regulatory code.

Change-Id: I9b1d3b6eb31bf1ecf601f14cf2c75156e581bd35
CRs-Fixed: 759463
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index f269e7c..139d67b 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1457,7 +1457,9 @@
 
 int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter);
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 VOS_STATUS wlan_hdd_init_channels_for_cc(hdd_context_t *pHddCtx,  driver_load_type init  );
+#endif
 
 VOS_STATUS wlan_hdd_cancel_remain_on_channel(hdd_context_t *pHddCtx);
 
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index e6bc201..034ac3c 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -2098,6 +2098,7 @@
       goto err_vosstop;
    }
 
+#ifdef CONFIG_ENABLE_LINUX_REG
    vosStatus = wlan_hdd_init_channels_for_cc(pHddCtx, REINIT);
    if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
    {
@@ -2105,6 +2106,7 @@
              __func__);
       goto err_vosstop;
    }
+#endif
 
 #ifdef WLAN_BTAMP_FEATURE
    vosStatus = WLANBAP_Open(pVosContext);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 73056cc..382bc92 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -10453,6 +10453,7 @@
    }
 }
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 VOS_STATUS wlan_hdd_init_channels_for_cc(hdd_context_t *pHddCtx, driver_load_type init )
 {
    eHalStatus status;
@@ -10469,6 +10470,7 @@
       return VOS_STATUS_E_FAULT;
    }
 }
+#endif
 /*
  * API to find if there is any STA or P2P-Client is connected
  */
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index c2064d5..d6be316 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -1334,12 +1334,14 @@
   -------------------------------------------------------------------------------*/
 eHalStatus csrInitChannels(tpAniSirGlobal pMac);
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 /* ---------------------------------------------------------------------------
     \fn csrInitChannelsForCC
     \brief This function must be called to issue reg hint
     \return eHalStatus
   -------------------------------------------------------------------------------*/
 eHalStatus csrInitChannelsForCC(tpAniSirGlobal pMac, driver_load_type init );
+#endif
 
 /* ---------------------------------------------------------------------------
     \fn csrClose
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 9e8071b..d563784 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -1606,6 +1606,7 @@
 eHalStatus sme_InitChannels(tHalHandle hHal);
 
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 /* ---------------------------------------------------------------------------
     \fn sme_InitChannelsForCC
 
@@ -1620,6 +1621,7 @@
 
  -------------------------------------------------------------------------------*/
 eHalStatus sme_InitChannelsForCC(tHalHandle hHal, driver_load_type init);
+#endif
 
 /* ---------------------------------------------------------------------------
     \fn sme_ResetCountryCodeInformation
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index eea249d..3a17f7e 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -405,6 +405,7 @@
     return status;
 }
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 eHalStatus csrInitChannelsForCC(tpAniSirGlobal pMac, driver_load_type init)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -456,6 +457,7 @@
 
     return status;
 }
+#endif
 
 eHalStatus csrSetRegInfo(tHalHandle hHal,  tANI_U8 *apCntryCode)
 {
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index d105801..0d5d7ee 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -5437,6 +5437,7 @@
     return status;
 }
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 /*-------------------------------------------------------------------------
     \fn sme_InitChannelsForCC
 
@@ -5464,6 +5465,7 @@
 
     return status;
 }
+#endif
 
 /* ---------------------------------------------------------------------------
 
diff --git a/CORE/VOSS/inc/vos_nvitem.h b/CORE/VOSS/inc/vos_nvitem.h
index 05b969c..668f9a1 100644
--- a/CORE/VOSS/inc/vos_nvitem.h
+++ b/CORE/VOSS/inc/vos_nvitem.h
@@ -778,6 +778,7 @@
    void
 );
 
+#ifdef CONFIG_ENABLE_LINUX_REG
 /**------------------------------------------------------------------------
   \brief vos_getCurrentCountryCode -
   \param   countrycode
@@ -789,6 +790,8 @@
 (
    tANI_U8 *cc
 );
+#endif
+
 int vos_update_nv_table_from_wiphy_band(void *hdd_ctx,
                                          void *wiphy,v_U8_t nBandCapability);