ibm_emac_debug.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * drivers/net/ibm_emac/ibm_emac_debug.h
  3. *
  4. * Driver for PowerPC 4xx on-chip ethernet controller, debug print routines.
  5. *
  6. * Copyright (c) 2004, 2005 Zultys Technologies
  7. * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
  8. *
  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.
  13. *
  14. */
  15. #ifndef __IBM_EMAC_DEBUG_H_
  16. #define __IBM_EMAC_DEBUG_H_
  17. #include <linux/init.h>
  18. #include "ibm_emac_core.h"
  19. #include "ibm_emac_mal.h"
  20. #if defined(CONFIG_IBM_EMAC_DEBUG)
  21. void emac_dbg_register(int idx, struct ocp_enet_private *dev);
  22. void mal_dbg_register(int idx, struct ibm_ocp_mal *mal);
  23. int emac_init_debug(void) __init;
  24. void emac_fini_debug(void) __exit;
  25. void emac_dbg_dump_all(void);
  26. # define DBG_LEVEL 1
  27. #else
  28. # define emac_dbg_register(x,y) ((void)0)
  29. # define mal_dbg_register(x,y) ((void)0)
  30. # define emac_init_debug() ((void)0)
  31. # define emac_fini_debug() ((void)0)
  32. # define emac_dbg_dump_all() ((void)0)
  33. # define DBG_LEVEL 0
  34. #endif
  35. #if DBG_LEVEL > 0
  36. # define DBG(f,x...) printk("emac" f, ##x)
  37. # define MAL_DBG(f,x...) printk("mal" f, ##x)
  38. # define ZMII_DBG(f,x...) printk("zmii" f, ##x)
  39. # define RGMII_DBG(f,x...) printk("rgmii" f, ##x)
  40. # define NL "\n"
  41. #else
  42. # define DBG(f,x...) ((void)0)
  43. # define MAL_DBG(f,x...) ((void)0)
  44. # define ZMII_DBG(f,x...) ((void)0)
  45. # define RGMII_DBG(f,x...) ((void)0)
  46. #endif
  47. #if DBG_LEVEL > 1
  48. # define DBG2(f,x...) DBG(f, ##x)
  49. # define MAL_DBG2(f,x...) MAL_DBG(f, ##x)
  50. # define ZMII_DBG2(f,x...) ZMII_DBG(f, ##x)
  51. # define RGMII_DBG2(f,x...) RGMII_DBG(f, ##x)
  52. #else
  53. # define DBG2(f,x...) ((void)0)
  54. # define MAL_DBG2(f,x...) ((void)0)
  55. # define ZMII_DBG2(f,x...) ((void)0)
  56. # define RGMII_DBG2(f,x...) ((void)0)
  57. #endif
  58. #endif /* __IBM_EMAC_DEBUG_H_ */