浏览代码

qcacld-3.0: Use correct attribute for BTM response target BSSID

Currently driver QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID uses
instead of QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID attribute
in the BTM response event. This causes the target bssid field to
be missed in BTM response print.
The WTC BTM response event is not queued when reason code is
non-zero.

Use QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID attribute.
And queue the WTC btm response event.

Change-Id: Id713bfeda20c43148e95630f5c6e925b80418ca3
CRs-Fixed: 3071242
Pragaspathi Thilagaraj 3 年之前
父节点
当前提交
4a48e7ab4e

+ 7 - 4
components/cmn_services/logging/inc/wlan_connectivity_logging.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -183,10 +184,12 @@ struct wlan_roam_trigger_info {
 
 /**
  * struct wlan_btm_cand_info  - BTM candidate information
+ * @index: Candidate index
  * @preference: Candidate preference
  * @bssid: candidate bssid
  */
 struct wlan_btm_cand_info {
+	uint8_t idx;
 	uint8_t preference;
 	struct qdf_mac_addr bssid;
 };
@@ -219,9 +222,9 @@ struct wlan_roam_btm_info {
 	uint8_t btm_status_code;
 	uint8_t btm_delay;
 	bool is_disassoc_imminent;
-	uint16_t token;
-	uint32_t validity_timer;
-	uint32_t disassoc_timer;
+	uint8_t token;
+	uint8_t validity_timer;
+	uint16_t disassoc_timer;
 	uint32_t wtc_duration;
 	struct qdf_mac_addr target_bssid;
 };
@@ -297,7 +300,7 @@ struct wlan_connect_info {
 #define WLAN_MAX_LOG_RECORDS 45
 #define WLAN_MAX_LOG_LEN     256
 #define WLAN_RECORDS_PER_SEC 20
-#define MAX_RECORD_IN_SINGLE_EVT 7
+#define MAX_RECORD_IN_SINGLE_EVT 5
 
 /**
  * struct wlan_log_record  - Structure for indvidual records in the ring

+ 74 - 29
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -5259,45 +5259,82 @@ cm_roam_btm_query_event(struct wmi_neighbor_report_data *btm_data,
 	return status;
 }
 
-QDF_STATUS
-cm_roam_btm_resp_event(struct wmi_roam_trigger_info *trigger_info,
-		       struct roam_btm_response_data *btm_data,
-		       uint8_t vdev_id, bool is_wtc)
+#define WTC_BTM_RESPONSE_SUBCODE 0xFF
+static void
+cm_roam_wtc_btm_event(struct wmi_roam_trigger_info *trigger_info,
+		      struct roam_btm_response_data *btm_data,
+		      uint8_t vdev_id, bool is_wtc)
 {
 	struct wlan_log_record *log_record = NULL;
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	struct wmi_roam_wtc_btm_trigger_data *wtc_data =
+			&trigger_info->wtc_btm_trig_data;
 
 	log_record = qdf_mem_malloc(sizeof(*log_record));
 	if (!log_record)
-		return QDF_STATUS_E_NOMEM;
+		return;
 
-	if (is_wtc) {
-		struct wmi_roam_wtc_btm_trigger_data *wtc_data =
-				&trigger_info->wtc_btm_trig_data;
+	log_record->log_subtype = WLAN_ROAM_WTC;
 
-		log_record->log_subtype = WLAN_ROAM_WTC;
+	log_record->timestamp_us = qdf_get_time_of_the_day_us();
+	log_record->fw_timestamp_us = trigger_info->timestamp * 1000;
+	log_record->vdev_id = vdev_id;
+	if (is_wtc) {
 		log_record->btm_info.reason = wtc_data->vsie_trigger_reason;
 		log_record->btm_info.sub_reason = wtc_data->sub_code;
+		log_record->btm_info.wtc_duration = wtc_data->duration;
 	} else {
-		log_record->log_subtype = WLAN_BTM_RESP;
-
-		if (btm_data) {
-			log_record->btm_info.token =
-					btm_data->btm_resp_dialog_token;
-			log_record->btm_info.btm_status_code =
-					btm_data->btm_status;
-			log_record->btm_info.btm_delay = btm_data->btm_delay;
-			log_record->btm_info.target_bssid =
-					btm_data->target_bssid;
+		if (!btm_data) {
+			qdf_mem_free(log_record);
+			return;
 		}
-	}
 
-	log_record->timestamp_us = qdf_get_time_of_the_day_us();
-	log_record->fw_timestamp_us = trigger_info->timestamp * 1000;
-	log_record->vdev_id = vdev_id;
+		log_record->btm_info.reason = btm_data->vsie_reason;
+		log_record->btm_info.sub_reason = WTC_BTM_RESPONSE_SUBCODE;
+	}
 
-	status = wlan_connectivity_log_enqueue(log_record);
+	wlan_connectivity_log_enqueue(log_record);
 	qdf_mem_free(log_record);
+}
+
+QDF_STATUS
+cm_roam_btm_resp_event(struct wmi_roam_trigger_info *trigger_info,
+		       struct roam_btm_response_data *btm_data,
+		       uint8_t vdev_id, bool is_wtc)
+{
+	struct wlan_log_record *log_record = NULL;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	if (is_wtc) {
+		cm_roam_wtc_btm_event(trigger_info, btm_data, vdev_id, is_wtc);
+	} else {
+		if (!btm_data) {
+			mlme_err("vdev_id:%d btm data is NULL", vdev_id);
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		log_record = qdf_mem_malloc(sizeof(*log_record));
+		if (!log_record)
+			return QDF_STATUS_E_NOMEM;
+
+		log_record->log_subtype = WLAN_BTM_RESP;
+		log_record->timestamp_us = qdf_get_time_of_the_day_us();
+		log_record->fw_timestamp_us = trigger_info->timestamp * 1000;
+		log_record->vdev_id = vdev_id;
+
+		log_record->btm_info.token =
+				btm_data->btm_resp_dialog_token;
+		log_record->btm_info.btm_status_code =
+				btm_data->btm_status;
+		log_record->btm_info.btm_delay = btm_data->btm_delay;
+		log_record->btm_info.target_bssid =
+				btm_data->target_bssid;
+		status = wlan_connectivity_log_enqueue(log_record);
+		qdf_mem_free(log_record);
+
+		if (btm_data->vsie_reason)
+			cm_roam_wtc_btm_event(trigger_info, btm_data,
+					      vdev_id, is_wtc);
+	}
 
 	return status;
 }
@@ -5311,7 +5348,7 @@ cm_roam_btm_resp_event(struct wmi_roam_trigger_info *trigger_info,
  */
 static QDF_STATUS
 cm_roam_btm_candidate_event(struct wmi_btm_req_candidate_info *btm_data,
-			    uint8_t vdev_id)
+			    uint8_t vdev_id, uint8_t idx)
 {
 	struct wlan_log_record *log_record = NULL;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -5326,6 +5363,7 @@ cm_roam_btm_candidate_event(struct wmi_btm_req_candidate_info *btm_data,
 	log_record->vdev_id = vdev_id;
 	log_record->btm_cand.preference = btm_data->preference;
 	log_record->btm_cand.bssid = btm_data->candidate_bssid;
+	log_record->btm_cand.idx = idx;
 
 	status = wlan_connectivity_log_enqueue(log_record);
 	qdf_mem_free(log_record);
@@ -5352,14 +5390,21 @@ cm_roam_btm_req_event(struct wmi_roam_btm_trigger_data *btm_data,
 
 	log_record->btm_info.token = btm_data->token;
 	log_record->btm_info.mode = btm_data->btm_request_mode;
-	log_record->btm_info.disassoc_timer = btm_data->disassoc_timer;
-	log_record->btm_info.validity_timer = btm_data->validity_interval;
+	/*
+	 * Diassoc Timer and Validity interval are in secs in the frame
+	 * firmware sends it in millisecs to the host.
+	 * Send it in secs to the userspace.
+	 */
+	log_record->btm_info.disassoc_timer =
+			btm_data->disassoc_timer / 1000;
+	log_record->btm_info.validity_timer =
+			btm_data->validity_interval / 1000;
 	log_record->btm_info.candidate_list_count =
 				btm_data->candidate_list_count;
 
 	status = wlan_connectivity_log_enqueue(log_record);
 	for (i = 0; i < log_record->btm_info.candidate_list_count; i++)
-		cm_roam_btm_candidate_event(&btm_data->btm_cand[i], vdev_id);
+		cm_roam_btm_candidate_event(&btm_data->btm_cand[i], vdev_id, i);
 
 	qdf_mem_free(log_record);
 

+ 22 - 10
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -2646,16 +2646,17 @@ cm_roam_stats_get_trigger_detail_str(struct wmi_roam_trigger_info *ptr,
 		break;
 	case ROAM_TRIGGER_REASON_BTM:
 		cm_roam_btm_req_event(&ptr->btm_trig_data, vdev_id);
-		buf_cons = qdf_snprint(temp, buf_left,
-				       "Req_mode: %d Disassoc_timer: %d",
-				       ptr->btm_trig_data.btm_request_mode,
-				       ptr->btm_trig_data.disassoc_timer);
+		buf_cons = qdf_snprint(
+				temp, buf_left,
+				"Req_mode: %d Disassoc_timer: %d",
+				ptr->btm_trig_data.btm_request_mode,
+				ptr->btm_trig_data.disassoc_timer / 1000);
 		temp += buf_cons;
 		buf_left -= buf_cons;
 
 		buf_cons = qdf_snprint(temp, buf_left,
 				"validity_interval: %d candidate_list_cnt: %d resp_status: %d, bss_termination_timeout: %d, mbo_assoc_retry_timeout: %d",
-				ptr->btm_trig_data.validity_interval,
+				ptr->btm_trig_data.validity_interval / 1000,
 				ptr->btm_trig_data.candidate_list_count,
 				ptr->btm_trig_data.btm_resp_status,
 				ptr->btm_trig_data.btm_bss_termination_timeout,
@@ -3188,15 +3189,26 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
 	}
 
 	if (!stats_info->num_tlv) {
+		/*
+		 * wmi_roam_trigger_reason TLV is sent only for userspace
+		 * logging of BTM/WTC frame without roam scans.
+		 */
+		if (stats_info->trigger[0].present &&
+		    stats_info->trigger[0].trigger_reason ==
+		    ROAM_TRIGGER_REASON_BTM)
+			cm_roam_btm_req_event(
+				&stats_info->trigger[0].btm_trig_data,
+				stats_info->vdev_id);
+		else if (stats_info->trigger[0].present &&
+			 stats_info->trigger[0].trigger_reason ==
+			 ROAM_TRIGGER_REASON_WTC_BTM)
+			cm_roam_btm_resp_event(&stats_info->trigger[0], NULL,
+					       stats_info->vdev_id, true);
+
 		if (stats_info->data_11kv[0].present)
 			cm_roam_stats_print_11kv_info(&stats_info->data_11kv[0],
 						      stats_info->vdev_id);
 
-		if (stats_info->trigger[0].present)
-			cm_roam_stats_print_trigger_info(
-						&stats_info->trigger[0],
-						stats_info->vdev_id, 1);
-
 		if (stats_info->scan[0].present &&
 		    stats_info->trigger[0].present)
 			cm_roam_stats_print_scan_info(&stats_info->scan[0],

+ 6 - 6
components/wmi/src/wmi_unified_roam_tlv.c

@@ -2842,24 +2842,24 @@ extract_roam_stats_with_single_tlv(wmi_unified_t wmi_handle, uint8_t *evt_buf,
 	status = wmi_unified_extract_roam_11kv_stats(
 			wmi_handle, evt_buf, &stats_info->data_11kv[0], 0, 0);
 	if (QDF_IS_STATUS_ERROR(status))
-		wmi_err("Roam 11kv stats extract failed vdev %d", vdev_id);
+		wmi_debug("Roam 11kv stats extract failed vdev %d", vdev_id);
 
 	status = wmi_unified_extract_roam_trigger_stats(
 			wmi_handle, evt_buf, &stats_info->trigger[0], 0, 0);
 	if (QDF_IS_STATUS_ERROR(status))
-		wmi_debug_rl("Extract roamtrigger stats failed vdev %d",
-			     vdev_id);
+		wmi_debug("Extract roamtrigger stats failed vdev %d",
+			  vdev_id);
 
 	status = wmi_unified_extract_roam_scan_stats(
 			wmi_handle, evt_buf, &stats_info->scan[0], 0, 0, 0);
 	if (QDF_IS_STATUS_ERROR(status))
-		wmi_debug_rl("Roam scan stats extract failed vdev %d", vdev_id);
+		wmi_debug("Roam scan stats extract failed vdev %d", vdev_id);
 
 	status = wmi_unified_extract_roam_btm_response(
 			wmi_handle, evt_buf, &stats_info->btm_rsp[0], 0);
 	if (QDF_IS_STATUS_ERROR(status))
-		wmi_debug_rl("Roam btm rsp stats extract fail vdev %d",
-			     vdev_id);
+		wmi_debug("Roam btm rsp stats extract fail vdev %d",
+			  vdev_id);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 1 - 0
core/hdd/inc/wlan_hdd_connectivity_logging.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above

+ 90 - 74
core/hdd/src/wlan_hdd_connectivity_logging.c

@@ -31,13 +31,13 @@
 
 /**
  * struct connectivity_log_attr  - Connectivity logging attribute info
- * @attribute_id: Vendor attribute ID
+ * @attribute_id: Vendor attribute ID. Defined by enum qca_wlan_vendor_attr_diag
  * @attribute_type: NL type of the attribute
  * @attribute_length: Length of the attribute
  * @field_offset: Field offset
  */
 struct connectivity_log_attr {
-	uint8_t attribute_id;
+	enum qca_wlan_vendor_attr_diag attribute_id;
 	uint8_t attribute_type;
 	uint16_t attribute_length;
 	uint16_t field_offset;
@@ -136,7 +136,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FREQ,       NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(conn_info.freq)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(conn_info.conn_status)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -232,7 +232,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DEAUTH_RX] = {
 	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE,  NLA_U32,  sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,   NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,     NLA_U8,   sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
@@ -240,9 +240,9 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI,            NLA_S32,  sizeof(int32_t),
 	 GET_ATTR_OFFSET(pkt_info.rssi)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,   NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,  NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.seq_num)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -258,9 +258,9 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI,        NLA_S32, sizeof(int32_t),
 	 GET_ATTR_OFFSET(pkt_info.rssi)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,   NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.seq_num)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -270,15 +270,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(log_subtype)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,   NLA_U64,  sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
 	 GET_ATTR_OFFSET(bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
 	 GET_ATTR_OFFSET(pkt_info.rssi)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,   NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.seq_num)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -288,15 +288,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(log_subtype)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64,  sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
 	 GET_ATTR_OFFSET(bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
 	 GET_ATTR_OFFSET(pkt_info.rssi)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,   NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.seq_num)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -304,15 +304,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_BEACON_LOSS_DISCONN] = {
 	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE,  NLA_U32,  sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,   NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64,  sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,     NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID,       NLA_BINARY, QDF_MAC_ADDR_SIZE,
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
 	 GET_ATTR_OFFSET(bssid)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI,        NLA_S32, sizeof(int32_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI,  NLA_S32, sizeof(int32_t),
 	 GET_ATTR_OFFSET(pkt_info.rssi)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -328,14 +328,14 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 sizeof(uint8_t), GET_ATTR_OFFSET(roam_trig.trigger_reason)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_TRIGGER_SUB_REASON,  NLA_U8,
 	 sizeof(uint8_t), GET_ATTR_OFFSET(roam_trig.trigger_sub_reason)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI,     NLA_S32, sizeof(int32_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
 	 GET_ATTR_OFFSET(roam_trig.current_rssi)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_CU,  NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(roam_trig.cu_load)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_SCAN_TYPE, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(roam_trig.is_full_scan)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_RSSI_THRESHOLD, NLA_U32,
-	 sizeof(uint8_t), GET_ATTR_OFFSET(roam_trig.rssi_threshold)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_RSSI_THRESHOLD, NLA_S32,
+	 sizeof(int32_t), GET_ATTR_OFFSET(roam_trig.rssi_threshold)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
@@ -430,7 +430,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(vdev_id)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(roam_result.roam_fail_reason)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -442,7 +442,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN,  NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN,  NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.token)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_QUERY_REASON, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.reason)},
@@ -458,14 +458,14 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,  sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN,  NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN,  NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.token)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_MODE,   NLA_U8,  sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.mode)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DISASSOC_TIMER, NLA_U32,
-	sizeof(uint32_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_VALIDITY_INTERVAL, NLA_U32,
-	 sizeof(uint32_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DISASSOC_TIMER, NLA_U16,
+	 sizeof(uint16_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_VALIDITY_INTERVAL, NLA_U8,
+	 sizeof(uint8_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_CANDIDATE_LIST_COUNT, NLA_U8,
 	 sizeof(uint8_t), GET_ATTR_OFFSET(btm_info.candidate_list_count)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
@@ -480,7 +480,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,     NLA_U8,   sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(btm_info.reason)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_WTC_SUB_REASON_CODE, NLA_U8,
 	 sizeof(uint8_t), GET_ATTR_OFFSET(btm_info.sub_reason)},
@@ -494,13 +494,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_BTM_REQ_CANDI] = {
 	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE,  NLA_U32,  sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,   NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,     NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_AP_RANK, NLA_U8, sizeof(uint8_t),
+	 GET_ATTR_OFFSET(btm_cand.idx)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID,  NLA_BINARY, QDF_MAC_ADDR_SIZE,
 	 GET_ATTR_OFFSET(btm_cand.bssid)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_PREFERENCE, NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_PREFERENCE, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_cand.preference)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
@@ -514,25 +516,25 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,  sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN,  NLA_U16, sizeof(uint16_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN,  NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.token)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_STATUS_CODE, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_STATUS_CODE, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.btm_status_code)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DELAY, NLA_U8,  sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DELAY, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(btm_info.btm_delay)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID,  NLA_BINARY, QDF_MAC_ADDR_SIZE,
-	 GET_ATTR_OFFSET(btm_info.target_bssid)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID, NLA_BINARY,
+	 QDF_MAC_ADDR_SIZE, GET_ATTR_OFFSET(btm_info.target_bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
 
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DHCP_DISCOVER] = {
-	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32,  sizeof(uint32_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(pkt_info.tx_status)},
@@ -540,11 +542,11 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	},
 
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DHCP_OFFER] = {
-	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32,  sizeof(uint32_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64, sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
@@ -552,7 +554,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DHCP_REQUEST] = {
 	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32,  sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
@@ -598,9 +600,9 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(log_subtype)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,  NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS,   NLA_U8, sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS,  NLA_U8, sizeof(uint8_t),
 	 GET_ATTR_OFFSET(pkt_info.tx_status)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
@@ -612,7 +614,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(log_subtype)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8,   sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
@@ -648,7 +650,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_GTK_M2] = {
 	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32,  sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
-	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,  NLA_U64,  sizeof(uint64_t),
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
 	 GET_ATTR_OFFSET(timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,    NLA_U8,   sizeof(uint8_t),
 	 GET_ATTR_OFFSET(vdev_id)},
@@ -819,7 +821,8 @@ wlan_hdd_get_converted_tx_status(uint8_t tx_status)
 static uint16_t
 wlan_hdd_get_connectivity_log_tlv_len(struct wlan_log_record *rec)
 {
-	uint16_t j, attr_id, log_evt_type, len = 0;
+	uint16_t j, log_evt_type, len = 0;
+	enum qca_wlan_vendor_attr_diag attr_id;
 
 	log_evt_type = hdd_connectivity_log_attr_table[rec->log_subtype];
 	if (log_evt_type >= (QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1))
@@ -850,11 +853,13 @@ wlan_hdd_get_connectivity_log_tlv_len(struct wlan_log_record *rec)
 		if (log_evt_type ==
 		    QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_ROAM_SCAN_DONE &&
 		    attr_id == QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_FREQ_LIST) {
-			len += NLMSG_HDRLEN +
-			       (rec->roam_scan.num_scanned_freq *
-				sizeof(rec->roam_scan.scan_freq[0]));
+			len += nla_total_size(
+					NLMSG_HDRLEN +
+					(rec->roam_scan.num_scanned_freq *
+					 sizeof(rec->roam_scan.scan_freq[0])));
 		} else {
-			len += connectivity_attr_table[log_evt_type][j].attribute_length;
+			len += nla_total_size(connectivity_attr_table[
+				      log_evt_type][j].attribute_length);
 		}
 	}
 
@@ -881,7 +886,7 @@ wlan_hdd_put_connectivity_logging_data(struct sk_buff *skb,
 {
 	int errno = 0;
 	struct qdf_mac_addr bssid = {0};
-	enum  qca_vendor_attr_diag_event_type attribute_id =
+	enum  qca_wlan_vendor_attr_diag attribute_id =
 						attribute->attribute_id;
 	uint16_t field_offset = attribute->field_offset;
 
@@ -897,23 +902,35 @@ wlan_hdd_put_connectivity_logging_data(struct sk_buff *skb,
 		    qdf_is_macaddr_broadcast(&bssid))
 			break;
 
-		nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
-			bssid.bytes);
+		errno = nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
+				bssid.bytes);
 		break;
 	case QCA_WLAN_VENDOR_ATTR_DIAG_BSSID_HINT:
 		if (qdf_is_macaddr_zero(&rec->conn_info.bssid_hint) ||
 		    qdf_is_macaddr_broadcast(&rec->conn_info.bssid_hint))
 			break;
 
-		nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
-			rec->conn_info.bssid_hint.bytes);
+		errno = nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
+				rec->conn_info.bssid_hint.bytes);
+		break;
+	case QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID:
+		bssid = ATTR_GET_VALUE(struct qdf_mac_addr, rec, field_offset);
+		if (qdf_is_macaddr_zero(&bssid) ||
+		    qdf_is_macaddr_broadcast(&bssid))
+			break;
+
+		errno = nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
+				bssid.bytes);
 		break;
 	default:
 		break;
 	}
 
-	if (errno)
+	if (errno) {
+		hdd_err_rl("Failed to put attribute_id:%d",
+			   attribute->attribute_id);
 		return QDF_STATUS_E_FAILURE;
+	}
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -959,7 +976,7 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
 					struct wlan_log_record *rec)
 {
 	uint8_t i, val8, attr_val8;
-	uint16_t attr_id;
+	enum qca_wlan_vendor_attr_diag attr_id;
 	enum qca_vendor_attr_diag_event_type evt_type;
 	struct connectivity_log_attr attr;
 	QDF_STATUS status;
@@ -1028,40 +1045,30 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
 				attr_val8 = wlan_hdd_convert_roam_scan_type(val8);
 
 			errno = nla_put_u8(skb, attr.attribute_id, attr_val8);
-			if (errno)
-				return QDF_STATUS_E_FAILURE;
 			break;
 		case NLA_U16:
 			errno = nla_put_u16(skb, attr.attribute_id,
 					    ATTR_GET_VALUE(uint16_t, rec,
 							   attr.field_offset));
-			if (errno)
-				return QDF_STATUS_E_FAILURE;
 			break;
 		case NLA_U32:
 			errno = nla_put_u32(skb, attr.attribute_id,
 					    ATTR_GET_VALUE(uint32_t, rec,
 							   attr.field_offset));
-			if (errno)
-				return QDF_STATUS_E_FAILURE;
 			break;
 		case NLA_S32:
 			errno = nla_put_s32(skb, attr.attribute_id,
 					    ATTR_GET_VALUE(int32_t, rec,
 							   attr.field_offset));
-			if (errno)
-				return QDF_STATUS_E_FAILURE;
 			break;
 		case NLA_U64:
 			errno = wlan_cfg80211_nla_put_u64(
 			    skb, attr.attribute_id,
 			    ATTR_GET_VALUE(uint64_t, rec, attr.field_offset));
-			if (errno)
-				return QDF_STATUS_E_FAILURE;
 			break;
 		case NLA_FLAG:
 			if (ATTR_GET_VALUE(bool, rec, attr.field_offset))
-				nla_put_flag(skb, attr.attribute_id);
+				errno = nla_put_flag(skb, attr.attribute_id);
 			break;
 		case NLA_BINARY:
 			status = wlan_hdd_put_connectivity_logging_data(
@@ -1074,6 +1081,12 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
 		}
 	}
 
+	if (errno) {
+		hdd_err_rl("NLA put failed for attr:%d",
+			   attr.attribute_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -1125,8 +1138,11 @@ wlan_hdd_send_connectivity_log_to_user(struct wlan_log_record *rec,
 
 		status = wlan_hdd_fill_connectivity_logging_data(vendor_event,
 								 &rec[i]);
-		if (QDF_IS_STATUS_ERROR(status))
+		if (QDF_IS_STATUS_ERROR(status)) {
+			hdd_err_rl("Failed to fill fat idx:%d subtype:%d",
+				   i, rec[i].log_subtype);
 			goto failure;
+		}
 
 		nla_nest_end(vendor_event, attr1);
 	}
@@ -1138,7 +1154,7 @@ wlan_hdd_send_connectivity_log_to_user(struct wlan_log_record *rec,
 
 	return QDF_STATUS_SUCCESS;
 failure:
-	hdd_err("NLA fill failed");
+	hdd_err("NLA fill failed num_records:%d", num_records);
 	kfree_skb(vendor_event);
 
 	return QDF_STATUS_E_FAILURE;