do not use kzalloc() in madwifi, for compatibility reasons
[openwrt.git] / package / madwifi / patches / 200-no_debug.patch
1 Index: madwifi-dfs-r3246/ath/if_ath.c
2 ===================================================================
3 --- madwifi-dfs-r3246.orig/ath/if_ath.c 2008-01-25 18:17:16.252409313 +0100
4 +++ madwifi-dfs-r3246/ath/if_ath.c 2008-01-25 18:24:41.981809984 +0100
5 @@ -42,7 +42,6 @@
6 * This software is derived from work of Atsushi Onoe; his contribution
7 * is greatly appreciated.
8 */
9 -#define AR_DEBUG
10 #include "if_ath_debug.h"
11 #include "opt_ah.h"
12
13 @@ -522,9 +521,11 @@
14 u_int8_t csz;
15
16 sc->devid = devid;
17 +#ifdef AR_DEBUG
18 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
19 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);
20 DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
21 +#endif
22
23 /* Allocate space for dynamically determined maximum VAP count */
24 sc->sc_bslot =
25 @@ -1301,12 +1302,14 @@
26 /* If no default VAP debug flags are passed, allow a few to
27 * transfer down from the driver to new VAPs so we can have load
28 * time debugging for VAPs too. */
29 +#ifdef AR_DEBUG
30 vap->iv_debug = 0 |
31 ((sc->sc_debug & ATH_DEBUG_RATE) ? IEEE80211_MSG_XRATE : 0) |
32 ((sc->sc_debug & ATH_DEBUG_XMIT) ? IEEE80211_MSG_OUTPUT : 0) |
33 ((sc->sc_debug & ATH_DEBUG_RECV) ? IEEE80211_MSG_INPUT : 0) |
34 0
35 ;
36 +#endif
37 }
38 ic->ic_debug = (sc->sc_default_ieee80211_debug & IEEE80211_MSG_IC);
39
40 @@ -10524,9 +10527,11 @@
41 /* XXX validate? */
42 sc->sc_ledpin = val;
43 break;
44 +#ifdef AR_DEBUG
45 case ATH_DEBUG:
46 sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL);
47 ath_debug_global = (val & ATH_DEBUG_GLOBAL);
48 +#endif
49 break;
50 case ATH_TXANTENNA:
51 /*
52 @@ -10946,9 +10951,11 @@
53 }
54
55 /* initialize values */
56 +#ifdef AR_DEBUG
57 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
58 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);
59 sc->sc_default_ieee80211_debug = ieee80211_debug;
60 +#endif
61 sc->sc_txantenna = 0; /* default to auto-selection */
62 sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD;
63 }
64 Index: madwifi-dfs-r3246/ath_rate/amrr/amrr.c
65 ===================================================================
66 --- madwifi-dfs-r3246.orig/ath_rate/amrr/amrr.c 2008-01-25 18:17:16.260409771 +0100
67 +++ madwifi-dfs-r3246/ath_rate/amrr/amrr.c 2008-01-25 18:17:18.304526256 +0100
68 @@ -70,7 +70,9 @@
69
70 #include "amrr.h"
71
72 +#ifdef AR_DEBUG
73 #define AMRR_DEBUG
74 +#endif
75 #ifdef AMRR_DEBUG
76 #define DPRINTF(sc, _fmt, ...) do { \
77 if (sc->sc_debug & 0x10) \
78 Index: madwifi-dfs-r3246/ath_rate/minstrel/minstrel.c
79 ===================================================================
80 --- madwifi-dfs-r3246.orig/ath_rate/minstrel/minstrel.c 2008-01-25 18:17:16.268410227 +0100
81 +++ madwifi-dfs-r3246/ath_rate/minstrel/minstrel.c 2008-01-25 18:17:18.316526944 +0100
82 @@ -117,7 +117,9 @@
83
84 #include "minstrel.h"
85
86 +#ifdef AR_DEBUG
87 #define MINSTREL_DEBUG
88 +#endif
89 #ifdef MINSTREL_DEBUG
90 enum {
91 ATH_DEBUG_RATE = 0x00000010 /* rate control */
92 Index: madwifi-dfs-r3246/ath_rate/onoe/onoe.c
93 ===================================================================
94 --- madwifi-dfs-r3246.orig/ath_rate/onoe/onoe.c 2008-01-25 18:17:16.276410682 +0100
95 +++ madwifi-dfs-r3246/ath_rate/onoe/onoe.c 2008-01-25 18:17:18.320527171 +0100
96 @@ -66,7 +66,9 @@
97
98 #include "onoe.h"
99
100 +#ifdef AR_DEBUG
101 #define ONOE_DEBUG
102 +#endif
103 #ifdef ONOE_DEBUG
104 enum {
105 ATH_DEBUG_RATE = 0x00000010, /* rate control */
106 Index: madwifi-dfs-r3246/ath_rate/sample/sample.c
107 ===================================================================
108 --- madwifi-dfs-r3246.orig/ath_rate/sample/sample.c 2008-01-25 18:17:16.284411140 +0100
109 +++ madwifi-dfs-r3246/ath_rate/sample/sample.c 2008-01-25 18:17:18.324527396 +0100
110 @@ -68,7 +68,9 @@
111
112 #include "sample.h"
113
114 -#define SAMPLE_DEBUG
115 +#ifdef AR_DEBUG
116 +#define SAMPLE_DEBUG
117 +#endif
118 #ifdef SAMPLE_DEBUG
119 enum {
120 ATH_DEBUG_RATE = 0x00000010, /* rate control */
121 Index: madwifi-dfs-r3246/tools/do_multi.c
122 ===================================================================
123 --- madwifi-dfs-r3246.orig/tools/do_multi.c 2008-01-25 18:17:16.292411592 +0100
124 +++ madwifi-dfs-r3246/tools/do_multi.c 2008-01-25 18:24:59.262794773 +0100
125 @@ -9,16 +9,20 @@
126
127 progname = basename(argv[0]);
128
129 +#ifdef AR_DEBUG
130 if(strcmp(progname, "80211debug") == 0)
131 ret = a80211debug_init(argc, argv);
132 +#endif
133 if(strcmp(progname, "80211stats") == 0)
134 ret = a80211stats_init(argc, argv);
135 if(strcmp(progname, "athchans") == 0)
136 ret = athchans_init(argc, argv);
137 if(strcmp(progname, "athctrl") == 0)
138 ret = athctrl_init(argc, argv);
139 +#ifdef AR_DEBUG
140 if(strcmp(progname, "athdebug") == 0)
141 ret = athdebug_init(argc, argv);
142 +#endif
143 if(strcmp(progname, "athkey") == 0)
144 ret = athkey_init(argc, argv);
145 if(strcmp(progname, "athstats") == 0)
146 Index: madwifi-dfs-r3246/tools/Makefile
147 ===================================================================
148 --- madwifi-dfs-r3246.orig/tools/Makefile 2008-01-25 18:17:16.300412050 +0100
149 +++ madwifi-dfs-r3246/tools/Makefile 2008-01-25 18:17:29.737177767 +0100
150 @@ -46,9 +46,10 @@
151 HAL= $(TOP)/hal
152 endif
153
154 +DEBUG=-DAR_DEBUG
155
156 ALLPROGS= athstats 80211stats athkey athchans athctrl \
157 - athdebug 80211debug wlanconfig ath_info
158 + $(if $(DEBUG),80211debug athdebug) wlanconfig ath_info
159
160 OBJS= $(patsubst %,%.o,$(ALLPROGS) do_multi)
161 ALL= ${OBJS} madwifi_multi
162 @@ -57,7 +58,7 @@
163
164 INCS= -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL)
165 CFLAGS= -g -O2 -Wall
166 -ALL_CFLAGS= $(CFLAGS) $(INCS)
167 +ALL_CFLAGS= $(CFLAGS) $(INCS) $(DEBUG)
168 LDFLAGS=
169
170 all: $(ALL)
171 @@ -84,7 +85,7 @@
172 ${CC} -c -o do_multi.o -DDOMULTI=1 ${ALL_CFLAGS} do_multi.c
173 madwifi_multi: $(OBJS)
174 ${CC} -o madwifi_multi ${LDFLAGS} ${OBJS}
175 - for i in athstats 80211stats athkey athchans athctrl athdebug wlanconfig 80211debug; do \
176 + for i in $(ALLPROGS); do \
177 ln -s -f madwifi_multi $$i; \
178 done
179
180 Index: madwifi-dfs-r3246/net80211/ieee80211_linux.h
181 ===================================================================
182 --- madwifi-dfs-r3246.orig/net80211/ieee80211_linux.h 2008-01-25 18:17:16.308412507 +0100
183 +++ madwifi-dfs-r3246/net80211/ieee80211_linux.h 2008-01-25 18:17:18.324527396 +0100
184 @@ -29,8 +29,6 @@
185 #ifndef _NET80211_IEEE80211_LINUX_H_
186 #define _NET80211_IEEE80211_LINUX_H_
187
188 -#define IEEE80211_DEBUG
189 -#define IEEE80211_DEBUG_REFCNT /* Node reference count debugging */
190 /* #define ATH_DEBUG_SPINLOCKS */ /* announce before spinlocking */
191
192 #include <linux/wireless.h>
193 Index: madwifi-dfs-r3246/Makefile.inc
194 ===================================================================
195 --- madwifi-dfs-r3246.orig/Makefile.inc 2008-01-25 18:17:16.316412961 +0100
196 +++ madwifi-dfs-r3246/Makefile.inc 2008-01-25 18:17:18.328527625 +0100
197 @@ -148,7 +148,8 @@
198 TOOLS= $(TOP)/tools
199
200 WARNINGS = -Werror
201 -COPTS+= $(WARNINGS)
202 +DEBUG = -DAR_DEBUG -DIEEE80211_DEBUG
203 +COPTS+= $(WARNINGS) $(DEBUG)
204 INCS= -include $(TOP)/include/compat.h -I$(TOP)/include
205
206 # TARGET defines the target platform architecture. It must match one of
This page took 0.047673 seconds and 5 git commands to generate.