diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c index 638b7aee8e6b..2ade123cf0f3 100644 --- a/target_if/spectral/target_if_spectral.c +++ b/target_if/spectral/target_if_spectral.c @@ -2886,13 +2886,14 @@ void target_if_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev, struct wmi_spectral_cmd_ops *cmd_ops) { - struct target_if_spectral *spectral = NULL; + struct target_if_spectral *spectral = + get_target_if_spectral_handle_from_pdev(pdev); - spectral = get_target_if_spectral_handle_from_pdev(pdev); - spectral->param_wmi_cmd_ops.wmi_spectral_configure_cmd_send = - cmd_ops->wmi_spectral_configure_cmd_send; - spectral->param_wmi_cmd_ops.wmi_spectral_enable_cmd_send = - cmd_ops->wmi_spectral_enable_cmd_send; + if (!spectral) { + spectral_err("Spectral LMAC object is null"); + return; + } + spectral->param_wmi_cmd_ops = *cmd_ops; } /** diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h index bf56bb587bb0..01253b6cee3b 100644 --- a/target_if/spectral/target_if_spectral.h +++ b/target_if/spectral/target_if_spectral.h @@ -688,8 +688,9 @@ struct vdev_spectral_enable_params; /** * struct wmi_spectral_cmd_ops - structure used holding the operations * related to wmi commands on spectral parameters. - * @wmi_spectral_configure_cmd_send: - * @wmi_spectral_enable_cmd_send: + * @wmi_spectral_configure_cmd_send: Configure Spectral parameters + * @wmi_spectral_enable_cmd_send: Enable/Disable Spectral + * @wmi_spectral_crash_inject: Inject FW crash */ struct wmi_spectral_cmd_ops { QDF_STATUS (*wmi_spectral_configure_cmd_send)( @@ -698,6 +699,8 @@ struct wmi_spectral_cmd_ops { QDF_STATUS (*wmi_spectral_enable_cmd_send)( wmi_unified_t wmi_hdl, struct vdev_spectral_enable_params *param); + QDF_STATUS(*wmi_spectral_crash_inject)( + wmi_unified_t wmi_handle, struct crash_inject *param); }; /** @@ -1894,6 +1897,14 @@ target_if_consume_spectral_report_gen3( struct spectral_report *report); #endif +/** + * target_if_spectral_fw_hang() - Crash the FW from Spectral module + * @spectral: Pointer to Spectral LMAC object + * + * Return: QDF_STATUS of operation + */ +QDF_STATUS target_if_spectral_fw_hang(struct target_if_spectral *spectral); + #ifdef WIN32 #pragma pack(pop, target_if_spectral) #endif diff --git a/target_if/spectral/target_if_spectral_phyerr.c b/target_if/spectral/target_if_spectral_phyerr.c index 79e258486eb8..3fc9b8a15416 100644 --- a/target_if/spectral/target_if_spectral_phyerr.c +++ b/target_if/spectral/target_if_spectral_phyerr.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef DIRECT_BUF_RX_ENABLE #include #endif @@ -152,6 +153,21 @@ target_if_spectral_dump_fft(uint8_t *pfft, int fftlen) return 0; } +QDF_STATUS target_if_spectral_fw_hang(struct target_if_spectral *spectral) +{ + struct crash_inject param; + + if (!spectral) { + spectral_err("Spectral LMAC object is null"); + return QDF_STATUS_E_INVAL; + } + qdf_mem_set(¶m, sizeof(param), 0); + param.type = 1; //RECOVERY_SIM_ASSERT + + return spectral->param_wmi_cmd_ops.wmi_spectral_crash_inject( + GET_WMI_HDL_FROM_PDEV(spectral->pdev_obj), ¶m); +} + void target_if_dbg_print_samp_param(struct target_if_samp_msg_params *p) {