qcacmn: Change fwlogs API for smartlogs

Add function pointers for calling smartlogs init and deinit.

CRs-Fixed: 2008290
Change-Id: I4734e490394a24f5a39eb50f3ac386ad99834cb3
This commit is contained in:
Pavankumar Nandeshwar
2018-07-16 12:22:42 +05:30
committed by nshrivas
parent 420a4425dc
commit ad5e0bd66f
5 changed files with 75 additions and 6 deletions

View File

@@ -1960,5 +1960,7 @@ uint8_t *hif_log_dump_ce(struct hif_softc *scn, uint8_t *buf_cur,
return buf_cur; return buf_cur;
} }
qdf_export_symbol(hif_log_dump_ce);
#endif /* OL_ATH_SMART_LOGGING */ #endif /* OL_ATH_SMART_LOGGING */

View File

@@ -47,12 +47,13 @@ int fwdbg_fw_handler(struct common_dbglog_handle *dbg_handle, ol_scn_t soc,
} }
int fwdbg_parse_debug_logs(struct common_dbglog_handle *dbg_handle, int fwdbg_parse_debug_logs(struct common_dbglog_handle *dbg_handle,
const char *name, uint8_t *datap, uint16_t len, void *context) ol_scn_t soc, uint8_t *datap,
uint16_t len, void *context)
{ {
struct dbglog_info *dbg_info = handle2info(dbg_handle); struct dbglog_info *dbg_info = handle2info(dbg_handle);
if (dbg_info->ops->dbglog_parse_debug_logs) if (dbg_info->ops->dbglog_parse_debug_logs)
return dbg_info->ops->dbglog_parse_debug_logs(name, return dbg_info->ops->dbglog_parse_debug_logs(soc,
datap, len, context); datap, len, context);
return 0; return 0;
@@ -139,3 +140,32 @@ void fwdbg_set_report_size(struct common_dbglog_handle *dbg_handle,
} }
int fwdbg_smartlog_init(struct common_dbglog_handle *dbg_handle, void *soc)
{
struct dbglog_info *dbg_info = handle2info(dbg_handle);
if (dbg_info->ops->smartlog_init)
return dbg_info->ops->smartlog_init(soc);
return 0;
}
void fwdbg_smartlog_deinit(struct common_dbglog_handle *dbg_handle, void *sc)
{
struct dbglog_info *dbg_info = handle2info(dbg_handle);
if (dbg_info->ops->smartlog_deinit)
dbg_info->ops->smartlog_deinit(sc);
}
ssize_t fwdbg_smartlog_dump(struct common_dbglog_handle *dbg_handle,
struct device *dev,
struct device_attribute *attr, char *buf)
{
struct dbglog_info *dbg_info = handle2info(dbg_handle);
if (dbg_info->ops->smartlog_dump)
return dbg_info->ops->smartlog_dump(dev, attr, buf);
return 0;
}

View File

@@ -49,7 +49,7 @@ int fwdbg_fw_handler(struct common_dbglog_handle *dbg_handle, ol_scn_t sc,
/** /**
* fwdbg_parse_debug_logs() - API to parse firmware debug logs * fwdbg_parse_debug_logs() - API to parse firmware debug logs
* @dbg_handle: Debug module handle * @dbg_handle: Debug module handle
* @name: device name * @soc: soc handle
* @datap: Reference to log data * @datap: Reference to log data
* @len: length of data * @len: length of data
* @context: log context * @context: log context
@@ -59,7 +59,7 @@ int fwdbg_fw_handler(struct common_dbglog_handle *dbg_handle, ol_scn_t sc,
* Return: 0 success * Return: 0 success
*/ */
int fwdbg_parse_debug_logs(struct common_dbglog_handle *dbg_handle, int fwdbg_parse_debug_logs(struct common_dbglog_handle *dbg_handle,
const char *name, uint8_t *datap, ol_scn_t soc, uint8_t *datap,
uint16_t len, void *context); uint16_t len, void *context);
/** /**
@@ -169,4 +169,35 @@ void fwdbg_free(struct common_dbglog_handle *dbg_handle, void *soc);
void fwdbg_set_report_size(struct common_dbglog_handle *dbg_handle, void fwdbg_set_report_size(struct common_dbglog_handle *dbg_handle,
ol_scn_t scn, uint16_t size); ol_scn_t scn, uint16_t size);
/**
* fwdbg_smartlog_init() - initialize smart logging feature
* @dbg_handle: Debug module handle
* @soc: soc handler
*
* Return: 0 Success
*/
int fwdbg_smartlog_init(struct common_dbglog_handle *dbg_handle, void *soc);
/**
* fwdbg_smartlog_deinit() - uninitializes smart logging feature
* @dbg_handle: Debug module handle
* @sc: sc handler
*
* Return: None
*/
void fwdbg_smartlog_deinit(struct common_dbglog_handle *dbg_handle, void *sc);
/**
* fwdbg_smartlog_dump() - dumps smart logs
* @dev: dev handler
* @dbg_handle: Debug module handle
* @attr: dev handler attributes
* @buf: destination buffer to dump smart logs
*
* Return: 0 success
*/
ssize_t fwdbg_smartlog_dump(struct common_dbglog_handle *dbg_handle,
struct device *dev,
struct device_attribute *attr, char *buf);
#endif /* _FW_DBGLOG_API_H_ */ #endif /* _FW_DBGLOG_API_H_ */

View File

@@ -29,8 +29,8 @@ struct dbglog_ops {
void (*dbglog_set_log_lvl)(ol_scn_t scn, uint32_t log_lvl); void (*dbglog_set_log_lvl)(ol_scn_t scn, uint32_t log_lvl);
int (*dbglog_fw_handler)(ol_scn_t soc, uint8_t *data, uint32_t datalen); int (*dbglog_fw_handler)(ol_scn_t soc, uint8_t *data, uint32_t datalen);
int (*dbglog_parse_debug_logs)(const char *name, int (*dbglog_parse_debug_logs)(ol_scn_t scn,
u_int8_t *datap, uint16_t len, void *context); u_int8_t *datap, uint16_t len, void *context);
void (*dbglog_ratelimit_set)(uint32_t burst_limit); void (*dbglog_ratelimit_set)(uint32_t burst_limit);
void (*dbglog_vap_log_enable)(ol_scn_t soc, uint16_t vap_id, void (*dbglog_vap_log_enable)(ol_scn_t soc, uint16_t vap_id,
bool isenable); bool isenable);
@@ -41,6 +41,10 @@ void (*dbglog_module_log_enable)(ol_scn_t scn,
void (*dbglog_init)(void *scn); void (*dbglog_init)(void *scn);
void (*dbglog_set_report_size)(ol_scn_t scn, uint16_t size); void (*dbglog_set_report_size)(ol_scn_t scn, uint16_t size);
void (*dbglog_free)(void *soc); void (*dbglog_free)(void *soc);
int (*smartlog_init)(void *sc);
void (*smartlog_deinit)(void *sc);
ssize_t (*smartlog_dump)(struct device *dev,
struct device_attribute *attr, char *buf);
}; };

View File

@@ -4420,6 +4420,8 @@ QDF_STATUS wmi_extract_smartlog_ev(void *wmi_hdl,
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
qdf_export_symbol(wmi_extract_smartlog_ev);
#endif /* OL_ATH_SMART_LOGGING */ #endif /* OL_ATH_SMART_LOGGING */
QDF_STATUS QDF_STATUS