merge in mnc-dr-ryu-release history after reset to mnc-dr-dev
diff --git a/qcwcn/wifi_hal/Android.mk b/qcwcn/wifi_hal/Android.mk
index 816e018..14676ff 100644
--- a/qcwcn/wifi_hal/Android.mk
+++ b/qcwcn/wifi_hal/Android.mk
@@ -19,6 +19,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_CFLAGS := -Wno-unused-parameter
+LOCAL_CFLAGS += -DNAN_2_0
 
 # gscan.cpp: address of array 'cached_results[i].results' will always evaluate to 'true'
 LOCAL_CLANG_CFLAGS := -Wno-pointer-bool-conversion
diff --git a/qcwcn/wifi_hal/common.cpp b/qcwcn/wifi_hal/common.cpp
index 89ff67a..a8f5e30 100644
--- a/qcwcn/wifi_hal/common.cpp
+++ b/qcwcn/wifi_hal/common.cpp
@@ -394,7 +394,7 @@
     bool lowi_get_capabilities_support = false;
 
     if (requested_lowi_capabilities == GSCAN_SUPPORTED) {
-        ALOGI("%s: Returning Null, GSCAN not supported by lowi",
+        ALOGV("%s: Returning Null, GSCAN not supported by lowi",
               __FUNCTION__);
         return NULL;
     }
diff --git a/qcwcn/wifi_hal/cpp_bindings.cpp b/qcwcn/wifi_hal/cpp_bindings.cpp
index 6a1a8f0..381d8c8 100644
--- a/qcwcn/wifi_hal/cpp_bindings.cpp
+++ b/qcwcn/wifi_hal/cpp_bindings.cpp
@@ -849,7 +849,6 @@
 
     //insert the iface id to be "wlan0"
     ifindex = if_nametoindex("wlan0");
-    ALOGE("%s ifindex obtained:%d",__FUNCTION__,ifindex);
     mMsg.set_iface_id(ifindex);
 out:
     return ret;
@@ -971,7 +970,6 @@
 int WifiVendorCommand::set_iface_id(const char* name)
 {
     unsigned ifindex = if_nametoindex(name);
-    ALOGE("%s ifindex obtained:%d", __FUNCTION__,ifindex);
     return mMsg.set_iface_id(ifindex);
 }
 
diff --git a/qcwcn/wifi_hal/gscan.cpp b/qcwcn/wifi_hal/gscan.cpp
index e38a879..4d40432 100644
--- a/qcwcn/wifi_hal/gscan.cpp
+++ b/qcwcn/wifi_hal/gscan.cpp
@@ -98,7 +98,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->get_valid_channels == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->get_valid_channels(handle, band, max_channels,
                           channels, num_channels);
@@ -111,7 +111,7 @@
      * Generate one randomly.
      */
     requestId = get_requestid();
-    ALOGI("%s: RequestId:%d Enter band:%d max_channels:%d", __FUNCTION__,
+    ALOGI("%s: RequestId:%d band:%d max_channels:%d", __FUNCTION__,
           requestId, band, max_channels);
 
     if (channels == NULL) {
@@ -170,7 +170,6 @@
 
 cleanup:
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -196,7 +195,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->get_gscan_capabilities == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->get_gscan_capabilities(handle,
                                                      capabilities);
@@ -209,7 +208,7 @@
      * Generate it randomly.
      */
     requestId = get_requestid();
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, requestId);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, requestId);
 
     if (capabilities == NULL) {
         ALOGE("%s: NULL capabilities pointer provided. Exit.",
@@ -267,7 +266,6 @@
 cleanup:
     gScanCommand->freeRspParams(eGScanGetCapabilitiesRspParams);
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -304,7 +302,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->start_gscan  == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->start_gscan(id, iface, params, handler);
         ALOGI("%s: lowi start_gscan "
@@ -312,7 +310,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d ", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d ", __FUNCTION__, id);
     /* Wi-Fi HAL doesn't need to check if a similar request to start gscan was
      *  made earlier. If start_gscan() is called while another gscan is already
      *  running, the request will be sent down to driver and firmware. If new
@@ -497,7 +495,6 @@
             __FUNCTION__, ret);
         gScanStartCmdEventHandler->disableEventHandling();
     }
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 
 }
@@ -529,7 +526,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->stop_gscan == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->stop_gscan(id, iface);
         ALOGI("%s: lowi stop_gscan "
@@ -537,7 +534,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
     if (gScanStartCmdEventHandler == NULL ||
         gScanStartCmdEventHandler->isEventHandlingEnabled() == false) {
         ALOGE("%s: GSCAN isn't running or already stopped. "
@@ -590,7 +587,6 @@
 
 cleanup:
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -625,7 +621,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->set_bssid_hotlist == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->set_bssid_hotlist(id, iface, params,handler);
         ALOGI("%s: lowi set_bssid_hotlist "
@@ -633,7 +629,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     /* Wi-Fi HAL doesn't need to check if a similar request to set bssid
      * hotlist was made earlier. If set_bssid_hotlist() is called while
@@ -771,7 +767,6 @@
             __FUNCTION__, ret);
         gScanSetBssidHotlistCmdEventHandler->disableEventHandling();
     }
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -802,7 +797,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->reset_bssid_hotlist == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->reset_bssid_hotlist(id, iface);
         ALOGI("%s: lowi reset_bssid_hotlist "
@@ -810,7 +805,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     if (gScanSetBssidHotlistCmdEventHandler == NULL ||
         (gScanSetBssidHotlistCmdEventHandler->isEventHandlingEnabled() ==
@@ -865,7 +860,6 @@
 
 cleanup:
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -900,7 +894,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->set_significant_change_handler == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->set_significant_change_handler(id,
                                                              iface,
@@ -911,7 +905,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     /* Wi-Fi HAL doesn't need to check if a similar request to set significant
      * change list was made earlier. If set_significant_change() is called while
@@ -1061,7 +1055,6 @@
         gScanSetSignificantChangeCmdEventHandler->disableEventHandling();
     }
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -1093,7 +1086,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->reset_significant_change_handler == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->reset_significant_change_handler(id, iface);
         ALOGI("%s: lowi reset_significant_change_handler "
@@ -1101,7 +1094,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     if (gScanSetSignificantChangeCmdEventHandler == NULL ||
         (gScanSetSignificantChangeCmdEventHandler->isEventHandlingEnabled() ==
@@ -1158,7 +1151,6 @@
 
 cleanup:
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -1193,7 +1185,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->get_cached_gscan_results == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->get_cached_gscan_results(iface,
                                                        flush,
@@ -1208,7 +1200,7 @@
     /* No request id from caller, so generate one and pass it on to the driver. */
     /* Generate it randomly */
     requestId = get_requestid();
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, requestId);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, requestId);
 
     if (results == NULL || num == NULL) {
         ALOGE("%s: NULL pointer provided. Exit.",
@@ -1307,7 +1299,6 @@
 cleanup:
     gScanCommand->freeRspParams(eGScanGetCachedResultsRspParams);
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -1320,8 +1311,6 @@
     interface_info *iinfo = getIfaceInfo(handle);
     wifi_handle wifiHandle = getWifiHandle(handle);
 
-    ALOGI("%s: Enter", __FUNCTION__);
-
     vCommand = new WifiVendorCommand(wifiHandle, 0,
             OUI_QCA,
             QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI);
@@ -1344,7 +1333,8 @@
     if (!nlData)
         goto cleanup;
 
-    ALOGI("MAC_OUI - %02x:%02x:%02x", scan_oui[0], scan_oui[1], scan_oui[2]);
+    ALOGI("%s: MAC_OUI - %02x:%02x:%02x", __FUNCTION__,
+          scan_oui[0], scan_oui[1], scan_oui[2]);
 
     /* Add the fixed part of the mac_oui to the nl command */
     ret = vCommand->put_bytes(
@@ -1364,7 +1354,6 @@
 
 cleanup:
     delete vCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -1400,7 +1389,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->set_ssid_hotlist == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->set_ssid_hotlist(id, iface, params,handler);
         ALOGI("%s: lowi set_ssid_hotlist "
@@ -1408,7 +1397,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     /* Wi-Fi HAL doesn't need to check if a similar request to set ssid
      * hotlist was made earlier. If set_ssid_hotlist() is called while
@@ -1552,7 +1541,6 @@
             __FUNCTION__, ret);
         gScanSetSsidHotlistCmdEventHandler->disableEventHandling();
     }
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -1583,7 +1571,7 @@
     lowiWifiHalApi = getLowiCallbackTable(GSCAN_SUPPORTED);
     if (lowiWifiHalApi == NULL ||
         lowiWifiHalApi->reset_ssid_hotlist == NULL) {
-        ALOGI("%s: Sending cmd directly to host", __FUNCTION__);
+        ALOGD("%s: Sending cmd directly to host", __FUNCTION__);
     } else {
         ret = lowiWifiHalApi->reset_ssid_hotlist(id, iface);
         ALOGI("%s: lowi reset_ssid_hotlist "
@@ -1591,7 +1579,7 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     if (gScanSetSsidHotlistCmdEventHandler == NULL ||
         (gScanSetSsidHotlistCmdEventHandler->isEventHandlingEnabled() ==
@@ -1646,7 +1634,6 @@
 
 cleanup:
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -1694,8 +1681,10 @@
     if (ret < 0)
         goto out;
 
+#ifdef QC_HAL_DEBUG
      ALOGI("%s: mVendor_id = %d, Subcmd = %d.",
         __FUNCTION__, mVendor_id, mSubcmd);
+#endif
 
 out:
     return ret;
@@ -1966,7 +1955,7 @@
 int GScanCommand::gscan_parse_capabilities(struct nlattr **tbVendor)
 {
     if (!mGetCapabilitiesRspParams){
-        ALOGE("%s: mGetCapabilitiesRspParams ptr is NULL. Exit. ",
+        ALOGE("%s: mGetCapabilitiesRspParams ptr is NULL. Exit.",
             __FUNCTION__);
         return WIFI_ERROR_INVALID_ARGS;
     }
@@ -2420,7 +2409,7 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     /* Wi-Fi HAL doesn't need to check if a similar request to set ePNO
      * list was made earlier. If wifi_set_epno_list() is called while
@@ -2566,7 +2555,6 @@
             __FUNCTION__, ret);
         gScanSetPnoListCmdEventHandler->disableEventHandling();
     }
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -2596,7 +2584,7 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     /* Wi-Fi HAL doesn't need to check if a similar request to set ePNO
      * passpoint list was made earlier. If wifi_set_passpoint_list() is called
@@ -2741,7 +2729,6 @@
             __FUNCTION__, ret);
         gScanPnoSetPasspointListCmdEventHandler->disableEventHandling();
     }
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -2767,13 +2754,13 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     if (gScanPnoSetPasspointListCmdEventHandler == NULL ||
         (gScanPnoSetPasspointListCmdEventHandler->isEventHandlingEnabled() ==
          false)) {
         ALOGE("wifi_reset_passpoint_list: ePNO passpoint_list isn't set. "
-            "Nothing to do. Exit");
+            "Nothing to do. Exit.");
         return WIFI_ERROR_NOT_AVAILABLE;
     }
 
@@ -2832,7 +2819,6 @@
 
 cleanup:
     delete gScanCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 }
 
@@ -2935,8 +2921,6 @@
     int i;
     wifi_cached_scan_results *cachedResultRsp;
 
-    ALOGI("%s: Enter", __FUNCTION__);
-
     if (mGetCachedResultsRspParams && cached_results)
     {
         /* Populate the number of parsed cached results. */
@@ -2966,7 +2950,6 @@
         *numResults = 0;
         ret = WIFI_ERROR_INVALID_ARGS;
     }
-    ALOGI("%s: Exit", __FUNCTION__);
     return ret;
 }
 
@@ -3013,7 +2996,7 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     ALOGI("Number of SSIDs : %d", num_networks);
     for (i = 0; i < num_networks; i++) {
@@ -3081,7 +3064,6 @@
 
 cleanup:
     delete roamCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 
 }
@@ -3103,7 +3085,7 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     if(params) {
         ALOGI("A_band_boost_threshold   %d", params->A_band_boost_threshold);
@@ -3180,7 +3162,6 @@
 
 cleanup:
     delete roamCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 
 }
@@ -3250,7 +3231,6 @@
 
 cleanup:
     delete roamCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 
 }
@@ -3273,7 +3253,7 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     ALOGI("Number of BSSIDs: %d", num_bssid);
     if(prefs && num_bssid) {
@@ -3352,7 +3332,6 @@
 
 cleanup:
     delete roamCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 
 }
@@ -3374,7 +3353,7 @@
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
-    ALOGI("%s: Enter RequestId:%d", __FUNCTION__, id);
+    ALOGI("%s: RequestId:%d", __FUNCTION__, id);
 
     for (i = 0; i < params.num_bssid; i++) {
         ALOGI("BSSID: %d : %02x:%02x:%02x:%02x:%02x:%02x", i,
@@ -3443,7 +3422,6 @@
 
 cleanup:
     delete roamCommand;
-    ALOGI("%s: Exit.", __FUNCTION__);
     return (wifi_error)ret;
 
 }
diff --git a/qcwcn/wifi_hal/gscan_event_handler.cpp b/qcwcn/wifi_hal/gscan_event_handler.cpp
index b60ff0e..371bc94 100644
--- a/qcwcn/wifi_hal/gscan_event_handler.cpp
+++ b/qcwcn/wifi_hal/gscan_event_handler.cpp
@@ -84,6 +84,9 @@
     mHotlistApFoundResults = NULL;
     mHotlistApFoundNumResults = 0;
     mHotlistApFoundMoreData = false;
+    mHotlistApLostResults = NULL;
+    mHotlistApLostNumResults = 0;
+    mHotlistApLostMoreData = false;
     mSignificantChangeResults = NULL;
     mSignificantChangeNumResults = 0;
     mSignificantChangeMoreData = false;
diff --git a/qcwcn/wifi_hal/llstats.cpp b/qcwcn/wifi_hal/llstats.cpp
index f8c63f8..f900054 100644
--- a/qcwcn/wifi_hal/llstats.cpp
+++ b/qcwcn/wifi_hal/llstats.cpp
@@ -47,7 +47,6 @@
     if (ret < 0)
         goto out;
 
-    ALOGI("mVendor_id = %d, Subcmd = %d in  %s:%d\n", mVendor_id, mSubcmd, __func__, __LINE__);
 out:
     return ret;
 }
@@ -55,7 +54,6 @@
 LLStatsCommand::LLStatsCommand(wifi_handle handle, int id, u32 vendor_id, u32 subcmd)
         : WifiVendorCommand(handle, id, vendor_id, subcmd)
 {
-    ALOGV("LLStatsCommand %p constructed", this);
     memset(&mClearRspParams, 0,sizeof(LLStatsClearRspParams));
     memset(&mResultsParams, 0,sizeof(LLStatsResultsParams));
     memset(&mHandler, 0,sizeof(mHandler));
@@ -63,7 +61,6 @@
 
 LLStatsCommand::~LLStatsCommand()
 {
-    ALOGW("LLStatsCommand %p distructor", this);
     mLLStatsCommandInstance = NULL;
 }
 
@@ -77,7 +74,6 @@
         mLLStatsCommandInstance = new LLStatsCommand(handle, 0,
                 OUI_QCA,
                 QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET);
-        ALOGV("LLStatsCommand %p created", mLLStatsCommandInstance);
         return mLLStatsCommandInstance;
     }
     else
@@ -90,7 +86,6 @@
             mLLStatsCommandInstance->mInfo = (hal_info *)handle;
         }
     }
-    ALOGV("LLStatsCommand %p created already", mLLStatsCommandInstance);
     return mLLStatsCommandInstance;
 }
 
@@ -976,7 +971,6 @@
                     {
                         ALOGE("%s:QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS"
                                 " not found", __func__);
-                        ALOGE("Expecting Peer stats event");
                     } else {
                         mResultsParams.iface_stat->num_peers =
                             nla_get_u32(tb_vendor[
@@ -985,7 +979,6 @@
                                 mResultsParams.iface_stat->num_peers);
                         if(mResultsParams.iface_stat->num_peers == 0)
                         {
-                            ALOGE("Not Expecting Peer stats event");
                             // Number of Radios are 1 for now
                             mHandler.on_link_stats_results(mRequestId,
                                     mResultsParams.iface_stat,
@@ -1202,6 +1195,8 @@
     interface_info *iinfo = getIfaceInfo(iface);
     wifi_handle handle = getWifiHandle(iface);
 
+    ALOGI("mpdu_size_threshold : %u, aggressive_statistics_gathering : %u",
+          params.mpdu_size_threshold, params.aggressive_statistics_gathering);
     LLCommand = LLStatsCommand::instance(handle);
     if (LLCommand == NULL) {
         ALOGE("%s: Error LLStatsCommand NULL", __func__);
@@ -1314,6 +1309,7 @@
     interface_info *iinfo = getIfaceInfo(iface);
     wifi_handle handle = getWifiHandle(iface);
 
+    ALOGI("clear_req : %x, stop_req : %u", stats_clear_req_mask, stop_req);
     LLCommand = LLStatsCommand::instance(handle);
     if (LLCommand == NULL) {
         ALOGE("%s: Error LLStatsCommand NULL", __func__);
diff --git a/qcwcn/wifi_hal/nan_ind.cpp b/qcwcn/wifi_hal/nan_ind.cpp
index 85d747d..78daf89 100755
--- a/qcwcn/wifi_hal/nan_ind.cpp
+++ b/qcwcn/wifi_hal/nan_ind.cpp
@@ -898,9 +898,16 @@
               __func__, pFam->numchans);
         return -1;
     }
+
+    if (length < (sizeof(u8) +
+        (pFam->numchans * sizeof(NanFurtherAvailabilityChan)))) {
+        ALOGE("%s: Invalid TLV Length", __func__);
+        return -1;
+    }
+
     for (idx = 0; idx < pFam->numchans; idx++) {
         pNanFurtherAvailabilityChan pRsp = \
-              (pNanFurtherAvailabilityChan)(pInValue[1] + \
+              (pNanFurtherAvailabilityChan)((u8 *)&pInValue[1] + \
               (idx * sizeof(NanFurtherAvailabilityChan)));
         NanFurtherAvailabilityChannel *pFamChan = &pFam->famchan[idx];
 
diff --git a/qcwcn/wifi_hal/nan_req.cpp b/qcwcn/wifi_hal/nan_req.cpp
old mode 100755
new mode 100644
index dd9b787..7eb7d97
--- a/qcwcn/wifi_hal/nan_req.cpp
+++ b/qcwcn/wifi_hal/nan_req.cpp
@@ -1050,9 +1050,8 @@
     const NanFurtherAvailabilityMap *pFam,
     u8 *pOutValue)
 {
-//ToDo: Fixme - build issue
-#if 0
     int idx = 0;
+
     if (pFam && pOutValue) {
         u32 famsize = calcNanFurtherAvailabilityMapSize(pFam);
         pNanFurtherAvailabilityMapAttrTlv pFwReq = \
@@ -1080,7 +1079,6 @@
         ALOGI("%s: Filled FurtherAvailabilityMapVal", __func__);
         hexdump((char*)pOutValue, famsize);
     }
-#endif
     return;
 }
 
@@ -1093,8 +1091,7 @@
         /* Fixed size of u8 for numchans*/
         ret = sizeof(u8);
         /* numchans * sizeof(FamChannels) */
-        //ToDo: Fix build
-        //ret += (pFam->numchans * sizeof(NanFurtherAvailabilityChan));
+        ret += (pFam->numchans * sizeof(NanFurtherAvailabilityChan));
     }
     ALOGI("%s:size:%d", __func__, ret);
     return ret;
diff --git a/qcwcn/wifi_hal/rssi_monitor.cpp b/qcwcn/wifi_hal/rssi_monitor.cpp
index a276b55..06bb835 100644
--- a/qcwcn/wifi_hal/rssi_monitor.cpp
+++ b/qcwcn/wifi_hal/rssi_monitor.cpp
@@ -71,7 +71,6 @@
         mRSSIMonitorCommandInstance = new RSSIMonitorCommand(handle, id,
                 OUI_QCA,
                 QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI);
-        ALOGV("RSSIMonitorCommand %p created", mRSSIMonitorCommandInstance);
         return mRSSIMonitorCommandInstance;
     }
     else
@@ -85,7 +84,6 @@
         }
         mRSSIMonitorCommandInstance->setReqId(id);
     }
-    ALOGV("RSSIMonitorCommand %p created already", mRSSIMonitorCommandInstance);
     return mRSSIMonitorCommandInstance;
 }
 
@@ -130,7 +128,7 @@
              *  request_id value which we're maintaining.
              */
             if (reqId != id()) {
-                ALOGE("%s: Event has Req. ID:%d <> Ours:%d, continue...",
+                ALOGD("%s: Event has Req. ID:%d <> Ours:%d, continue...",
                     __FUNCTION__, reqId, id());
                 reqId = id();
             }
@@ -207,7 +205,8 @@
         return (wifi_error)ret;
     }
 
-    ALOGI("Max RSSI : %d\nMin RSSI : %d", max_rssi, min_rssi);
+    ALOGI("%s: Max RSSI:%d Min RSSI:%d", __FUNCTION__,
+          max_rssi, min_rssi);
     /* Add the vendor specific attributes for the NL command. */
     nlData = vCommand->attr_start(NL80211_ATTR_VENDOR_DATA);
     if (!nlData)
diff --git a/qcwcn/wifi_hal/tdls.cpp b/qcwcn/wifi_hal/tdls.cpp
index af6bdcf..f7eafad 100755
--- a/qcwcn/wifi_hal/tdls.cpp
+++ b/qcwcn/wifi_hal/tdls.cpp
@@ -189,7 +189,6 @@
 
 int TdlsCommand::handleResponse(WifiEvent &reply)
 {
-    ALOGI("Received a TDLS response message from Driver");
     u32 status;
     int i = 0;
     WifiVendorCommand::handleResponse(reply);
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp
index 7d73525..4d5c02e 100644
--- a/qcwcn/wifi_hal/wifi_hal.cpp
+++ b/qcwcn/wifi_hal/wifi_hal.cpp
@@ -127,7 +127,6 @@
         return NULL;
     }
 
-    ALOGI("Socket Value:%p", sock);
     return sock;
 }
 
@@ -323,7 +322,6 @@
 
     memset(info, 0, sizeof(*info));
 
-    ALOGI("Creating socket");
     cmd_sock = wifi_create_nl_socket(WIFI_HAL_CMD_SOCK_PORT,
                                                      NETLINK_GENERIC);
     if (cmd_sock == NULL) {
@@ -338,9 +336,6 @@
                    strerror(errno));
         /* continue anyway with the default (smaller) buffer */
     }
-    else {
-        ALOGI("nl_socket_set_buffer_size for cmd_sock successful");
-    }
 
     event_sock =
         wifi_create_nl_socket(WIFI_HAL_EVENT_SOCK_PORT, NETLINK_GENERIC);
@@ -356,9 +351,6 @@
                    strerror(errno));
         /* continue anyway with the default (smaller) buffer */
     }
-    else {
-        ALOGI("nl_socket_set_buffer_size for event_sock successful");
-    }
 
     cb = nl_socket_get_cb(event_sock);
     if (cb == NULL) {
@@ -406,7 +398,6 @@
         ret = WIFI_ERROR_UNKNOWN;
         goto unload;
     }
-    ALOGI("%s: family_id:%d", __func__, info->nl80211_family_id);
 
     pthread_mutex_init(&info->cb_lock, NULL);
 
@@ -466,7 +457,6 @@
         ret = WIFI_SUCCESS;
     }
 
-    ALOGI("Initializing Wifi Logger Rings");
     ret = wifi_logger_ring_buffers_init(info);
     if (ret != WIFI_SUCCESS) {
         ALOGE("Wifi Logger Ring Initialization Failed");
@@ -723,7 +713,7 @@
                   event.get_cmdString(), vendor_id, subcmd);
         }
     } else {
-        ALOGI("event received %s", event.get_cmdString());
+        ALOGV("event received %s", event.get_cmdString());
     }
 
     // event.log();
@@ -930,7 +920,6 @@
     closedir(d);
 
     info->num_interfaces = n;
-    ALOGI("Found %d interfaces", info->num_interfaces);
 
     return WIFI_SUCCESS;
 }
@@ -1031,7 +1020,6 @@
     }
 
 cleanup:
-    ALOGI("%s: Delete object.", __func__);
     delete vCommand;
     if (ret) {
         *set_size = 0;
diff --git a/qcwcn/wifi_hal/wificonfig.cpp b/qcwcn/wifi_hal/wificonfig.cpp
index 5c41369..e332895 100644
--- a/qcwcn/wifi_hal/wificonfig.cpp
+++ b/qcwcn/wifi_hal/wificonfig.cpp
@@ -46,7 +46,7 @@
     wifi_handle wifiHandle = getWifiHandle(iface);
     hal_info *info = getHalInfo(wifiHandle);
 
-    ALOGD("wifi_extended_dtim_config_set(): Enter");
+    ALOGD("%s: extended_dtim:%d", __FUNCTION__, extended_dtim);
 
     wifiConfigCommand = new WiFiConfigCommand(
                             wifiHandle,
@@ -55,7 +55,7 @@
                             QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION);
 
     if (wifiConfigCommand == NULL) {
-        ALOGE("%s: Error wifiConfigCommand NULL", __func__);
+        ALOGE("%s: Error wifiConfigCommand NULL", __FUNCTION__);
         return WIFI_ERROR_UNKNOWN;
     }
 
@@ -100,7 +100,6 @@
     }
 
 cleanup:
-    ALOGI("%s: Delete object.", __func__);
     delete wifiConfigCommand;
     return (wifi_error)ret;
 }
@@ -116,7 +115,7 @@
     wifi_handle wifiHandle = getWifiHandle(iface);
     hal_info *info = getHalInfo(wifiHandle);
 
-    ALOGD("wifi_set_country_code(): %s", country_code);
+    ALOGD("%s: %s", __FUNCTION__, country_code);
 
     /* No request id from caller, so generate one and pass it on to the driver.
      * Generate it randomly.
@@ -129,7 +128,7 @@
                             OUI_QCA,
                             QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION);
     if (wifiConfigCommand == NULL) {
-        ALOGE("%s: Error wifiConfigCommand NULL", __func__);
+        ALOGE("%s: Error wifiConfigCommand NULL", __FUNCTION__);
         return WIFI_ERROR_UNKNOWN;
     }
 
@@ -155,7 +154,6 @@
     usleep(WAIT_TIME_FOR_SET_REG_DOMAIN);
 
 cleanup:
-    ALOGV("%s: Delete object.", __func__);
     delete wifiConfigCommand;
     return (wifi_error)ret;
 }
@@ -172,14 +170,14 @@
     wifi_handle wifiHandle = getWifiHandle(iface);
     hal_info *info = getHalInfo(wifiHandle);
 
-    ALOGD("wifi_set_beacon_wifi_iface_stats_averaging_factor(): Enter");
+    ALOGD("%s factor:%u", __FUNCTION__, factor);
     wifiConfigCommand = new WiFiConfigCommand(
                             wifiHandle,
                             id,
                             OUI_QCA,
                             QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION);
     if (wifiConfigCommand == NULL) {
-        ALOGE("%s: Error wifiConfigCommand NULL", __func__);
+        ALOGE("%s: Error wifiConfigCommand NULL", __FUNCTION__);
         return WIFI_ERROR_UNKNOWN;
     }
 
@@ -225,7 +223,6 @@
     }
 
 cleanup:
-    ALOGI("%s: Delete object.", __func__);
     delete wifiConfigCommand;
     return (wifi_error)ret;
 }
@@ -241,7 +238,7 @@
     wifi_handle wifiHandle = getWifiHandle(iface);
     hal_info *info = getHalInfo(wifiHandle);
 
-    ALOGD("wifi_set_guard_time(): Enter");
+    ALOGD("%s : guard_time:%u", __FUNCTION__, guard_time);
 
     wifiConfigCommand = new WiFiConfigCommand(
                             wifiHandle,
@@ -249,7 +246,7 @@
                             OUI_QCA,
                             QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION);
     if (wifiConfigCommand == NULL) {
-        ALOGE("%s: Error wifiConfigCommand NULL", __func__);
+        ALOGE("%s: Error wifiConfigCommand NULL", __FUNCTION__);
         return WIFI_ERROR_UNKNOWN;
     }
 
@@ -291,7 +288,6 @@
     }
 
 cleanup:
-    ALOGI("%s: Delete object.", __func__);
     delete wifiConfigCommand;
     return (wifi_error)ret;
 }
@@ -326,16 +322,12 @@
     ret = mMsg.put_u32(NL80211_ATTR_VENDOR_SUBCMD, mSubcmd);
     if (ret < 0)
         goto out;
-
-     ALOGI("%s: mVendor_id = %d, Subcmd = %d.",
-        __func__, mVendor_id, mSubcmd);
 out:
     return ret;
 }
 
 /* This function implements creation of generic NL command */
 int WiFiConfigCommand::create_generic(u8 cmdId) {
-    ALOGI("%s: cmdId = %d", __func__, cmdId);
     int ret = mMsg.create(cmdId, 0, 0);
     return ret;
 }
@@ -354,7 +346,7 @@
     int *ret = (int *)arg;
     tmp = nla;
     *ret = err->error;
-    ALOGE("%s: Error code:%d (%s)", __func__, *ret, strerror(-(*ret)));
+    ALOGE("%s: Error code:%d (%s)", __FUNCTION__, *ret, strerror(-(*ret)));
     return NL_STOP;
 }
 
@@ -393,7 +385,7 @@
 
     cb = nl_cb_alloc(NL_CB_DEFAULT);
     if (!cb) {
-        ALOGE("%s: Callback allocation failed",__func__);
+        ALOGE("%s: Callback allocation failed",__FUNCTION__);
         res = -1;
         goto out;
     }
@@ -421,10 +413,10 @@
         res = mCondition.wait(abstime);
         if (res == ETIMEDOUT)
         {
-            ALOGE("%s: Time out happened.", __func__);
+            ALOGE("%s: Time out happened.", __FUNCTION__);
         }
         ALOGD("%s: Command invoked return value:%d, mWaitForRsp=%d",
-            __func__, res, mWaitforRsp);
+            __FUNCTION__, res, mWaitforRsp);
     }
 out:
     /* Cleanup the mMsg */
diff --git a/qcwcn/wifi_hal/wifilogger.cpp b/qcwcn/wifi_hal/wifilogger.cpp
index 87b1412..277d41c 100644
--- a/qcwcn/wifi_hal/wifilogger.cpp
+++ b/qcwcn/wifi_hal/wifilogger.cpp
@@ -148,7 +148,7 @@
         }
 
     }
-    ALOGI("%s: Logging Started for %s.", __FUNCTION__, buffer_name);
+    ALOGV("%s: Logging Started for %s.", __FUNCTION__, buffer_name);
     rb_start_logging(&info->rb_infos[ring_id], verbose_level,
                     flags, max_interval_sec, min_data_size);
 cleanup:
@@ -616,7 +616,7 @@
 
 WifiLoggerCommand::~WifiLoggerCommand()
 {
-    ALOGD("WifiLoggerCommand %p destructor", this);
+    ALOGV("WifiLoggerCommand %p destructor", this);
     unregisterVendorHandler(mVendor_id, mSubcmd);
 }
 
@@ -636,7 +636,7 @@
     if (ret < 0)
         goto out;
 
-     ALOGI("%s: mVendor_id = %d, Subcmd = %d.",
+     ALOGV("%s: mVendor_id = %d, Subcmd = %d.",
         __FUNCTION__, mVendor_id, mSubcmd);
 
 out:
@@ -749,7 +749,6 @@
     int *ret = (int *)arg;
     struct nl_msg * a;
 
-    ALOGE("%s: called", __FUNCTION__);
     a = msg;
     *ret = 0;
     return NL_STOP;
@@ -761,7 +760,6 @@
   int *ret = (int *)arg;
   struct nl_msg * a;
 
-  ALOGE("%s: called", __FUNCTION__);
   a = msg;
   *ret = 0;
   return NL_SKIP;
@@ -772,8 +770,6 @@
     int res = -1;
     struct nl_cb *cb;
 
-    ALOGD("%s: Entry.", __FUNCTION__);
-
     cb = nl_cb_alloc(NL_CB_DEFAULT);
     if (!cb) {
         ALOGE("%s: Callback allocation failed",__FUNCTION__);
@@ -796,7 +792,7 @@
          nl_recvmsgs(mInfo->cmd_sock, cb);
     }
 
-    ALOGD("%s: Msg sent, res=%d, mWaitForRsp=%d", __FUNCTION__, res, mWaitforRsp);
+    ALOGV("%s: Msg sent, res=%d, mWaitForRsp=%d", __FUNCTION__, res, mWaitforRsp);
     /* Only wait for the asynchronous event if HDD returns success, res=0 */
     if (!res && (mWaitforRsp == true)) {
         struct timespec abstime;
@@ -807,7 +803,7 @@
         {
             ALOGE("%s: Time out happened.", __FUNCTION__);
         }
-        ALOGD("%s: Command invoked return value:%d, mWaitForRsp=%d",
+        ALOGV("%s: Command invoked return value:%d, mWaitForRsp=%d",
             __FUNCTION__, res, mWaitforRsp);
     }
 out:
@@ -822,7 +818,6 @@
 }
 
 int WifiLoggerCommand::handleResponse(WifiEvent &reply) {
-    ALOGD("Received a WifiLogger response message from Driver");
     u32 status;
     int ret = WIFI_SUCCESS;
     int i = 0;
@@ -832,6 +827,7 @@
     FILE* memDumpFilePtr = NULL;
     WifiVendorCommand::handleResponse(reply);
 
+    memset(version_type, 0, 20);
     switch(mSubcmd)
     {
         case QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO:
@@ -900,7 +896,7 @@
             if (!tbVendor[
                 QCA_WLAN_VENDOR_ATTR_LOGGER_RESULTS_MEMDUMP_SIZE]) {
                 ALOGE("%s: LOGGER_RESULTS_MEMDUMP_SIZE not"
-                      "found", __func__);
+                      "found", __FUNCTION__);
                 break;
             }
 
@@ -951,7 +947,7 @@
                     if (numRecordsRead) {
                         remaining -= readSize;
                         buffer += readSize;
-                        ALOGI("%s: Read successful for size:%u "
+                        ALOGV("%s: Read successful for size:%u "
                               "remaining:%u", __func__, readSize,
                               remaining);
                     }
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp
index d5d2346..17443cf 100644
--- a/qcwcn/wifi_hal/wifilogger_diag.cpp
+++ b/qcwcn/wifi_hal/wifilogger_diag.cpp
@@ -1015,7 +1015,7 @@
     else if ((pWlanEapolEvent->eapol_key_info & EAPOL_MASK) == EAPOL_M4_MASK)
         eapol_msg_type = 4;
     else
-        ALOGI("Unknow EAPOL message type \n");
+        ALOGI("Unknown EAPOL message type \n");
     pTlv = addLoggerTlv(WIFI_TAG_EAPOL_MESSAGE_TYPE, sizeof(u32),
                         (u8 *)&eapol_msg_type, pTlv);
     tot_len += sizeof(tlv_log) + sizeof(u32);