|
@@ -2035,6 +2035,57 @@ static int wma_legacy_service_ready_event_handler(uint32_t event_id,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+#ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER
|
|
|
+/**
|
|
|
+ * wma_process_cal_fail_info() - Process cal failure event and
|
|
|
+ * send it to userspace
|
|
|
+ * @wmi_event: Cal failure event data
|
|
|
+ */
|
|
|
+static void wma_process_cal_fail_info(uint8_t *wmi_event)
|
|
|
+{
|
|
|
+ struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
|
|
|
+ uint8_t *buf_ptr;
|
|
|
+ wmi_debug_mesg_fw_cal_failure_param *cal_failure_event;
|
|
|
+
|
|
|
+ if (!mac) {
|
|
|
+ wma_err("Invalid mac context");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!mac->cal_failure_event_cb) {
|
|
|
+ wma_err("Callback not registered for cal failure event");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ buf_ptr = wmi_event;
|
|
|
+ buf_ptr = buf_ptr + sizeof(wmi_debug_mesg_flush_complete_fixed_param) +
|
|
|
+ WMI_TLV_HDR_SIZE +
|
|
|
+ sizeof(wmi_debug_mesg_fw_data_stall_param) + WMI_TLV_HDR_SIZE;
|
|
|
+
|
|
|
+ cal_failure_event = (wmi_debug_mesg_fw_cal_failure_param *)buf_ptr;
|
|
|
+
|
|
|
+ if (((cal_failure_event->tlv_header & 0xFFFF0000) >> 16 ==
|
|
|
+ WMITLV_TAG_STRUC_wmi_debug_mesg_fw_cal_failure_param)) {
|
|
|
+ /**
|
|
|
+ * Log calibration failure information received from FW
|
|
|
+ */
|
|
|
+ wma_debug("Calibration failure event:");
|
|
|
+ wma_debug("calType: %x calFailureReasonCode: %x",
|
|
|
+ cal_failure_event->cal_type,
|
|
|
+ cal_failure_event->cal_failure_reason_code);
|
|
|
+ mac->cal_failure_event_cb(
|
|
|
+ cal_failure_event->cal_type,
|
|
|
+ cal_failure_event->cal_failure_reason_code);
|
|
|
+ } else {
|
|
|
+ wma_err("Invalid TLV header in cal failure event");
|
|
|
+ }
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void wma_process_cal_fail_info(uint8_t *wmi_event)
|
|
|
+{
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/**
|
|
|
* wma_flush_complete_evt_handler() - FW log flush complete event handler
|
|
|
* @handle: WMI handle
|
|
@@ -2066,7 +2117,7 @@ static int wma_flush_complete_evt_handler(void *handle,
|
|
|
reason_code = wmi_event->reserved0;
|
|
|
wma_debug("Received reason code %d from FW", reason_code);
|
|
|
|
|
|
- if (reason_code == WMA_DATA_STALL_TRIGGER) {
|
|
|
+ if (reason_code == WMI_DIAG_TRIGGER_DATA_STALL) {
|
|
|
buf_ptr = (uint8_t *)wmi_event;
|
|
|
buf_ptr = buf_ptr +
|
|
|
sizeof(wmi_debug_mesg_flush_complete_fixed_param) +
|
|
@@ -2075,7 +2126,7 @@ static int wma_flush_complete_evt_handler(void *handle,
|
|
|
(wmi_debug_mesg_fw_data_stall_param *)buf_ptr;
|
|
|
}
|
|
|
|
|
|
- if (reason_code == WMA_DATA_STALL_TRIGGER &&
|
|
|
+ if (reason_code == WMI_DIAG_TRIGGER_DATA_STALL &&
|
|
|
((data_stall_event->tlv_header & 0xFFFF0000) >> 16 ==
|
|
|
WMITLV_TAG_STRUC_wmi_debug_mesg_fw_data_stall_param)) {
|
|
|
/**
|
|
@@ -2125,6 +2176,11 @@ static int wma_flush_complete_evt_handler(void *handle,
|
|
|
data_stall_event->recovery_type);
|
|
|
}
|
|
|
|
|
|
+ if (reason_code == WMI_DIAG_TRIGGER_CAL_FAILURE) {
|
|
|
+ wma_process_cal_fail_info((uint8_t *)wmi_event);
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
* reason_code = 0; Flush event in response to flush command
|
|
|
* reason_code = other value; Asynchronous flush event for fatal events
|