diff --git a/Kconfig b/Kconfig index f0dd167c3c..d5f4209c5d 100644 --- a/Kconfig +++ b/Kconfig @@ -751,6 +751,37 @@ config DEBUG_NET_INFO endif # DEBUG_NET +config DEBUG_POWER + bool "Power-related Debug Features" + default n + ---help--- + Enable power-related debug features. + +if DEBUG_POWER + +config DEBUG_POWER_ERROR + bool "Power-related Error Output" + default n + depends on DEBUG_ERROR + ---help--- + Enable power-related error output to SYSLOG. + +config DEBUG_POWER_WARN + bool "Power-related Warnings Output" + default n + depends on DEBUG_WARN + ---help--- + Enable power-related warning output to SYSLOG. + +config DEBUG_POWER_INFO + bool "Power-related Informational Output" + default n + depends on DEBUG_INFO + ---help--- + Enable power-related informational output to SYSLOG. + +endif # DEBUG_POWER + config DEBUG_WIRELESS bool "Wireless Debug Features" default n diff --git a/include/debug.h b/include/debug.h index 64352dad34..d7fe4ff642 100644 --- a/include/debug.h +++ b/include/debug.h @@ -233,6 +233,24 @@ # define ninfo(x...) #endif +#ifdef CONFIG_DEBUG_POWER_ERROR +# define pwrerr(format, ...) _err(format, ##__VA_ARGS__) +#else +# define pwrerr(x...) +#endif + +#ifdef CONFIG_DEBUG_POWER_WARN +# define pwrwarn(format, ...) _warn(format, ##__VA_ARGS__) +#else +# define pwrwarn(x...) +#endif + +#ifdef CONFIG_DEBUG_POWER_INFO +# define pwrinfo(format, ...) _info(format, ##__VA_ARGS__) +#else +# define pwrinfo(x...) +#endif + #ifdef CONFIG_DEBUG_WIRELESS_ERROR # define wlerr(format, ...) _err(format, ##__VA_ARGS__) #else @@ -795,6 +813,24 @@ # define ninfo (void) #endif +#ifdef CONFIG_DEBUG_POWER_ERROR +# define pwrerr _err +#else +# define pwrerr (void) +#endif + +#ifdef CONFIG_DEBUG_POWER_WARN +# define pwrwarn _warn +#else +# define pwrwarn (void) +#endif + +#ifdef CONFIG_DEBUG_POWER_INFO +# define pwrinfo _info +#else +# define pwrinfo (void) +#endif + #ifdef CONFIG_DEBUG_WIRELESS_ERROR # define wlerr _err #else @@ -1303,6 +1339,14 @@ # define ninfodumpbuffer(m,b,n) #endif +#ifdef CONFIG_DEBUG_POWER +# define pwrerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) +# define pwrinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) +#else +# define pwrerrdumpbuffer(m,b,n) +# define pwrinfodumpbuffer(m,b,n) +#endif + #ifdef CONFIG_DEBUG_WIRELESS # define wlerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define wlinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)