qcacmn: add utf event exception handler for invalid pdev_id

For the case in DBS, the psoc and pdev is one-to-one mapping,
but firmware will send per pdev_id information to host according
to the radio being tested, add a backup query to SOC_ID if the
pdev_id passed along from utf_event is invalid/unsupported to
work around this case.

Change-Id: I67645da67a968b66b720f211a9a0815a4cc22845
CRs-fixed: 2286291
此提交包含在:
Ryan Hsu
2018-07-24 18:59:40 -07:00
提交者 nshrivas
父節點 c3e68bc67d
當前提交 919ecb00a7
共有 2 個檔案被更改,包括 14 行新增4 行删除

查看文件

@@ -30,6 +30,8 @@
#include "wmi_unified_priv.h"
#include "wmi_unified_param.h"
#define TGT_WMI_PDEV_ID_SOC 0 /* WMI SOC ID */
/* ASCII "TGT\0" */
#define TGT_MAGIC 0x54575400

查看文件

@@ -43,6 +43,7 @@ target_if_ftm_process_utf_event(ol_scn_t sc, uint8_t *event_buf, uint32_t len)
struct wmi_host_pdev_utf_event event;
struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
uint32_t pdev_id;
psoc = target_if_get_psoc_from_scn_hdl(sc);
if (!psoc) {
@@ -64,11 +65,18 @@ target_if_ftm_process_utf_event(ol_scn_t sc, uint8_t *event_buf, uint32_t len)
return QDF_STATUS_E_INVAL;
}
pdev = wlan_objmgr_get_pdev_by_id(psoc, event.pdev_id, WLAN_FTM_ID);
pdev_id = event.pdev_id;
pdev = wlan_objmgr_get_pdev_by_id(psoc, pdev_id, WLAN_FTM_ID);
if (!pdev) {
ftm_err("null pdev");
wlan_objmgr_psoc_release_ref(psoc, WLAN_FTM_ID);
return QDF_STATUS_E_INVAL;
pdev_id = TGT_WMI_PDEV_ID_SOC;
ftm_debug("Can't find pdev by pdev_id %d, try soc_id",
event.pdev_id);
pdev = wlan_objmgr_get_pdev_by_id(psoc, pdev_id, WLAN_FTM_ID);
if (!pdev) {
ftm_err("null pdev");
wlan_objmgr_psoc_release_ref(psoc, WLAN_FTM_ID);
return QDF_STATUS_E_INVAL;
}
}
ftm_rx_ops = target_if_ftm_get_rx_ops(psoc);