From b2d135c7fdf469580d13e5a8de2d218f8c04aa4b Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Mon, 29 Nov 2021 12:00:16 +0530 Subject: [PATCH] qcacmn: Fix WMI DIAG event drop over CE7 When WMI diag events are received over CE7, wmi handle is mapped to null and all the diag events are freed without processing. Fix this by properly mapping wmi handle when diag events received over CE7. Change-Id: I3dc4f7ce37981a31cb6f01fc66edf6248682bea3 CRs-Fixed: 3082960 --- wmi/src/wmi_unified.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 80c691f63b..84d78dba63 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015-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 @@ -2612,8 +2613,7 @@ static void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet) wmi_process_control_rx(wmi_handle, evt_buf); } -#if defined(WLAN_FEATURE_WMI_DIAG_OVER_CE7) || \ - defined(WLAN_DIAG_AND_DBR_OVER_SEPARATE_CE) +#if defined(WLAN_FEATURE_WMI_DIAG_OVER_CE7) /** * wmi_control_diag_rx() - process diag fw events callbacks * @ctx: handle to wmi @@ -2629,6 +2629,26 @@ static void wmi_control_diag_rx(void *ctx, HTC_PACKET *htc_packet) evt_buf = (wmi_buf_t)htc_packet->pPktContext; + wmi_handle = soc->wmi_pdev[0]; + + if (!wmi_handle) { + wmi_err("unable to get wmi_handle for diag event end point id:%d", htc_packet->Endpoint); + qdf_nbuf_free(evt_buf); + return; + } + + wmi_process_control_rx(wmi_handle, evt_buf); +} + +#elif defined(WLAN_DIAG_AND_DBR_OVER_SEPARATE_CE) +static void wmi_control_diag_rx(void *ctx, HTC_PACKET *htc_packet) +{ + struct wmi_soc *soc = (struct wmi_soc *)ctx; + struct wmi_unified *wmi_handle; + wmi_buf_t evt_buf; + + evt_buf = (wmi_buf_t)htc_packet->pPktContext; + wmi_handle = wmi_get_pdev_ep(soc, htc_packet->Endpoint); if (!wmi_handle) { @@ -2639,6 +2659,7 @@ static void wmi_control_diag_rx(void *ctx, HTC_PACKET *htc_packet) wmi_process_control_rx(wmi_handle, evt_buf); } + #endif #ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI