1/*
2 * Minimal debug/trace/assert driver definitions for
3 * Broadcom Home Networking Division 10/100 Mbit/s Ethernet
4 * Device Driver.
5 *
6 * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved.
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
17 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
18 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 * $Id: et_dbg.h 348614 2012-08-02 19:16:22Z $
20 */
21
22#ifndef _et_dbg_
23#define _et_dbg_
24
25#ifdef	BCMDBG
26struct ether_header;
27extern void etc_prhdr(char *msg, struct ether_header *eh, uint len, int unit);
28extern void etc_prhex(char *msg, uchar *buf, uint nbytes, int unit);
29/*
30 * et_msg_level is a bitvector:
31 *	0	errors
32 *	1	function-level tracing
33 *	2	one-line frame tx/rx summary
34 *	3	complex frame tx/rx in hex
35 */
36#define	ET_ERROR(args)	if (!(et_msg_level & 1)) ; else printf args
37#define	ET_TRACE(args)	if (!(et_msg_level & 2)) ; else printf args
38#define	ET_PRHDR(msg, eh, len, unit)	if (!(et_msg_level & 4)) ; else etc_prhdr(msg, eh, len, unit)
39#define	ET_PRPKT(msg, buf, len, unit)	if (!(et_msg_level & 8)) ; else etc_prhex(msg, buf, len, unit)
40#else	/* BCMDBG */
41#define	ET_ERROR(args)
42#define	ET_TRACE(args)
43#define	ET_PRHDR(msg, eh, len, unit)
44#define	ET_PRPKT(msg, buf, len, unit)
45#endif	/* BCMDBG */
46
47extern uint32 et_msg_level;
48
49#define	ET_LOG(fmt, a1, a2)
50
51/* include port-specific tunables */
52#ifdef NDIS
53#include <et_ndis.h>
54#elif defined(__ECOS)
55#include <et_ecos.h>
56#elif defined(linux)
57#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
58#include <linux/config.h>
59#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) */
60#include <et_linux.h>
61#elif defined(PMON)
62#include <et_pmon.h>
63#elif defined(_CFE_)
64#include <et_cfe.h>
65#elif defined(__NetBSD__)
66#include <et_bsd.h>
67#else
68#error
69#endif
70
71#endif /* _et_dbg_ */
72