|
@@ -2718,8 +2718,7 @@ cm_roam_stats_get_trigger_detail_str(struct wmi_roam_trigger_info *ptr,
|
|
|
case ROAM_TRIGGER_REASON_UNIT_TEST:
|
|
|
break;
|
|
|
case ROAM_TRIGGER_REASON_BTM:
|
|
|
- cm_roam_btm_req_event(&ptr->btm_trig_data, ptr, vdev_id,
|
|
|
- false);
|
|
|
+ cm_roam_btm_req_event(&ptr->btm_trig_data, ptr, vdev_id, false);
|
|
|
buf_cons = qdf_snprint(
|
|
|
temp, buf_left,
|
|
|
"Req_mode: %d Disassoc_timer: %d",
|
|
@@ -2804,7 +2803,8 @@ cm_roam_stats_get_trigger_detail_str(struct wmi_roam_trigger_info *ptr,
|
|
|
|
|
|
/**
|
|
|
* cm_roam_stats_print_trigger_info - Roam trigger related details
|
|
|
- * @data: Pointer to the roam trigger data
|
|
|
+ * @psoc: Pointer to PSOC object
|
|
|
+ * @data: Pointer to the roam trigger data
|
|
|
* @scan_data: Roam scan data pointer
|
|
|
* @vdev_id: Vdev ID
|
|
|
*
|
|
@@ -2814,12 +2814,14 @@ cm_roam_stats_get_trigger_detail_str(struct wmi_roam_trigger_info *ptr,
|
|
|
* Return: None
|
|
|
*/
|
|
|
static void
|
|
|
-cm_roam_stats_print_trigger_info(struct wmi_roam_trigger_info *data,
|
|
|
+cm_roam_stats_print_trigger_info(struct wlan_objmgr_psoc *psoc,
|
|
|
+ struct wmi_roam_trigger_info *data,
|
|
|
struct wmi_roam_scan_data *scan_data,
|
|
|
uint8_t vdev_id, bool is_full_scan)
|
|
|
{
|
|
|
char *buf;
|
|
|
char time[TIME_STRING_LEN];
|
|
|
+ QDF_STATUS status;
|
|
|
|
|
|
buf = qdf_mem_malloc(MAX_ROAM_DEBUG_BUF_SIZE);
|
|
|
if (!buf)
|
|
@@ -2830,10 +2832,13 @@ cm_roam_stats_print_trigger_info(struct wmi_roam_trigger_info *data,
|
|
|
|
|
|
/* Update roam trigger info to userspace */
|
|
|
cm_roam_trigger_info_event(data, scan_data, vdev_id, is_full_scan);
|
|
|
-
|
|
|
mlme_nofl_info("%s [ROAM_TRIGGER]: VDEV[%d] %s", time, vdev_id, buf);
|
|
|
-
|
|
|
qdf_mem_free(buf);
|
|
|
+
|
|
|
+ status = wlan_cm_update_roam_states(psoc, vdev_id, data->trigger_reason,
|
|
|
+ ROAM_TRIGGER_REASON);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ mlme_err("failed to update rt stats trigger reason");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3038,6 +3043,7 @@ cm_roam_stats_print_roam_result(struct wlan_objmgr_psoc *psoc,
|
|
|
{
|
|
|
char *buf;
|
|
|
char time[TIME_STRING_LEN];
|
|
|
+ QDF_STATUS status;
|
|
|
|
|
|
/* Update roam result info to userspace */
|
|
|
cm_roam_result_info_event(psoc, trigger, res, scan_data, vdev_id);
|
|
@@ -3054,8 +3060,12 @@ cm_roam_stats_print_roam_result(struct wlan_objmgr_psoc *psoc,
|
|
|
mlme_nofl_info("%s [ROAM_RESULT]: VDEV[%d] %s %s",
|
|
|
time, vdev_id, mlme_get_roam_status_str(res->status),
|
|
|
buf);
|
|
|
-
|
|
|
qdf_mem_free(buf);
|
|
|
+
|
|
|
+ status = wlan_cm_update_roam_states(psoc, vdev_id, res->fail_reason,
|
|
|
+ ROAM_FAIL_REASON);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ mlme_err("failed to update rt stats roam fail reason");
|
|
|
}
|
|
|
|
|
|
#define WLAN_ROAM_11KV_REQ_TYPE_BTM 1
|
|
@@ -3257,6 +3267,104 @@ void cm_report_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * cm_roam_handle_btm_stats() - Handle BTM related logging roam stats.
|
|
|
+ * @psoc: psoc pointer
|
|
|
+ * @stats_info: Pointer to the roam stats
|
|
|
+ * @i: TLV indev for BTM roam trigger
|
|
|
+ * @rem_tlv_len: Remaining TLV length
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static void
|
|
|
+cm_roam_handle_btm_stats(struct wlan_objmgr_psoc *psoc,
|
|
|
+ struct roam_stats_event *stats_info, uint8_t i,
|
|
|
+ uint8_t *rem_tlv_len)
|
|
|
+{
|
|
|
+ bool log_btm_frames_only = false;
|
|
|
+
|
|
|
+ if (stats_info->data_11kv[i].present)
|
|
|
+ cm_roam_stats_print_11kv_info(&stats_info->data_11kv[i],
|
|
|
+ stats_info->vdev_id);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * If roam trigger is BTM and roam scan type is no scan then
|
|
|
+ * the roam stats event is for BTM frames logging.
|
|
|
+ * So log the BTM frames alone and return.
|
|
|
+ */
|
|
|
+ if (stats_info->scan[i].present &&
|
|
|
+ stats_info->scan[i].type == ROAM_STATS_SCAN_TYPE_NO_SCAN) {
|
|
|
+ cm_roam_btm_req_event(&stats_info->trigger[i].btm_trig_data,
|
|
|
+ &stats_info->trigger[i],
|
|
|
+ stats_info->vdev_id, false);
|
|
|
+ log_btm_frames_only = true;
|
|
|
+ goto log_btm_frames_only;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (stats_info->trigger[i].present) {
|
|
|
+ bool is_full_scan = stats_info->scan[i].present &&
|
|
|
+ stats_info->scan[i].type;
|
|
|
+
|
|
|
+ /* BTM request diag log event will be sent from inside below */
|
|
|
+ cm_roam_stats_print_trigger_info(psoc, &stats_info->trigger[i],
|
|
|
+ &stats_info->scan[i],
|
|
|
+ stats_info->vdev_id,
|
|
|
+ is_full_scan);
|
|
|
+
|
|
|
+ if (stats_info->scan[i].present)
|
|
|
+ cm_roam_stats_print_scan_info(
|
|
|
+ psoc, &stats_info->scan[i],
|
|
|
+ stats_info->vdev_id,
|
|
|
+ stats_info->trigger[i].trigger_reason,
|
|
|
+ stats_info->trigger[i].timestamp);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (stats_info->result[i].present)
|
|
|
+ cm_roam_stats_print_roam_result(psoc, &stats_info->trigger[i],
|
|
|
+ &stats_info->result[i],
|
|
|
+ &stats_info->scan[i],
|
|
|
+ stats_info->vdev_id);
|
|
|
+
|
|
|
+ if (stats_info->frame_stats[i].num_frame)
|
|
|
+ cm_roam_print_frame_info(&stats_info->frame_stats[i],
|
|
|
+ &stats_info->scan[i],
|
|
|
+ stats_info->vdev_id);
|
|
|
+
|
|
|
+log_btm_frames_only:
|
|
|
+ /*
|
|
|
+ * Print BTM resp TLV info (wmi_roam_btm_response_info) only
|
|
|
+ * when trigger reason is BTM or WTC_BTM. As for other roam
|
|
|
+ * triggers this TLV contains zeros, so host should not print.
|
|
|
+ */
|
|
|
+ if (stats_info->btm_rsp[i].present && stats_info->trigger[i].present &&
|
|
|
+ (stats_info->trigger[i].trigger_reason == ROAM_TRIGGER_REASON_BTM ||
|
|
|
+ stats_info->trigger[i].trigger_reason ==
|
|
|
+ ROAM_TRIGGER_REASON_WTC_BTM))
|
|
|
+ cm_roam_stats_print_btm_rsp_info(&stats_info->trigger[i],
|
|
|
+ &stats_info->btm_rsp[i],
|
|
|
+ stats_info->vdev_id, false);
|
|
|
+
|
|
|
+ if (log_btm_frames_only)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (stats_info->roam_init_info[i].present)
|
|
|
+ cm_roam_stats_print_roam_initial_info(
|
|
|
+ &stats_info->roam_init_info[i],
|
|
|
+ stats_info->vdev_id);
|
|
|
+
|
|
|
+ if (stats_info->roam_msg_info && stats_info->roam_msg_info[i].present &&
|
|
|
+ i < stats_info->num_roam_msg_info) {
|
|
|
+ *rem_tlv_len = *rem_tlv_len + 1;
|
|
|
+ cm_roam_stats_print_roam_msg_info(
|
|
|
+ &stats_info->roam_msg_info[i],
|
|
|
+ stats_info->vdev_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ cm_report_roam_rt_stats(psoc, stats_info->vdev_id,
|
|
|
+ ROAM_RT_STATS_TYPE_ROAM_SCAN_INFO,
|
|
|
+ stats_info, 0, i);
|
|
|
+}
|
|
|
+
|
|
|
QDF_STATUS
|
|
|
cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
struct roam_stats_event *stats_info)
|
|
@@ -3267,55 +3375,45 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
if (!stats_info)
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
+
|
|
|
for (i = 0; i < stats_info->num_tlv; i++) {
|
|
|
if (stats_info->trigger[i].present) {
|
|
|
bool is_full_scan =
|
|
|
stats_info->scan[i].present &&
|
|
|
stats_info->scan[i].type;
|
|
|
|
|
|
+ if (stats_info->trigger[i].trigger_reason ==
|
|
|
+ ROAM_TRIGGER_REASON_BTM) {
|
|
|
+ cm_roam_handle_btm_stats(psoc, stats_info, i,
|
|
|
+ &rem_tlv);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
cm_roam_stats_print_trigger_info(
|
|
|
- &stats_info->trigger[i],
|
|
|
+ psoc, &stats_info->trigger[i],
|
|
|
&stats_info->scan[i],
|
|
|
stats_info->vdev_id, is_full_scan);
|
|
|
- status = wlan_cm_update_roam_states(psoc,
|
|
|
+
|
|
|
+ if (stats_info->scan[i].present)
|
|
|
+ cm_roam_stats_print_scan_info(
|
|
|
+ psoc, &stats_info->scan[i],
|
|
|
stats_info->vdev_id,
|
|
|
stats_info->trigger[i].trigger_reason,
|
|
|
- ROAM_TRIGGER_REASON);
|
|
|
- if (QDF_IS_STATUS_ERROR(status))
|
|
|
- goto err;
|
|
|
+ stats_info->trigger[i].timestamp);
|
|
|
}
|
|
|
|
|
|
- if (stats_info->scan[i].present &&
|
|
|
- stats_info->trigger[i].present)
|
|
|
- cm_roam_stats_print_scan_info(psoc,
|
|
|
- &stats_info->scan[i],
|
|
|
- stats_info->vdev_id,
|
|
|
- stats_info->trigger[i].trigger_reason,
|
|
|
- stats_info->trigger[i].timestamp);
|
|
|
-
|
|
|
- if (stats_info->result[i].present) {
|
|
|
+ if (stats_info->result[i].present)
|
|
|
cm_roam_stats_print_roam_result(psoc,
|
|
|
&stats_info->trigger[i],
|
|
|
&stats_info->result[i],
|
|
|
&stats_info->scan[i],
|
|
|
stats_info->vdev_id);
|
|
|
- status = wlan_cm_update_roam_states(psoc,
|
|
|
- stats_info->vdev_id,
|
|
|
- stats_info->result[i].fail_reason,
|
|
|
- ROAM_FAIL_REASON);
|
|
|
- if (QDF_IS_STATUS_ERROR(status))
|
|
|
- goto err;
|
|
|
- }
|
|
|
|
|
|
if (stats_info->frame_stats[i].num_frame)
|
|
|
cm_roam_print_frame_info(&stats_info->frame_stats[i],
|
|
|
&stats_info->scan[i],
|
|
|
stats_info->vdev_id);
|
|
|
|
|
|
- if (stats_info->data_11kv[i].present)
|
|
|
- cm_roam_stats_print_11kv_info(&stats_info->data_11kv[i],
|
|
|
- stats_info->vdev_id);
|
|
|
-
|
|
|
/*
|
|
|
* Print BTM resp TLV info (wmi_roam_btm_response_info) only
|
|
|
* when trigger reason is BTM or WTC_BTM. As for other roam
|
|
@@ -3326,12 +3424,11 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
(stats_info->trigger[i].trigger_reason ==
|
|
|
ROAM_TRIGGER_REASON_BTM ||
|
|
|
stats_info->trigger[i].trigger_reason ==
|
|
|
- ROAM_TRIGGER_REASON_WTC_BTM)) {
|
|
|
+ ROAM_TRIGGER_REASON_WTC_BTM))
|
|
|
cm_roam_stats_print_btm_rsp_info(
|
|
|
&stats_info->trigger[i],
|
|
|
&stats_info->btm_rsp[i],
|
|
|
stats_info->vdev_id, false);
|
|
|
- }
|
|
|
|
|
|
if (stats_info->roam_init_info[i].present)
|
|
|
cm_roam_stats_print_roam_initial_info(
|
|
@@ -3371,10 +3468,9 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
ROAM_TRIGGER_REASON_WTC_BTM)
|
|
|
is_wtc = true;
|
|
|
|
|
|
- cm_roam_btm_req_event(
|
|
|
- &stats_info->trigger[0].btm_trig_data,
|
|
|
- &stats_info->trigger[0], stats_info->vdev_id,
|
|
|
- is_wtc);
|
|
|
+ cm_roam_btm_req_event(&stats_info->trigger[0].btm_trig_data,
|
|
|
+ &stats_info->trigger[0],
|
|
|
+ stats_info->vdev_id, is_wtc);
|
|
|
}
|
|
|
|
|
|
if (stats_info->scan[0].present &&
|
|
@@ -3387,7 +3483,7 @@ 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->trigger[i],
|
|
|
+ &stats_info->trigger[0],
|
|
|
&stats_info->btm_rsp[0],
|
|
|
stats_info->vdev_id, 0);
|
|
|
|
|
@@ -3402,6 +3498,7 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
cm_roam_btm_resp_event(&stats_info->trigger[0], NULL,
|
|
|
stats_info->vdev_id, true);
|
|
|
}
|
|
|
+
|
|
|
if (stats_info->roam_msg_info && stats_info->num_roam_msg_info &&
|
|
|
stats_info->num_roam_msg_info - rem_tlv) {
|
|
|
for (i = 0; i < (stats_info->num_roam_msg_info-rem_tlv); i++) {
|
|
@@ -3413,10 +3510,9 @@ cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
}
|
|
|
|
|
|
wlan_clear_sae_auth_logs_cache(stats_info->vdev_id);
|
|
|
-err:
|
|
|
- if (stats_info->roam_msg_info)
|
|
|
- qdf_mem_free(stats_info->roam_msg_info);
|
|
|
+ qdf_mem_free(stats_info->roam_msg_info);
|
|
|
qdf_mem_free(stats_info);
|
|
|
+
|
|
|
return status;
|
|
|
}
|
|
|
|