/*-1* Copyright (c) 2009-2010 Weongyo Jeong <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer,9* without modification.10* 2. Redistributions in binary form must reproduce at minimum a disclaimer11* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any12* redistribution must be conditioned upon including a substantially13* similar Disclaimer requirement for further binary redistribution.14*15* NO WARRANTY16* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS17* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT18* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY19* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL20* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,21* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF22* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS23* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER24* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)25* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF26* THE POSSIBILITY OF SUCH DAMAGES.27*/2829#ifndef __IF_BWN_DEBUG_H__30#define __IF_BWN_DEBUG_H__3132enum {33BWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */34BWN_DEBUG_RECV = 0x00000002, /* basic recv operation */35BWN_DEBUG_STATE = 0x00000004, /* 802.11 state transitions */36BWN_DEBUG_TXPOW = 0x00000008, /* tx power processing */37BWN_DEBUG_RESET = 0x00000010, /* reset processing */38BWN_DEBUG_OPS = 0x00000020, /* bwn_ops processing */39BWN_DEBUG_BEACON = 0x00000040, /* beacon handling */40BWN_DEBUG_WATCHDOG = 0x00000080, /* watchdog timeout */41BWN_DEBUG_INTR = 0x00000100, /* ISR */42BWN_DEBUG_CALIBRATE = 0x00000200, /* periodic calibration */43BWN_DEBUG_NODE = 0x00000400, /* node management */44BWN_DEBUG_LED = 0x00000800, /* led management */45BWN_DEBUG_CMD = 0x00001000, /* cmd submission */46BWN_DEBUG_LO = 0x00002000, /* LO */47BWN_DEBUG_FW = 0x00004000, /* firmware */48BWN_DEBUG_WME = 0x00008000, /* WME */49BWN_DEBUG_RF = 0x00010000, /* RF */50BWN_DEBUG_XMIT_POWER = 0x00020000,51BWN_DEBUG_PHY = 0x00040000,52BWN_DEBUG_EEPROM = 0x00080000,53BWN_DEBUG_HWCRYPTO = 0x00100000, /* HW crypto */54BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */55BWN_DEBUG_ANY = 0xffffffff56};5758#ifdef BWN_DEBUG59#define DPRINTF(sc, m, fmt, ...) do { \60if (sc->sc_debug & (m)) \61printf(fmt, __VA_ARGS__); \62} while (0)63#else /* BWN_DEBUG */64#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)65#endif /* BWN_DEBUG */6667#define BWN_ERRPRINTF(sc, ...) do { \68printf(__VA_ARGS__); \69} while (0)70#define BWN_DBGPRINTF(sc, ...) do { \71printf(__VA_ARGS__); \72} while (0)73#define BWN_WARNPRINTF(sc, ...) do { \74printf(__VA_ARGS__); \75} while (0)7677#endif /* __IF_BWN_DEBUG_H__ */787980