Sfoglia il codice sorgente

qcacld-3.0: Fix connectivity logging roam result and roam reason

Roam result is printed as failure always since the
is_roam_successful flag is not passed to the
roam successful attribute to userspace. For roam
reason, the wrong attribute is used to convert the roam
sub reason from driver values to userspace values.
In WTC roam, the sub reason & vsie is not filled
from the right roam trigger TLV.

Fix the connectivity logging roam result and roam
subreason and WTC values passed to userspace.

Change-Id: Id276054868d907a801e87c1fd9cd7bb3b7c4e150
CRs-Fixed: 3051447
Pragaspathi Thilagaraj 3 anni fa
parent
commit
180fd2e36d

+ 22 - 13
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -4801,6 +4801,7 @@ void cm_roam_trigger_info_event(struct wmi_roam_trigger_info *data,
 	log_record->roam_trig.current_rssi = (-1) * data->current_rssi;
 	log_record->roam_trig.cu_load = data->cu_trig_data.cu_load;
 	log_record->roam_trig.rssi_threshold = data->rssi_trig_data.threshold;
+	log_record->roam_trig.is_full_scan = is_full_scan;
 
 	wlan_connectivity_log_enqueue(log_record);
 	qdf_mem_free(log_record);
@@ -5128,7 +5129,8 @@ cm_roam_btm_query_event(struct wmi_neighbor_report_data *btm_data,
 }
 
 QDF_STATUS
-cm_roam_btm_resp_event(struct roam_btm_response_data *btm_data,
+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;
@@ -5138,24 +5140,31 @@ cm_roam_btm_resp_event(struct roam_btm_response_data *btm_data,
 	if (!log_record)
 		return QDF_STATUS_E_NOMEM;
 
-	if (is_wtc)
+	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;
-	else
+		log_record->btm_info.reason = wtc_data->vsie_trigger_reason;
+		log_record->btm_info.sub_reason = wtc_data->sub_code;
+	} 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;
+		}
+	}
+
 	log_record->timestamp_us = qdf_get_time_of_the_day_us();
-	log_record->fw_timestamp_us = btm_data->timestamp * 1000;
+	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;
-	if (is_wtc) {
-		log_record->btm_info.reason = btm_data->vsie_reason;
-		log_record->btm_info.wtc_duration = btm_data->btm_delay;
-	}
-
 	status = wlan_connectivity_log_enqueue(log_record);
 	qdf_mem_free(log_record);
 

+ 5 - 2
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h

@@ -346,6 +346,7 @@ cm_roam_btm_req_event(struct wmi_roam_btm_trigger_data *btm_data,
 
 /**
  * cm_roam_btm_resp_event() - Send BTM response logging event
+ * @trigger_info: Roam trigger related data
  * @btm_data: BTM response data
  * @vdev_id: Vdev id
  * @is_wtc: Is WTC or BTM response
@@ -353,7 +354,8 @@ cm_roam_btm_req_event(struct wmi_roam_btm_trigger_data *btm_data,
  * Return: QDF_STATUS
  */
 QDF_STATUS
-cm_roam_btm_resp_event(struct roam_btm_response_data *btm_data,
+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);
 
 /**
@@ -382,7 +384,8 @@ cm_roam_btm_req_event(struct wmi_roam_btm_trigger_data *btm_data,
 }
 
 static inline QDF_STATUS
-cm_roam_btm_resp_event(struct roam_btm_response_data *btm_data,
+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)
 {
 	return QDF_STATUS_E_NOSUPPORT;

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

@@ -2543,12 +2543,14 @@ cm_roam_scan_ch_list_event_handler(struct cm_roam_scan_ch_resp *data)
  * @ptr: Pointer to the roam trigger info
  * @buf: Destination buffer to write the reason string
  * @is_full_scan: Is roam scan partial scan or all channels scan
+ * @vdev_id: vdev id
  *
  * Return: None
  */
 static void
 cm_roam_stats_get_trigger_detail_str(struct wmi_roam_trigger_info *ptr,
-				     char *buf, bool is_full_scan)
+				     char *buf, bool is_full_scan,
+				     uint8_t vdev_id)
 {
 	uint16_t buf_cons, buf_left = MAX_ROAM_DEBUG_BUF_SIZE;
 	char *temp = buf;
@@ -2624,6 +2626,8 @@ cm_roam_stats_get_trigger_detail_str(struct wmi_roam_trigger_info *ptr,
 		buf_left -= buf_cons;
 		break;
 	case ROAM_TRIGGER_REASON_WTC_BTM:
+		cm_roam_btm_resp_event(ptr, NULL, vdev_id, true);
+
 		if (ptr->wtc_btm_trig_data.wtc_candi_rssi_ext_present) {
 			buf_cons = qdf_snprint(temp, buf_left,
 				   "Roaming Mode: %d, Trigger Reason: %d, Sub code:%d, wtc mode:%d, wtc scan mode:%d, wtc rssi th:%d, wtc candi rssi th_2g:%d, wtc_candi_rssi_th_5g:%d, wtc_candi_rssi_th_6g:%d",
@@ -2680,7 +2684,7 @@ cm_roam_stats_print_trigger_info(struct wmi_roam_trigger_info *data,
 	if (!buf)
 		return;
 
-	cm_roam_stats_get_trigger_detail_str(data, buf, is_full_scan);
+	cm_roam_stats_get_trigger_detail_str(data, buf, is_full_scan, vdev_id);
 	mlme_get_converted_timestamp(data->timestamp, time);
 	mlme_nofl_info("%s [ROAM_TRIGGER]: VDEV[%d] %s", time, vdev_id, buf);
 
@@ -2697,7 +2701,8 @@ cm_roam_stats_print_trigger_info(struct wmi_roam_trigger_info *data,
  * Return: None
  */
 static void
-cm_roam_stats_print_btm_rsp_info(struct roam_btm_response_data *data,
+cm_roam_stats_print_btm_rsp_info(struct wmi_roam_trigger_info *trigger_info,
+				 struct roam_btm_response_data *data,
 				 uint8_t vdev_id, bool is_wtc)
 {
 	char time[TIME_STRING_LEN];
@@ -2707,7 +2712,7 @@ cm_roam_stats_print_btm_rsp_info(struct roam_btm_response_data *data,
 		       QDF_MAC_ADDR_FMT, time, vdev_id, data->btm_status,
 		       data->vsie_reason,
 		       QDF_MAC_ADDR_REF(data->target_bssid.bytes));
-	cm_roam_btm_resp_event(data, vdev_id, is_wtc);
+	cm_roam_btm_resp_event(trigger_info, data, vdev_id, is_wtc);
 }
 
 /**
@@ -3016,18 +3021,12 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
 		 */
 		if (stats_info->btm_rsp[i].present &&
 		    (stats_info->trigger[i].present &&
-		    (stats_info->trigger[i].trigger_reason ==
-		     ROAM_TRIGGER_REASON_WTC_BTM ||
 		     stats_info->trigger[i].trigger_reason ==
-		     ROAM_TRIGGER_REASON_BTM))) {
-			bool is_wtc =
-				(stats_info->trigger[i].trigger_reason ==
-				 ROAM_TRIGGER_REASON_WTC_BTM);
-
+		     ROAM_TRIGGER_REASON_BTM)) {
 			cm_roam_stats_print_btm_rsp_info(
+						&stats_info->trigger[i],
 						&stats_info->btm_rsp[i],
-						stats_info->vdev_id,
-						is_wtc);
+						stats_info->vdev_id, false);
 		}
 
 		if (stats_info->roam_init_info[i].present)
@@ -3068,8 +3067,9 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
 
 		if (stats_info->btm_rsp[0].present)
 			cm_roam_stats_print_btm_rsp_info(
-							&stats_info->btm_rsp[0],
-							stats_info->vdev_id, 0);
+					&stats_info->trigger[i],
+					&stats_info->btm_rsp[0],
+					stats_info->vdev_id, 0);
 	}
 	if (stats_info->roam_msg_info && stats_info->num_roam_msg_info &&
 	    stats_info->num_roam_msg_info - rem_tlv) {

+ 3 - 1
core/hdd/src/wlan_hdd_connectivity_logging.c

@@ -411,6 +411,8 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(bssid)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_SUCCESSFUL, NLA_FLAG,
+	 sizeof(uint64_t), GET_ATTR_OFFSET(roam_result.is_roam_successful)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_MAX,   0, 0, 0},
 	},
 
@@ -997,7 +999,7 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
 			val8 = ATTR_GET_VALUE(uint8_t, rec, attr.field_offset);
 			attr_val8 = val8;
 			if (attr.attribute_id ==
-			    QCA_WLAN_VENDOR_ATTR_DIAG_BTM_WTC_SUB_REASON_CODE)
+			    QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_TRIGGER_SUB_REASON)
 				attr_val8 = wlan_hdd_get_converted_roam_sub_reason(val8);
 			else if (attr.attribute_id ==
 				 QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS)