Pull bugzilla-9429 into release branch
[pv_ops_mirror.git] / drivers / net / ibm_newemac / debug.h
blob1dd2dcbc157fec1a49a35e7869ad136aed2cdc0e
1 /*
2 * drivers/net/ibm_newemac/debug.h
4 * Driver for PowerPC 4xx on-chip ethernet controller, debug print routines.
6 * Copyright (c) 2004, 2005 Zultys Technologies
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
15 #ifndef __IBM_NEWEMAC_DEBUG_H
16 #define __IBM_NEWEMAC_DEBUG_H
18 #include <linux/init.h>
20 #include "core.h"
22 #if defined(CONFIG_IBM_NEW_EMAC_DEBUG)
24 struct emac_instance;
25 struct mal_instance;
27 extern void emac_dbg_register(struct emac_instance *dev);
28 extern void emac_dbg_unregister(struct emac_instance *dev);
29 extern void mal_dbg_register(struct mal_instance *mal);
30 extern void mal_dbg_unregister(struct mal_instance *mal);
31 extern int emac_init_debug(void) __init;
32 extern void emac_fini_debug(void) __exit;
33 extern void emac_dbg_dump_all(void);
35 # define DBG_LEVEL 1
37 #else
39 # define emac_dbg_register(x) do { } while(0)
40 # define emac_dbg_unregister(x) do { } while(0)
41 # define mal_dbg_register(x) do { } while(0)
42 # define mal_dbg_unregister(x) do { } while(0)
43 # define emac_init_debug() do { } while(0)
44 # define emac_fini_debug() do { } while(0)
45 # define emac_dbg_dump_all() do { } while(0)
47 # define DBG_LEVEL 0
49 #endif
51 #define EMAC_DBG(dev, name, fmt, arg...) \
52 printk(KERN_DEBUG #name "%s: " fmt, dev->ofdev->node->full_name, ## arg)
54 #if DBG_LEVEL > 0
55 # define DBG(d,f,x...) EMAC_DBG(d, emac, f, ##x)
56 # define MAL_DBG(d,f,x...) EMAC_DBG(d, mal, f, ##x)
57 # define ZMII_DBG(d,f,x...) EMAC_DBG(d, zmii, f, ##x)
58 # define RGMII_DBG(d,f,x...) EMAC_DBG(d, rgmii, f, ##x)
59 # define NL "\n"
60 #else
61 # define DBG(f,x...) ((void)0)
62 # define MAL_DBG(d,f,x...) ((void)0)
63 # define ZMII_DBG(d,f,x...) ((void)0)
64 # define RGMII_DBG(d,f,x...) ((void)0)
65 #endif
66 #if DBG_LEVEL > 1
67 # define DBG2(d,f,x...) DBG(d,f, ##x)
68 # define MAL_DBG2(d,f,x...) MAL_DBG(d,f, ##x)
69 # define ZMII_DBG2(d,f,x...) ZMII_DBG(d,f, ##x)
70 # define RGMII_DBG2(d,f,x...) RGMII_DBG(d,f, ##x)
71 #else
72 # define DBG2(f,x...) ((void)0)
73 # define MAL_DBG2(d,f,x...) ((void)0)
74 # define ZMII_DBG2(d,f,x...) ((void)0)
75 # define RGMII_DBG2(d,f,x...) ((void)0)
76 #endif
78 #endif /* __IBM_NEWEMAC_DEBUG_H */