David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 1 | /* |
Paul Gortmaker | 3396c78 | 2012-01-27 13:36:01 +0000 | [diff] [blame] | 2 | * drivers/net/ethernet/ibm/emac/debug.h |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 3 | * |
| 4 | * Driver for PowerPC 4xx on-chip ethernet controller, debug print routines. |
| 5 | * |
Benjamin Herrenschmidt | 17cf803 | 2007-12-05 11:14:33 +1100 | [diff] [blame] | 6 | * Copyright 2007 Benjamin Herrenschmidt, IBM Corp. |
| 7 | * <benh@kernel.crashing.org> |
| 8 | * |
| 9 | * Based on the arch/ppc version of the driver: |
| 10 | * |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 11 | * Copyright (c) 2004, 2005 Zultys Technologies |
| 12 | * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify it |
| 15 | * under the terms of the GNU General Public License as published by the |
| 16 | * Free Software Foundation; either version 2 of the License, or (at your |
| 17 | * option) any later version. |
| 18 | * |
| 19 | */ |
| 20 | #ifndef __IBM_NEWEMAC_DEBUG_H |
| 21 | #define __IBM_NEWEMAC_DEBUG_H |
| 22 | |
| 23 | #include <linux/init.h> |
| 24 | |
| 25 | #include "core.h" |
| 26 | |
Tony Breeds | 3b3bceef | 2011-08-18 21:33:49 -0700 | [diff] [blame] | 27 | #if defined(CONFIG_IBM_EMAC_DEBUG) |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 28 | # define DBG_LEVEL 1 |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 29 | #else |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 30 | # define DBG_LEVEL 0 |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 31 | #endif |
| 32 | |
Grant Likely | 61c7a08 | 2010-04-13 16:12:29 -0700 | [diff] [blame] | 33 | #define EMAC_DBG(d, name, fmt, arg...) \ |
| 34 | printk(KERN_DEBUG #name "%s: " fmt, d->ofdev->dev.of_node->full_name, ## arg) |
David Gibson | 1d3bb99 | 2007-08-23 13:56:01 +1000 | [diff] [blame] | 35 | |
| 36 | #if DBG_LEVEL > 0 |
| 37 | # define DBG(d,f,x...) EMAC_DBG(d, emac, f, ##x) |
| 38 | # define MAL_DBG(d,f,x...) EMAC_DBG(d, mal, f, ##x) |
| 39 | # define ZMII_DBG(d,f,x...) EMAC_DBG(d, zmii, f, ##x) |
| 40 | # define RGMII_DBG(d,f,x...) EMAC_DBG(d, rgmii, f, ##x) |
| 41 | # define NL "\n" |
| 42 | #else |
| 43 | # define DBG(f,x...) ((void)0) |
| 44 | # define MAL_DBG(d,f,x...) ((void)0) |
| 45 | # define ZMII_DBG(d,f,x...) ((void)0) |
| 46 | # define RGMII_DBG(d,f,x...) ((void)0) |
| 47 | #endif |
| 48 | #if DBG_LEVEL > 1 |
| 49 | # define DBG2(d,f,x...) DBG(d,f, ##x) |
| 50 | # define MAL_DBG2(d,f,x...) MAL_DBG(d,f, ##x) |
| 51 | # define ZMII_DBG2(d,f,x...) ZMII_DBG(d,f, ##x) |
| 52 | # define RGMII_DBG2(d,f,x...) RGMII_DBG(d,f, ##x) |
| 53 | #else |
| 54 | # define DBG2(f,x...) ((void)0) |
| 55 | # define MAL_DBG2(d,f,x...) ((void)0) |
| 56 | # define ZMII_DBG2(d,f,x...) ((void)0) |
| 57 | # define RGMII_DBG2(d,f,x...) ((void)0) |
| 58 | #endif |
| 59 | |
| 60 | #endif /* __IBM_NEWEMAC_DEBUG_H */ |