blob: cf5b5ad3323e2497916773c92eb50e16d2757cd8 [file] [log] [blame]
wdenk7152b1d2003-09-05 23:19:14 +00001/******************************************************************************
2 *
3 * Name: skdebug.h
4 * Project: GEnesis, PCI Gigabit Ethernet Adapter
5 * Version: $Revision: 1.12 $
6 * Date: $Date: 2002/07/15 15:37:13 $
7 * Purpose: SK specific DEBUG support
8 *
9 ******************************************************************************/
10
11/******************************************************************************
12 *
13 * (C)Copyright 1998-2002 SysKonnect GmbH.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * The information in this file is provided "AS IS" without warranty.
21 *
22 ******************************************************************************/
23
24/******************************************************************************
25 *
26 * History:
27 * $Log: skdebug.h,v $
28 * Revision 1.12 2002/07/15 15:37:13 rschmidt
29 * Power Management support
30 * Editorial changes
wdenk42d1f032003-10-15 23:53:47 +000031 *
wdenk7152b1d2003-09-05 23:19:14 +000032 * Revision 1.11 2002/04/25 11:04:39 rschmidt
33 * Editorial changes
wdenk42d1f032003-10-15 23:53:47 +000034 *
wdenk7152b1d2003-09-05 23:19:14 +000035 * Revision 1.10 1999/11/22 13:47:40 cgoos
36 * Changed license header to GPL.
wdenk42d1f032003-10-15 23:53:47 +000037 *
wdenk7152b1d2003-09-05 23:19:14 +000038 * Revision 1.9 1999/09/14 14:02:43 rwahl
39 * Added SK_DBGMOD_PECP.
wdenk42d1f032003-10-15 23:53:47 +000040 *
wdenk7152b1d2003-09-05 23:19:14 +000041 * Revision 1.8 1998/11/25 08:31:54 gklug
42 * fix: no C++ comments allowed in common sources
wdenk42d1f032003-10-15 23:53:47 +000043 *
wdenk7152b1d2003-09-05 23:19:14 +000044 * Revision 1.7 1998/11/24 16:47:24 swolf
45 * Driver may now define its own SK_DBG_MSG() (eg. in "h/skdrv1st.h").
wdenk42d1f032003-10-15 23:53:47 +000046 *
wdenk7152b1d2003-09-05 23:19:14 +000047 * Revision 1.6 1998/10/28 10:23:55 rassmann
48 * ADDED SK_DBGMOD_ADDR.
wdenk42d1f032003-10-15 23:53:47 +000049 *
wdenk7152b1d2003-09-05 23:19:14 +000050 * Revision 1.5 1998/10/22 09:43:55 gklug
51 * add: CSUM module
wdenk42d1f032003-10-15 23:53:47 +000052 *
wdenk7152b1d2003-09-05 23:19:14 +000053 * Revision 1.4 1998/10/01 07:54:44 gklug
54 * add: PNMI debug module
wdenk42d1f032003-10-15 23:53:47 +000055 *
wdenk7152b1d2003-09-05 23:19:14 +000056 * Revision 1.3 1998/09/18 08:32:34 afischer
57 * Macros changed according ssr-spec.:
58 * SK_DBG_MODCHK -> SK_DBG_CHKMOD
59 * SK_DBG_CATCHK -> SK_DBG_CHKCAT
wdenk42d1f032003-10-15 23:53:47 +000060 *
wdenk7152b1d2003-09-05 23:19:14 +000061 * Revision 1.2 1998/07/03 14:38:25 malthoff
62 * Add category SK_DBGCAT_FATAL.
wdenk42d1f032003-10-15 23:53:47 +000063 *
wdenk7152b1d2003-09-05 23:19:14 +000064 * Revision 1.1 1998/06/19 13:39:01 malthoff
65 * created.
wdenk42d1f032003-10-15 23:53:47 +000066 *
wdenk7152b1d2003-09-05 23:19:14 +000067 *
68 ******************************************************************************/
69
70#ifndef __INC_SKDEBUG_H
71#define __INC_SKDEBUG_H
72
73#ifdef DEBUG
74#ifndef SK_DBG_MSG
75#define SK_DBG_MSG(pAC,comp,cat,arg) \
76 if ( ((comp) & SK_DBG_CHKMOD(pAC)) && \
77 ((cat) & SK_DBG_CHKCAT(pAC)) ) { \
78 SK_DBG_PRINTF arg ; \
79 }
80#endif
81#else
82#define SK_DBG_MSG(pAC,comp,lev,arg)
83#endif
84
85/* PLS NOTE:
86 * =========
87 * Due to any restrictions of kernel printf routines do not use other
88 * format identifiers as: %x %d %c %s .
89 * Never use any combined format identifiers such as: %lx %ld in your
90 * printf - argument (arg) because some OS specific kernel printfs may
91 * only support some basic identifiers.
92 */
93
94/* Debug modules */
95
96#define SK_DBGMOD_MERR 0x00000001L /* general module error indication */
97#define SK_DBGMOD_HWM 0x00000002L /* Hardware init module */
98#define SK_DBGMOD_RLMT 0x00000004L /* RLMT module */
99#define SK_DBGMOD_VPD 0x00000008L /* VPD module */
100#define SK_DBGMOD_I2C 0x00000010L /* I2C module */
101#define SK_DBGMOD_PNMI 0x00000020L /* PNMI module */
102#define SK_DBGMOD_CSUM 0x00000040L /* CSUM module */
103#define SK_DBGMOD_ADDR 0x00000080L /* ADDR module */
104#define SK_DBGMOD_PECP 0x00000100L /* PECP module */
105#define SK_DBGMOD_POWM 0x00000200L /* Power Management module */
106
107/* Debug events */
108
109#define SK_DBGCAT_INIT 0x00000001L /* module/driver initialization */
110#define SK_DBGCAT_CTRL 0x00000002L /* controlling devices */
111#define SK_DBGCAT_ERR 0x00000004L /* error handling paths */
112#define SK_DBGCAT_TX 0x00000008L /* transmit path */
113#define SK_DBGCAT_RX 0x00000010L /* receive path */
114#define SK_DBGCAT_IRQ 0x00000020L /* general IRQ handling */
115#define SK_DBGCAT_QUEUE 0x00000040L /* any queue management */
116#define SK_DBGCAT_DUMP 0x00000080L /* large data output e.g. hex dump */
117#define SK_DBGCAT_FATAL 0x00000100L /* fatal error */
118
119#endif /* __INC_SKDEBUG_H */