qcacmn: Add support to collect pktlogs as part of bugreport

Add infrastructure in pktlog utils to collect pktlogs as part
of bug report generation. As part of this when pktlog read command
is received on host:
1. disable pktlog,
2. read pktlog,
3. clear pktlog buffer,and
4. Retain pktlog initial state

Change-Id: I67e2231c2897007b58fa42a4f931b3c35ad1f418
CRs-Fixed: 2031287
This commit is contained in:
Poddar, Siddarth
2017-04-10 15:14:22 +05:30
committed by Sandeep Puligilla
parent d4aa277e8b
commit 3a52bd7e6a
3 changed files with 192 additions and 5 deletions

View File

@@ -61,11 +61,39 @@ void ol_pl_sethandle(ol_pktlog_dev_handle *pl_handle,
/* Packet log state information */
#ifndef _PKTLOG_INFO
#define _PKTLOG_INFO
/**
* enum ath_pktlog_state - pktlog status
* @PKTLOG_OPR_IN_PROGRESS : pktlog command in progress
* @PKTLOG_OPR_IN_PROGRESS_READ_START: pktlog read is issued
* @PKTLOG_OPR_IN_PROGRESS_READ_START_PKTLOG_DISABLED:
* as part of pktlog read, pktlog is disabled
* @PKTLOG_OPR_IN_PROGRESS_READ_COMPLETE:
* as part of read, till pktlog read is complete
* @PKTLOG_OPR_IN_PROGRESS_CLEARBUFF_COMPLETE:
* as part of read, pktlog clear buffer is done
* @PKTLOG_OPR_NOT_IN_PROGRESS: no pktlog command in progress
*/
enum ath_pktlog_state {
PKTLOG_OPR_IN_PROGRESS = 0,
PKTLOG_OPR_IN_PROGRESS_READ_START,
PKTLOG_OPR_IN_PROGRESS_READ_START_PKTLOG_DISABLED,
PKTLOG_OPR_IN_PROGRESS_READ_COMPLETE,
PKTLOG_OPR_IN_PROGRESS_CLEARBUFF_COMPLETE,
PKTLOG_OPR_NOT_IN_PROGRESS
};
struct ath_pktlog_info {
struct ath_pktlog_buf *buf;
uint32_t log_state;
uint32_t saved_state;
uint32_t options;
/* Initial saved state: It will save the log state in pktlog
* open and used in pktlog release after
* pktlog read is complete.
*/
uint32_t init_saved_state;
enum ath_pktlog_state curr_pkt_state;
/* Size of buffer in bytes */
int32_t buf_size;