wlan: send update channel list request after fw caps are exchanged

The update channel list request was send in csrStart but during
this time the FW capabilities are not exchanged leading to the
failure of the API.
Also the length of the update channel list msg sent to FW is
variable and is causing failure in response from the FW.

With this change the update channel list is sent after FW
capability is exchanged and the message length is made fixed as
expected by FW.

CRs-Fixed: 712497
Change-Id: Id8e9c9537a2496a7d785fee87b124da957bf1071
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 33661c4..92d961a 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -9100,7 +9100,8 @@
    /*SME must send channel update configuration to RIVA*/
    sme_UpdateChannelConfig(pHddCtx->hHal);
 #endif
-
+   /* Send the update default channel list to the FW*/
+   sme_UpdateChannelList(pHddCtx->hHal);
 #ifndef CONFIG_ENABLE_LINUX_REG
    /*updating wiphy so that regulatory user hints can be processed*/
    if (wiphy)
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 353fddb..e246729 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -469,6 +469,21 @@
 
 #endif // FEATURE_WLAN_SCAN_PNLO
 /*--------------------------------------------------------------------------
+
+  \brief sme_UpdateChannelList() - Update channel List in FW.
+
+
+  \param hHal - The handle returned by macOpen.
+
+  \return eHAL_STATUS_SUCCESS - SME update the channel config successfully.
+
+          Other status means SME is failed to update the channel config.
+  \sa
+
+  --------------------------------------------------------------------------*/
+eHalStatus sme_UpdateChannelList(tHalHandle hHal);
+
+/*--------------------------------------------------------------------------
   
   \brief sme_set11dinfo() - Set the 11d information about valid channels
    and there power using information from nvRAM 
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index f27cb9c..9e29d68 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -598,16 +598,6 @@
            smsLog(pMac, LOGW, " csrStart: Couldn't Init HO control blk ");
            break;
         }
-#ifdef QCA_WIFI_2_0
-        if (pMac->fScanOffload)
-        {
-            VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-                    "Scan offload is enabled, update default chan list");
-            status = csrUpdateChannelList(pMac);
-        }
-#else
-        status = csrUpdateChannelList(pMac);
-#endif
 
     }while(0);
 #if defined(ANI_LOGDUMP)
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index ce685a2..3d4d793 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -1346,6 +1346,21 @@
 }
 #endif // FEATURE_WLAN_SCAN_PNLO
 
+eHalStatus sme_UpdateChannelList(tHalHandle hHal)
+{
+    tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+
+    status = csrUpdateChannelList(pMac);
+
+    if (eHAL_STATUS_SUCCESS != status)
+    {
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+                "failed to update the supported channel list");
+    }
+    return status;
+}
+
 /*--------------------------------------------------------------------------
 
   \brief sme_UpdateConfig() - Change configurations for all SME moduels
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index 2ee834a..b85b189 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -26446,9 +26446,7 @@
       return WDI_STATUS_E_FAILURE;
    }
    num_channels = pwdiUpdateChanListParams->wdiUpdateChanParams.numchan;
-   usUpdateChanParamSize =  (sizeof(tUpdateChannelReqType) -
-           ((WLAN_HAL_ROAM_SCAN_MAX_CHANNELS - num_channels) *
-           sizeof(tUpdateChannelParam)));
+   usUpdateChanParamSize =  sizeof(tUpdateChannelReqType);
 
    /*-----------------------------------------------------------------------
      Get message buffer