qcacld-2.0: enable pktlog support for HL project
Currently for SDIO implementation, tx comp indication is
suppressed and tx_desc is freed when htt download is done.
This leads to invalid tx_desc being referenced when pktlog
indication handler wants to collect TX-ed tx_desc information.
Fix consists of two parts:
1. When pktlog is enabled in ini, enable tx comp indication
handler just like PCIe and USB. tx_desc is still valid when
pktlog indication comes.
2. Check vdev pointer embedded in tx_desc structure. vdev
pointer is set when tx_desc is allocated and set to NULL when
tx_desc is freed. This guards against invalid tx_desc_id
from firmware.
Note that performance drops should be expected when
pktlog is enabled on HL platforms.
Change-ID: I97729d1c56d27292cdbf4c80f695785c556c56bb
CRs-Fixed: 2034996
diff --git a/CORE/CLD_TXRX/TXRX/ol_tx_desc.h b/CORE/CLD_TXRX/TXRX/ol_tx_desc.h
index 4725946..06fd1a1 100644
--- a/CORE/CLD_TXRX/TXRX/ol_tx_desc.h
+++ b/CORE/CLD_TXRX/TXRX/ol_tx_desc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -133,7 +133,15 @@
static inline struct ol_tx_desc_t *
ol_tx_desc_find_check(struct ol_txrx_pdev_t *pdev, u_int16_t tx_desc_id)
{
- return ol_tx_desc_find(pdev, tx_desc_id);
+ struct ol_tx_desc_t *tx_desc;
+
+ tx_desc = ol_tx_desc_find(pdev, tx_desc_id);
+
+ /* check against invalid tx_desc_id */
+ if (ol_cfg_is_high_latency(pdev->ctrl_pdev) && !tx_desc->vdev)
+ return NULL;
+
+ return tx_desc;
}
#endif