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
This commit is contained in:
Karthik Kantamneni
2021-11-29 12:00:16 +05:30
committed by Madan Koyyalamudi
parent 9f3995df8f
commit b2d135c7fd

View File

@@ -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