Forráskód Böngészése

qcacld-3.0: Add chipset stats for CSA event

Add chipset stats for CSA event

Change-Id: I933975c7cfe9cab8c75df77878f74ee47baeb75b
CRs-Fixed: 3804997
Prasanna JS 1 éve
szülő
commit
ffdffc8735

+ 6 - 0
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -10362,6 +10362,12 @@ skip_vht:
 	if (QDF_IS_STATUS_ERROR(status))
 		pe_err("cannot start ap_ecsa_timer");
 
+	lim_cp_stats_cstats_log_csa_evt(
+			session_entry, CSTATS_DIR_TX,
+			session_entry->gLimChannelSwitch.sw_target_freq,
+			session_entry->gLimChannelSwitch.ch_width,
+			session_entry->gLimChannelSwitch.switchMode);
+
 	pe_debug("IE count:%d chan:%d freq %d width:%d wrapper:%d ch_offset:%d",
 		 session_entry->gLimChannelSwitch.switchCount,
 		 session_entry->gLimChannelSwitch.primaryChannel,

+ 6 - 0
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -2311,6 +2311,12 @@ void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 			session_entry->htSupportedChannelWidthSet = true;
 		}
 	}
+
+	lim_cp_stats_cstats_log_csa_evt(session_entry, CSTATS_DIR_RX,
+					lim_ch_switch->sw_target_freq,
+					lim_ch_switch->ch_width,
+					lim_ch_switch->switchMode);
+
 	pe_debug("new ch %d: freq %d width: %d freq0 %d freq1 %d ht width %d, current freq %d: bw %d",
 		 lim_ch_switch->primaryChannel, lim_ch_switch->sw_target_freq,
 		 lim_ch_switch->ch_width, lim_ch_switch->ch_center_freq_seg0,

+ 25 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -12206,4 +12206,29 @@ lim_cp_stats_cstats_log_tear_down_evt(tDot11fTDLSTeardown *frm,
 
 	wlan_cstats_host_stats(sizeof(struct cstats_tdls_tear_down), &stat);
 }
+
+void lim_cp_stats_cstats_log_csa_evt(struct pe_session *pe_session,
+				     enum cstats_dir dir, uint16_t target_freq,
+				     uint8_t target_ch_width,
+				     uint8_t switch_mode)
+{
+	struct cstats_csa_evt stat = {0};
+
+	stat.cmn.hdr.evt_id = WLAN_CHIPSET_STATS_CSA_EVENT_ID;
+	stat.cmn.hdr.length = sizeof(struct cstats_csa_evt) -
+			      sizeof(struct cstats_hdr);
+	stat.cmn.opmode = pe_session->opmode;
+	stat.cmn.vdev_id = pe_session->vdev_id;
+	stat.cmn.timestamp_us = qdf_get_time_of_the_day_us();
+	stat.cmn.time_tick = qdf_get_log_timestamp();
+
+	stat.direction = dir;
+	stat.target_freq = target_freq;
+	stat.target_ch_width = target_ch_width;
+	stat.current_freq = pe_session->curr_op_freq;
+	stat.current_ch_width = pe_session->ch_width;
+	stat.switch_mode = switch_mode;
+
+	wlan_cstats_host_stats(sizeof(struct cstats_csa_evt), &stat);
+}
 #endif /* WLAN_CHIPSET_STATS */

+ 23 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -3559,6 +3559,22 @@ void lim_cp_stats_cstats_log_setup_confirm_evt(tDot11fTDLSSetupCnf *frm,
  */
 void lim_cp_stats_cstats_log_tear_down_evt(tDot11fTDLSTeardown *frm,
 					   struct pe_session *pe_session);
+
+/**
+ * lim_cp_stats_cstats_log_csa_evt() : chipset stats for CSA event
+ *
+ * @pe_session: pointer to session object
+ * @dir: Direction of the event i.e TX/RX
+ * @target_freq: Target freq
+ * @target_ch_width: Target channel width
+ * @switch_mode: Switch mode
+ *
+ * Return: void
+ */
+void lim_cp_stats_cstats_log_csa_evt(struct pe_session *pe_session,
+				     enum cstats_dir dir, uint16_t target_freq,
+				     uint8_t target_ch_width,
+				     uint8_t switch_mode);
 #else
 static inline void
 lim_cp_stats_cstats_log_assoc_resp_evt(struct pe_session *session_entry,
@@ -3634,5 +3650,12 @@ lim_cp_stats_cstats_log_tear_down_evt(tDot11fTDLSTeardown *frm,
 				      struct pe_session *pe_session)
 {
 }
+
+static inline void
+lim_cp_stats_cstats_log_csa_evt(struct pe_session *pe_session,
+				enum cstats_dir dir, uint16_t target_freq,
+				uint8_t target_ch_width, uint8_t switch_mode)
+{
+}
 #endif /* WLAN_CHIPSET_STATS */
 #endif /* __LIM_UTILS_H */