K2.6 patches and update.
[tomato.git] / release / src-rt / et / sys / et_dbg.h
blob1ffaf06155aecaff9dc8aab8e7673e5c4a9e9b12
1 /*
2 * Minimal debug/trace/assert driver definitions for
3 * Broadcom Home Networking Division 10/100 Mbit/s Ethernet
4 * Device Driver.
6 * Copyright (C) 2010, Broadcom Corporation
7 * All Rights Reserved.
8 *
9 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
10 * the contents of this file may not be disclosed to third parties, copied
11 * or duplicated in any form, in whole or in part, without the prior
12 * written permission of Broadcom Corporation.
13 * $Id: et_dbg.h,v 1.23.404.1 2011-01-18 22:05:21 Exp $
16 #ifndef _et_dbg_
17 #define _et_dbg_
19 #ifdef BCMDBG
20 struct ether_header;
21 extern void etc_prhdr(char *msg, struct ether_header *eh, uint len, int unit);
22 extern void etc_prhex(char *msg, uchar *buf, uint nbytes, int unit);
24 * et_msg_level is a bitvector:
25 * 0 errors
26 * 1 function-level tracing
27 * 2 one-line frame tx/rx summary
28 * 3 complex frame tx/rx in hex
30 #define ET_ERROR(args) if (!(et_msg_level & 1)) ; else printf args
31 //#define ET_TRACE(args) if (!(et_msg_level & 2)) ; else printf args
32 #define ET_TRACE(args) printf args
33 #define ET_PRHDR(msg, eh, len, unit) if (!(et_msg_level & 4)) ; else etc_prhdr(msg, eh, len, unit)
34 #define ET_PRPKT(msg, buf, len, unit) if (!(et_msg_level & 8)) ; else etc_prhex(msg, buf, len, unit)
35 #else /* BCMDBG */
36 #define ET_ERROR(args)
37 #define ET_TRACE(args)
38 #define ET_PRHDR(msg, eh, len, unit)
39 #define ET_PRPKT(msg, buf, len, unit)
40 #endif /* BCMDBG */
42 extern uint32 et_msg_level;
44 #define ET_LOG(fmt, a1, a2)
46 /* include port-specific tunables */
47 #ifdef NDIS
48 #include <et_ndis.h>
49 #elif defined(__ECOS)
50 #include <et_ecos.h>
51 #elif defined(linux)
52 #include <linux/config.h>
53 #include <et_linux.h>
54 #elif defined(PMON)
55 #include <et_pmon.h>
56 #elif defined(_CFE_)
57 #include <et_cfe.h>
58 #else
59 #error
60 #endif
62 #endif /* _et_dbg_ */