Kaynağa Gözat

qcacmn: Add ctl failsafe event

CTL failsafe event handler adds the capability to inform host
when failsafe algorithm invoked.

CRs-Fixed: 2333137
Change-Id: I91298c9be1f0f8291c927dbd3ac4a2a9f1b9f31b
Alok Singh 6 yıl önce
ebeveyn
işleme
1ae17d8c6f

+ 15 - 0
wmi/inc/wmi_unified_api.h

@@ -1548,6 +1548,21 @@ QDF_STATUS wmi_extract_smartlog_ev
 void wmi_process_fw_event_worker_thread_ctx(struct wmi_unified *wmi_handle,
 					    HTC_PACKET * htc_packet);
 
+/**
+ * wmi_extract_ctl_failsafe_check_ev_param() - extract ctl failsafe
+ * status from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param ev: Pointer to hold ctl status
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_extract_ctl_failsafe_check_ev_param(void *wmi_hdl,
+					void *evt_buf,
+					struct wmi_host_pdev_ctl_failsafe_event
+					*param);
+
 #ifdef OBSS_PD
 /**
  * wmi_extract_smartlog_ev() - extract smartlog event info from event

+ 9 - 0
wmi/inc/wmi_unified_param.h

@@ -4715,6 +4715,7 @@ typedef enum {
 #endif /* OL_ATH_SMART_LOGGING */
 	wmi_wlan_sar2_result_event_id,
 	wmi_esp_estimate_event_id,
+	wmi_pdev_ctl_failsafe_check_event_id,
 	wmi_events_max,
 } wmi_conv_event_id;
 
@@ -6609,6 +6610,14 @@ typedef struct {
 	uint32_t reserved;
 } wmi_host_pdev_bss_chan_info_event;
 
+/**
+ * struct wmi_host_pdev_ctl_failsafe_event
+ * @ctl_failsafe_status: Indicate if Failsafe value is imposed on CTL
+ */
+struct wmi_host_pdev_ctl_failsafe_event {
+	uint32_t ctl_failsafe_status;
+};
+
 #define WMI_HOST_INST_STATS_INVALID_RSSI 0
 /**
  * struct wmi_host_inst_stats_resp

+ 6 - 0
wmi/inc/wmi_unified_priv.h

@@ -1817,6 +1817,12 @@ QDF_STATUS (*send_obss_spatial_reuse_set)(wmi_unified_t wmi_handle,
 		struct wmi_host_obss_spatial_reuse_set_param
 		*obss_spatial_reuse_param);
 #endif
+
+QDF_STATUS
+(*extract_ctl_failsafe_check_ev_param)(
+		wmi_unified_t wmi_handle,
+		void *evt_buf,
+		struct wmi_host_pdev_ctl_failsafe_event *param);
 };
 
 /* Forward declartion for psoc*/

+ 24 - 0
wmi/src/wmi_unified_api.c

@@ -3005,6 +3005,30 @@ wmi_send_reset_peer_mumimo_tx_count_cmd(void *wmi_hdl, uint32_t value)
 }
 
 /* Extract - APIs */
+/**
+ * wmi_extract_ctl_failsafe_check_ev_param() - extract ctl data
+ * from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param param: Pointer to hold ctl data
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_extract_ctl_failsafe_check_ev_param(void *wmi_hdl,
+					void *evt_buf,
+					struct wmi_host_pdev_ctl_failsafe_event
+					*param)
+{
+	wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
+
+	if (wmi->ops->extract_ctl_failsafe_check_ev_param)
+		return wmi->ops->extract_ctl_failsafe_check_ev_param(
+			wmi, evt_buf, param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 /**
  * wmi_extract_fips_event_data() - extract fips event data
  * @wmi_handle: wmi handle

+ 26 - 0
wmi/src/wmi_unified_non_tlv.c

@@ -6768,6 +6768,28 @@ static QDF_STATUS extract_pdev_caldata_version_check_ev_param_non_tlv(
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * extract_ctl_failsafe_check_ev_param_non_tlv() - extract ctl data from
+ * event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param param: Pointer to hold peer ctl data
+ *
+ * Return: QDF_STATUS_SUCCESS for success
+ */
+static QDF_STATUS extract_ctl_failsafe_check_ev_param_non_tlv(
+			wmi_unified_t wmi_handle,
+			void *evt_buf,
+			struct wmi_host_pdev_ctl_failsafe_event *param)
+{
+	wmi_pdev_ctl_failsafe_event *event =
+			(wmi_pdev_ctl_failsafe_event *)evt_buf;
+
+	param->ctl_failsafe_status = event->ctl_FailsafeStatus;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * extract_pdev_tpc_config_ev_param_non_tlv() - extract pdev tpc configuration
  * param from event
@@ -8983,6 +9005,8 @@ struct wmi_ops non_tlv_ops =  {
 #endif
 	.extract_esp_estimation_ev_param =
 				extract_esp_estimation_ev_param_non_tlv,
+	.extract_ctl_failsafe_check_ev_param =
+			extract_ctl_failsafe_check_ev_param_non_tlv,
 };
 
 /**
@@ -9290,6 +9314,8 @@ static void populate_non_tlv_events_id(uint32_t *event_ids)
 #endif
 	event_ids[wmi_esp_estimate_event_id] =
 					WMI_ESP_ESTIMATE_EVENTID;
+	event_ids[wmi_pdev_ctl_failsafe_check_event_id] =
+					WMI_PDEV_CTL_FAILSAFE_CHECK_EVENTID;
 }
 
 /**

+ 33 - 0
wmi/src/wmi_unified_tlv.c

@@ -7582,6 +7582,35 @@ static QDF_STATUS extract_cca_stats_tlv(wmi_unified_t wmi_handle,
 }
 #endif /* QCA_SUPPORT_CP_STATS */
 
+/**
+ * extract_ctl_failsafe_check_ev_param_tlv() - extract ctl data from
+ * event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param param: Pointer to hold peer ctl data
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static QDF_STATUS extract_ctl_failsafe_check_ev_param_tlv(
+			wmi_unified_t wmi_handle,
+			void *evt_buf,
+			struct wmi_host_pdev_ctl_failsafe_event *param)
+{
+	WMI_PDEV_CTL_FAILSAFE_CHECK_EVENTID_param_tlvs *param_buf;
+	wmi_pdev_ctl_failsafe_check_fixed_param *fix_param;
+
+	param_buf = (WMI_PDEV_CTL_FAILSAFE_CHECK_EVENTID_param_tlvs *)evt_buf;
+	if (!param_buf) {
+		WMI_LOGE("Invalid ctl_failsafe event buffer");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	fix_param = param_buf->fixed_param;
+	param->ctl_failsafe_status = fix_param->ctl_FailsafeStatus;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * save_service_bitmap_tlv() - save service bitmap
  * @wmi_handle: wmi handle
@@ -11107,6 +11136,8 @@ struct wmi_ops tlv_ops =  {
 	.send_obss_spatial_reuse_set = send_obss_spatial_reuse_set_cmd_tlv,
 #endif
 	.extract_offload_bcn_tx_status_evt = extract_offload_bcn_tx_status_evt,
+	.extract_ctl_failsafe_check_ev_param =
+		extract_ctl_failsafe_check_ev_param_tlv,
 };
 
 /**
@@ -11406,6 +11437,8 @@ static void populate_tlv_events_id(uint32_t *event_ids)
 #ifdef AST_HKV1_WORKAROUND
 	event_ids[wmi_wds_peer_event_id] = WMI_WDS_PEER_EVENTID;
 #endif
+	event_ids[wmi_pdev_ctl_failsafe_check_event_id] =
+		WMI_PDEV_CTL_FAILSAFE_CHECK_EVENTID;
 }
 
 /**