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