qcacld-3.0: Add support to calibration failure events parsing
Currently there is no provision to get the calibration failure information from the driver. Because of this it is getting difficult to debug the calibration failure issues. To simplify the calibration failure issue debugging, add support to parse calibration failures events in the driver. Change-Id: I6d831804cca259862fea3e8bb4af33d556138d43 CRs-Fixed: 3078926
This commit is contained in:
parent
fe92845d92
commit
63867fd076
1
Kbuild
1
Kbuild
@ -3712,6 +3712,7 @@ cppflags-$(CONFIG_DP_RX_DROP_RAW_FRM) += -DDP_RX_DROP_RAW_FRM
|
||||
cppflags-$(CONFIG_FEATURE_ALIGN_STATS_FROM_DP) += -DFEATURE_ALIGN_STATS_FROM_DP
|
||||
cppflags-$(CONFIG_DP_RX_SPECIAL_FRAME_NEED) += -DDP_RX_SPECIAL_FRAME_NEED
|
||||
cppflags-$(CONFIG_FEATURE_STATS_EXT_V2) += -DFEATURE_STATS_EXT_V2
|
||||
cppflags-$(CONFIG_WLAN_FEATURE_CAL_FAILURE_TRIGGER) += -DWLAN_FEATURE_CAL_FAILURE_TRIGGER
|
||||
|
||||
cppflags-$(CONFIG_VERBOSE_DEBUG) += -DENABLE_VERBOSE_DEBUG
|
||||
cppflags-$(CONFIG_RX_DESC_DEBUG_CHECK) += -DRX_DESC_DEBUG_CHECK
|
||||
|
@ -1461,3 +1461,5 @@ CONFIG_WLAN_FEATURE_11BE_MLO := n
|
||||
CONFIG_WLAN_DEBUG_LINK_VOTE := y
|
||||
|
||||
CONFIG_QCACLD_WLAN_CONNECTIVITY_LOGGING := y
|
||||
|
||||
CONFIG_WLAN_FEATURE_CAL_FAILURE_TRIGGER := y
|
||||
|
@ -14213,6 +14213,31 @@ static void hdd_thermal_stats_cmd_init(struct hdd_context *hdd_ctx)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER
|
||||
/**
|
||||
* hdd_cal_fail_send_event()- send calibration failure information
|
||||
* @cal_type: calibration type
|
||||
* @reason: reason for calibration failure
|
||||
*
|
||||
* This Function sends calibration failure diag event
|
||||
*
|
||||
* Return: void.
|
||||
*/
|
||||
static void hdd_cal_fail_send_event(uint8_t cal_type, uint8_t reason)
|
||||
{
|
||||
/*
|
||||
* For now we are going with the print. Once CST APK has support to
|
||||
* read the diag events then we will add the diag event here.
|
||||
*/
|
||||
hdd_debug("Received cal failure event with cal_type:%x reason:%x",
|
||||
cal_type, reason);
|
||||
}
|
||||
#else
|
||||
static inline void hdd_cal_fail_send_event(uint8_t cal_type, uint8_t reason)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* hdd_features_init() - Init features
|
||||
* @hdd_ctx: HDD context
|
||||
@ -14329,6 +14354,8 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
|
||||
ALLOWED_KEYMGMT_6G_MASK);
|
||||
}
|
||||
hdd_thermal_stats_cmd_init(hdd_ctx);
|
||||
sme_set_cal_failure_event_cb(hdd_ctx->mac_handle,
|
||||
hdd_cal_fail_send_event);
|
||||
|
||||
hdd_exit();
|
||||
return 0;
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@ -821,6 +822,9 @@ struct mac_context {
|
||||
tDot11fIEeht_cap eht_cap_5g;
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER
|
||||
void (*cal_failure_event_cb)(uint8_t cal_type, uint8_t reason);
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef FEATURE_WLAN_TDLS
|
||||
|
@ -2435,6 +2435,27 @@ sme_set_del_peers_ind_callback(mac_handle_t mac_handle,
|
||||
void sme_set_chan_info_callback(mac_handle_t mac_handle,
|
||||
void (*callback)(struct scan_chan_info *chan_info));
|
||||
|
||||
#ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER
|
||||
/**
|
||||
* sme_set_cal_failure_event_cb() - Register calibration failure event callback
|
||||
* @mac_handle - MAC global handle
|
||||
* @callback - calibration failure event callback from HDD
|
||||
*
|
||||
* This API is invoked by HDD to register its callback to mac
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void sme_set_cal_failure_event_cb(
|
||||
mac_handle_t mac_handle,
|
||||
void (*callback)(uint8_t cal_type, uint8_t reason));
|
||||
#else
|
||||
static inline void
|
||||
sme_set_cal_failure_event_cb(mac_handle_t mac_handle,
|
||||
void (*callback)(uint8_t cal_type, uint8_t reason))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* sme_get_rssi_snr_by_bssid() - gets the rssi and snr by bssid from scan cache
|
||||
* @mac_handle: handle returned by mac_open
|
||||
|
@ -12621,6 +12621,30 @@ void sme_set_chan_info_callback(mac_handle_t mac_handle,
|
||||
mac->chan_info_cb = callback;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER
|
||||
void sme_set_cal_failure_event_cb(
|
||||
mac_handle_t mac_handle,
|
||||
void (*callback)(uint8_t cal_type, uint8_t reason))
|
||||
{
|
||||
struct mac_context *mac;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (!mac_handle) {
|
||||
QDF_ASSERT(0);
|
||||
return;
|
||||
}
|
||||
mac = MAC_CONTEXT(mac_handle);
|
||||
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
mac->cal_failure_event_cb = callback;
|
||||
sme_release_global_lock(&mac->sme);
|
||||
} else {
|
||||
sme_err("sme_acquire_global_lock failed");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sme_set_vdev_ies_per_band(mac_handle_t mac_handle, uint8_t vdev_id,
|
||||
enum QDF_OPMODE device_mode)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@ -439,8 +440,6 @@ enum wmamsgtype {
|
||||
WMA_TWT_NUDGE_DIALOG_REQUEST = SIR_HAL_TWT_NUDGE_DIALOG_REQUEST,
|
||||
};
|
||||
|
||||
#define WMA_DATA_STALL_TRIGGER 0x1006
|
||||
|
||||
/* Bit 6 will be used to control BD rate for Management frames */
|
||||
#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user