diff --git a/qdf/inc/qdf_debugfs.h b/qdf/inc/qdf_debugfs.h index 99017e1b38..b4e965ccd8 100644 --- a/qdf/inc/qdf_debugfs.h +++ b/qdf/inc/qdf_debugfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -111,10 +111,21 @@ void qdf_debugfs_printf(qdf_debugfs_file_t file, const char *f, ...); * @file: debugfs file handle passed in fops->show() function. * @buf: data * @len: data length + * @rowsize: row size in bytes to dump + * @groupsize: group size in bytes to dump * */ void qdf_debugfs_hexdump(qdf_debugfs_file_t file, const uint8_t *buf, - qdf_size_t len); + qdf_size_t len, int rowsize, int groupsize); + +/** + * qdf_debugfs_overflow() - check overflow occurrence in debugfs buffer + * @file: debugfs file handle passed in fops->show() function. + * + * Return: 1 on overflow occurrence else 0 + * + */ +bool qdf_debugfs_overflow(qdf_debugfs_file_t file); /** * qdf_debugfs_write() - write data into debugfs file @@ -260,10 +271,16 @@ static inline void qdf_debugfs_printf(qdf_debugfs_file_t file, const char *f, } static inline void qdf_debugfs_hexdump(qdf_debugfs_file_t file, - const uint8_t *buf, qdf_size_t len) + const uint8_t *buf, qdf_size_t len, + int rowsize, int groupsize) { } +static inline bool qdf_debugfs_overflow(qdf_debugfs_file_t file) +{ + return 0; +} + static inline void qdf_debugfs_write(qdf_debugfs_file_t file, const uint8_t *buf, qdf_size_t len) { diff --git a/qdf/linux/src/qdf_debugfs.c b/qdf/linux/src/qdf_debugfs.c index 054a1ee12d..66664a9627 100644 --- a/qdf/linux/src/qdf_debugfs.c +++ b/qdf/linux/src/qdf_debugfs.c @@ -170,18 +170,17 @@ void qdf_debugfs_printf(qdf_debugfs_file_t file, const char *f, ...) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) void qdf_debugfs_hexdump(qdf_debugfs_file_t file, const uint8_t *buf, - qdf_size_t len) + qdf_size_t len, int rowsize, int groupsize) { - seq_hex_dump(file, "", DUMP_PREFIX_OFFSET, 16, 4, buf, len, false); + seq_hex_dump(file, "", DUMP_PREFIX_OFFSET, rowsize, groupsize, buf, len, + false); } #else void qdf_debugfs_hexdump(qdf_debugfs_file_t file, const uint8_t *buf, - qdf_size_t len) + qdf_size_t len, int rowsize, int groupsize) { - const size_t rowsize = 16; - const size_t groupsize = 4; char *dst; size_t dstlen, readlen; int prefix = 0; @@ -206,6 +205,11 @@ void qdf_debugfs_hexdump(qdf_debugfs_file_t file, const uint8_t *buf, #endif +bool qdf_debugfs_overflow(qdf_debugfs_file_t file) +{ + return seq_has_overflowed(file); +} + void qdf_debugfs_write(qdf_debugfs_file_t file, const uint8_t *buf, qdf_size_t len) {