debug.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 Bruno Randolf <bruno@thinktube.com>
00003  *
00004  *  This file is free software: you may copy, redistribute and/or modify it
00005  *  under the terms of the GNU General Public License as published by the
00006  *  Free Software Foundation, either version 2 of the License, or (at your
00007  *  option) any later version.
00008  *
00009  *  This file is distributed in the hope that it will be useful, but
00010  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  *
00018  * This file incorporates work covered by the following copyright and
00019  * permission notice:
00020  *
00021  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
00022  * Copyright (c) 2004-2005 Atheros Communications, Inc.
00023  * Copyright (c) 2006 Devicescape Software, Inc.
00024  * Copyright (c) 2007 Jiri Slaby <jirislaby@gmail.com>
00025  * Copyright (c) 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
00026  *
00027  * All rights reserved.
00028  *
00029  * Redistribution and use in source and binary forms, with or without
00030  * modification, are permitted provided that the following conditions
00031  * are met:
00032  * 1. Redistributions of source code must retain the above copyright
00033  *    notice, this list of conditions and the following disclaimer,
00034  *    without modification.
00035  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
00036  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
00037  *    redistribution must be conditioned upon including a substantially
00038  *    similar Disclaimer requirement for further binary redistribution.
00039  * 3. Neither the names of the above-listed copyright holders nor the names
00040  *    of any contributors may be used to endorse or promote products derived
00041  *    from this software without specific prior written permission.
00042  *
00043  * Alternatively, this software may be distributed under the terms of the
00044  * GNU General Public License ("GPL") version 2 as published by the Free
00045  * Software Foundation.
00046  *
00047  * NO WARRANTY
00048  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00049  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00050  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
00051  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
00052  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
00053  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00054  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00055  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00056  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00057  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
00058  * THE POSSIBILITY OF SUCH DAMAGES.
00059  */
00060 
00061 #ifndef _ATH5K_DEBUG_H
00062 #define _ATH5K_DEBUG_H
00063 
00064 #define CONFIG_ATH5K_DEBUG
00065 
00066 struct ath5k_softc;
00067 struct ath5k_hw;
00068 struct sk_buff;
00069 struct ath5k_buf;
00070 
00071 #ifdef CONFIG_ATH5K_DEBUG
00072 
00073 #define ATH5K_TRACE(_sc) do { \
00074         if ((_sc)->debug_level & ATH5K_DEBUG_TRACE) \
00075                 printk("ath5k trace %s:%d\n", __func__, __LINE__); \
00076         } while (0)
00077 
00078 #define ATH5K_DBG(_sc, _m, _fmt, ...) do { \
00079         if ((_sc)->debug_level & (_m)) \
00080                 printk("ath5k dbg:" _fmt, ##__VA_ARGS__); \
00081         } while (0)
00082 
00083 #define ATH5K_DBG_UNLIMIT(_sc, _m, _fmt, ...) ATH5K_DBG(_sc, _m, _fmt, ##__VA_ARGS__)
00084 
00085 void
00086 ath5k_set_debug_level(struct ath5k_softc *sc);
00087 
00088 void
00089 ath5k_debug_init(void);
00090 
00091 void
00092 ath5k_debug_init_device(struct ath5k_softc *sc);
00093 
00094 void
00095 ath5k_debug_finish(void);
00096 
00097 void
00098 ath5k_debug_finish_device(struct ath5k_softc *sc);
00099 
00100 void
00101 ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah);
00102 
00103 void
00104 ath5k_debug_dump_bands(struct ath5k_softc *sc);
00105 
00106 void
00107 ath5k_debug_dump_skb(struct ath5k_softc *sc,
00108                         struct sk_buff *skb, const char *prefix, int tx);
00109 
00110 void
00111 ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf);
00112 
00113 #else /* no debugging */
00114 
00115 #include <linux/compiler.h>
00116 
00117 #define ATH5K_TRACE(_sc) typecheck(struct ath5k_softc *, (_sc))
00118 
00119 static inline void
00120 ath5k_set_debug_level(struct ath5k_softc *sc) {}
00121 
00122 static inline void __attribute__ ((format (printf, 3, 4)))
00123 ATH5K_DBG(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...) {}
00124 
00125 static inline void __attribute__ ((format (printf, 3, 4)))
00126 ATH5K_DBG_UNLIMIT(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...)
00127 {}
00128 
00129 static inline void
00130 ath5k_debug_init(void) {}
00131 
00132 static inline void
00133 ath5k_debug_init_device(struct ath5k_softc *sc) {}
00134 
00135 static inline void
00136 ath5k_debug_finish(void) {}
00137 
00138 static inline void
00139 ath5k_debug_finish_device(struct ath5k_softc *sc) {}
00140 
00141 static inline void
00142 ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {}
00143 
00144 static inline void
00145 ath5k_debug_dump_bands(struct ath5k_softc *sc) {}
00146 
00147 static inline void
00148 ath5k_debug_dump_skb(struct ath5k_softc *sc,
00149                         struct sk_buff *skb, const char *prefix, int tx) {}
00150 
00151 static inline void
00152 ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf) {}
00153 
00154 #endif /* ifdef CONFIG_ATH5K_DEBUG */
00155 
00156 #endif /* ifndef _ATH5K_DEBUG_H */


ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Fri Jan 3 2014 12:07:54