From ad5e0bd66fc537cf6c446644d143e57db6263b3d Mon Sep 17 00:00:00 2001 From: Pavankumar Nandeshwar Date: Mon, 16 Jul 2018 12:22:42 +0530 Subject: [PATCH] qcacmn: Change fwlogs API for smartlogs Add function pointers for calling smartlogs init and deinit. CRs-Fixed: 2008290 Change-Id: I4734e490394a24f5a39eb50f3ac386ad99834cb3 --- hif/src/ce/ce_service.c | 2 ++ utils/fwlog/fw_dbglog_api.c | 34 +++++++++++++++++++++++++++++-- utils/fwlog/inc/fw_dbglog_api.h | 35 ++++++++++++++++++++++++++++++-- utils/fwlog/inc/fw_dbglog_priv.h | 8 ++++++-- wmi/src/wmi_unified_api.c | 2 ++ 5 files changed, 75 insertions(+), 6 deletions(-) diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 29e453181c9d..a26e41370912 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -1960,5 +1960,7 @@ uint8_t *hif_log_dump_ce(struct hif_softc *scn, uint8_t *buf_cur, return buf_cur; } + +qdf_export_symbol(hif_log_dump_ce); #endif /* OL_ATH_SMART_LOGGING */ diff --git a/utils/fwlog/fw_dbglog_api.c b/utils/fwlog/fw_dbglog_api.c index 388f9b43cb3b..387ef13406d5 100644 --- a/utils/fwlog/fw_dbglog_api.c +++ b/utils/fwlog/fw_dbglog_api.c @@ -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, - 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); 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); 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; +} diff --git a/utils/fwlog/inc/fw_dbglog_api.h b/utils/fwlog/inc/fw_dbglog_api.h index b649efeb35c0..35f8e9531d7a 100644 --- a/utils/fwlog/inc/fw_dbglog_api.h +++ b/utils/fwlog/inc/fw_dbglog_api.h @@ -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 * @dbg_handle: Debug module handle - * @name: device name + * @soc: soc handle * @datap: Reference to log data * @len: length of data * @context: log context @@ -59,7 +59,7 @@ int fwdbg_fw_handler(struct common_dbglog_handle *dbg_handle, ol_scn_t sc, * Return: 0 success */ 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); /** @@ -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, 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_ */ diff --git a/utils/fwlog/inc/fw_dbglog_priv.h b/utils/fwlog/inc/fw_dbglog_priv.h index 3820432b80c0..e07b1d460836 100644 --- a/utils/fwlog/inc/fw_dbglog_priv.h +++ b/utils/fwlog/inc/fw_dbglog_priv.h @@ -29,8 +29,8 @@ struct dbglog_ops { 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_parse_debug_logs)(const char *name, - u_int8_t *datap, uint16_t len, void *context); +int (*dbglog_parse_debug_logs)(ol_scn_t scn, + u_int8_t *datap, uint16_t len, void *context); void (*dbglog_ratelimit_set)(uint32_t burst_limit); void (*dbglog_vap_log_enable)(ol_scn_t soc, uint16_t vap_id, bool isenable); @@ -41,6 +41,10 @@ void (*dbglog_module_log_enable)(ol_scn_t scn, void (*dbglog_init)(void *scn); void (*dbglog_set_report_size)(ol_scn_t scn, uint16_t size); 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); }; diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 69da2d8a29f3..77be87031ff6 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -4420,6 +4420,8 @@ QDF_STATUS wmi_extract_smartlog_ev(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } + +qdf_export_symbol(wmi_extract_smartlog_ev); #endif /* OL_ATH_SMART_LOGGING */ QDF_STATUS