kernel-brax3-ubuntu-touch/drivers/misc/mediatek/connectivity/common/conn_dbg.h
erascape f319b992b1 kernel-5.15: Initial import brax3 UT kernel
* halium configs enabled

Signed-off-by: erascape <erascape@proton.me>
2025-09-23 15:17:10 +00:00

32 lines
683 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2022 MediaTek Inc.
*/
#ifndef CONN_DBG_H
#define CONN_DBG_H
enum conn_dbg_log_type {
CONN_DBG_LOG_TYPE_HW_ERR = 0,
CONN_DBG_LOG_TYPE_NUM
};
/* Use this function if you want to add log everytime */
int conn_dbg_add_log(enum conn_dbg_log_type type, const char *buf);
/* Use this function if you want to add log only once. */
#define conn_dbg_add_log_once(_type, _buf) \
do { \
static int _print;\
\
if (_print == 0)\
conn_dbg_add_log(_type, _buf);\
else {\
pr_info("%s type %d, log: [%s]. have been added %d times.",\
__func__, _type, _buf, _print);\
} \
_print++;\
\
} while (0) \
#endif /* CONN_DBG_H */