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)
This commit is contained in:
Poddar, Siddarth 2016-09-01 18:42:40 +05:30 • committed by qcabuildsw
commit 2a8bb56299
3 changed files with 22 additions and 3 deletions

View file

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

View file

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

View file

@ -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);
}