diff options
author | cem <cem@FreeBSD.org> | 2015-11-11 18:55:53 +0000 |
---|---|---|
committer | cem <cem@FreeBSD.org> | 2015-11-11 18:55:53 +0000 |
commit | ba49bb5baefacdaec55643cba2277f23f6ce9b6b (patch) | |
tree | cf385e9e8150f94402347deb67203a583fb45e4c | |
parent | 4a84a32fda145cb4ef6e876264f90b228b63a0a1 (diff) | |
download | FreeBSD-src-ba49bb5baefacdaec55643cba2277f23f6ce9b6b.zip FreeBSD-src-ba49bb5baefacdaec55643cba2277f23f6ce9b6b.tar.gz |
ntb_hw: Similarly, add a debug-leveled macro for ntb_hw
Sponsored by: EMC / Isilon Storage Division
-rw-r--r-- | sys/dev/ntb/ntb_hw/ntb_hw.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c index e2bcd9c..1980518 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw.c @@ -317,6 +317,15 @@ static int sysctl_handle_features(SYSCTL_HANDLER_ARGS); static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS); static int sysctl_handle_register(SYSCTL_HANDLER_ARGS); +static unsigned g_ntb_hw_debug_level; +SYSCTL_UINT(_hw_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, + &g_ntb_hw_debug_level, 0, "ntb_hw log level -- higher is more verbose"); +#define ntb_printf(lvl, ...) do { \ + if ((lvl) <= g_ntb_hw_debug_level) { \ + device_printf(ntb->device, __VA_ARGS__); \ + } \ +} while (0) + static struct ntb_hw_info pci_ids[] = { /* XXX: PS/SS IDs left out until they are supported. */ { 0x0C4E8086, "BWD Atom Processor S1200 Non-Transparent Bridge B2B", |