diff options
| author | Poddar, Siddarth <siddpodd@codeaurora.org> | 2016-09-01 18:42:40 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-09-10 19:08:41 -0700 |
| commit | 2a8bb56299c55b6929a7aae52b279da549fd09ee (patch) | |
| tree | f59782679dff869ecfe69b842276c25c6dd7f206 | |
| parent | f03f81036d4ccee76918e71a5c3f8a50c233cea1 (diff) | |
qcacld-3.0: Store events in pktlog buffer when Pktlog is enabled by default in INI
When pktlog is enabled in INI (i.e. no iwpriv commands are issued),
store the events forwarded from firmware into the pktlog buffer.
Host will not honor any pktlog disable command if pktlog enable command
was not sent previously with WMI_PKTLOG_ENABLE_FORCE.
Change-Id: Id0b7dd6b4573147eef9b80b57bc78284e52807ec
CRs-Fixed: 1062295
(cherry picked from commit 07e5fbfcf0ec1ca7e92721a523e401e70887f487)
| -rw-r--r-- | core/utils/pktlog/include/pktlog_ac.h | 1 | ||||
| -rw-r--r-- | core/utils/pktlog/linux_ac.c | 9 | ||||
| -rw-r--r-- | core/utils/pktlog/pktlog_ac.c | 15 |
3 files changed, 22 insertions, 3 deletions
diff --git a/core/utils/pktlog/include/pktlog_ac.h b/core/utils/pktlog/include/pktlog_ac.h index 9d213e0c76bb..cd45f6987aae 100644 --- a/core/utils/pktlog/include/pktlog_ac.h +++ b/core/utils/pktlog/include/pktlog_ac.h @@ -104,6 +104,7 @@ struct ol_pktlog_dev_t { uint32_t htc_err_cnt; uint8_t htc_endpoint; void *htc_pdev; + bool enable_flag; }; #define PKTLOG_SYSCTL_SIZE 14 diff --git a/core/utils/pktlog/linux_ac.c b/core/utils/pktlog/linux_ac.c index b92de81f683d..c312b5903487 100644 --- a/core/utils/pktlog/linux_ac.c +++ b/core/utils/pktlog/linux_ac.c @@ -230,9 +230,13 @@ qdf_sysctl_decl(ath_sysctl_pktlog_enable, ctl, write, filp, buffer, lenp, ppos) ret = QDF_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); if (ret == 0) + /* + * enable/disable pktlog through sysfs should be counted + * as user_triggered = 1. + */ ret = pl_dev->pl_funcs->pktlog_enable( (struct hif_opaque_softc *)scn, enable, - cds_is_packet_log_enabled(), 0); + cds_is_packet_log_enabled(), 1); else printk(PKTLOG_TAG "%s:proc_dointvec failed\n", __func__); @@ -440,6 +444,7 @@ static int pktlog_attach(struct hif_opaque_softc *scn) * might be good to move to pktlog_init */ /* pl_dev->tgt_pktlog_alloced = false; */ + pl_dev->enable_flag = false; pl_info_lnx->proc_entry = NULL; pl_info_lnx->sysctl_header = NULL; @@ -509,7 +514,7 @@ static void pktlog_detach(struct hif_opaque_softc *scn) ASSERT(0); return; } - + pl_dev->enable_flag = false; pl_info = pl_dev->pl_info; remove_proc_entry(WLANDEV_BASENAME, g_pktlog_pde); pktlog_sysctl_unregister(pl_dev); diff --git a/core/utils/pktlog/pktlog_ac.c b/core/utils/pktlog/pktlog_ac.c index db6284871bc4..d3055e134485 100644 --- a/core/utils/pktlog/pktlog_ac.c +++ b/core/utils/pktlog/pktlog_ac.c @@ -311,6 +311,7 @@ int pktlog_disable(struct hif_opaque_softc *scn) return -EFAULT; pl_dev = txrx_pdev->pl_dev; + pl_dev->enable_flag = false; pl_info = pl_dev->pl_info; if (pktlog_wma_post_msg(0, WMI_PDEV_PKTLOG_DISABLE_CMDID, 0, 0)) { @@ -355,6 +356,7 @@ void pktlog_init(struct hif_opaque_softc *scn) pl_info->pktlen = 0; pl_info->start_time_thruput = 0; pl_info->start_time_per = 0; + pdev_txrx_handle->pl_dev->enable_flag = false; PKTLOG_TX_SUBSCRIBER.callback = pktlog_callback; PKTLOG_RX_SUBSCRIBER.callback = pktlog_callback; @@ -396,6 +398,17 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, if (!pl_info) return 0; + /* + * Do not send the pktlog disable command in case when pktlog + * is enabled from INI during init, SO make enable_flag as false. + * send the pktlog disable command only after when user will triggere + * iwpriv pktlog enable command or enable through pktlog conf tool or + * vendor will send pktlog enable command. + */ + if (ini_triggered == 1 && user_triggered == 0 && log_state != 0) + pl_dev->enable_flag = false; + else if (log_state != 0) + pl_dev->enable_flag = true; if (!pl_dev->tgt_pktlog_alloced) { if (pl_info->buf == NULL) { @@ -442,7 +455,7 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, printk("Device cannot be enabled, %s\n", __func__); return -1; } - } else { + } else if (pl_dev->enable_flag) { pl_dev->pl_funcs->pktlog_disable(scn); } |
