3 @@ -382,6 +382,7 @@ static u_int32_t ath_set_clamped_maxtxpo
4 static void ath_poll_disable(struct net_device *dev);
5 static void ath_poll_enable(struct net_device *dev);
6 static void ath_fetch_idle_time(struct ath_softc *sc);
7 +static void ath_set_timing(struct ath_softc *sc);
9 /* calibrate every 30 secs in steady state but check every second at first. */
10 static int ath_calinterval = ATH_SHORT_CALINTERVAL;
11 @@ -1185,6 +1186,7 @@ ath_attach(u_int16_t devid, struct net_d
13 sc->sc_noise_immunity = -1;
14 sc->sc_ofdm_weak_det = -1;
15 + sc->sc_coverage = 7; /* 2100 meters */
19 @@ -2672,6 +2674,7 @@ ath_init(struct net_device *dev)
21 ath_chan_change(sc, ic->ic_curchan);
22 ath_set_ack_bitrate(sc, sc->sc_ackrate);
24 dev->flags |= IFF_RUNNING; /* we are ready to go */
25 ieee80211_start_running(ic); /* start all VAPs */
27 @@ -4483,17 +4486,52 @@ ath_mode_init(struct net_device *dev)
28 * Set the slot time based on the current setting.
31 -ath_settiming(struct ath_softc *sc)
32 +ath_set_timing(struct ath_softc *sc)
34 + struct ieee80211com *ic = &sc->sc_ic;
35 struct ath_hal *ah = sc->sc_ah;
36 - u_int offset = getTimingOffset(sc);
37 + struct ath_timings *t = &sc->sc_timings;
41 + if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
43 + if (ic->ic_flags & IEEE80211_F_SHSLOT)
45 + } else if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) {
49 + if (IEEE80211_IS_CHAN_TURBO(ic->ic_curchan)) {
52 + } else if (IEEE80211_IS_CHAN_HALF(ic->ic_curchan)) {
55 + } else if (IEEE80211_IS_CHAN_QUARTER(ic->ic_curchan)) {
60 + t->slot = offset + sc->sc_coverage;
61 + t->ack = t->slot * 2 + 3;
62 + t->cts = t->slot * 2 + 3;
64 if (sc->sc_slottimeconf > 0)
65 - ath_hal_setslottime(ah, offset + sc->sc_slottimeconf);
66 + t->slot = sc->sc_slottimeconf;
67 if (sc->sc_acktimeconf > 0)
68 - ath_hal_setacktimeout(ah, 2 * offset + sc->sc_acktimeconf);
69 + t->ack = sc->sc_acktimeconf;
70 if (sc->sc_ctstimeconf > 0)
71 - ath_hal_setctstimeout(ah, 2 * offset + sc->sc_ctstimeconf);
72 + t->cts = sc->sc_ctstimeconf;
74 + t->difs = 2 * t->sifs + t->slot;
75 + t->eifs = t->sifs + t->difs + 3;
77 + ath_hal_setslottime(ah, t->slot);
78 + ath_hal_setacktimeout(ah, t->ack);
79 + ath_hal_setctstimeout(ah, t->cts);
80 + ath_hal_seteifstime(ah, t->eifs);
82 sc->sc_updateslot = OK;
85 @@ -4515,7 +4553,7 @@ ath_updateslot(struct net_device *dev)
86 if (ic->ic_opmode == IEEE80211_M_HOSTAP)
87 sc->sc_updateslot = UPDATE;
88 else if (dev->flags & IFF_RUNNING)
93 #ifdef ATH_SUPERG_DYNTURBO
94 @@ -5359,7 +5397,7 @@ ath_beacon_send(struct ath_softc *sc, in
95 sc->sc_updateslot = COMMIT; /* commit next beacon */
96 sc->sc_slotupdate = slot;
97 } else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot))
98 - ath_settiming(sc); /* commit change to hardware */
99 + ath_set_timing(sc); /* commit change to hardware */
103 @@ -9429,7 +9467,8 @@ ath_set_coverageclass(struct ieee80211co
105 struct ath_softc *sc = ic->ic_dev->priv;
107 - ath_hal_setcoverageclass(sc->sc_ah, ic->ic_coverageclass, 0);
108 + sc->sc_coverage = ic->ic_coverageclass * 3;
109 + ath_set_timing(sc);
113 @@ -10950,6 +10989,7 @@ enum {
114 ATH_OFDM_WEAK_DET = 29,
121 @@ -11162,21 +11202,31 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
122 sc->sc_slottimeconf = val;
124 sc->sc_slottimeconf = 0;
126 + ath_set_timing(sc);
130 sc->sc_acktimeconf = val;
132 sc->sc_acktimeconf = 0;
134 + ath_set_timing(sc);
138 sc->sc_ctstimeconf = val;
140 sc->sc_ctstimeconf = 0;
142 + ath_set_timing(sc);
146 + sc->sc_coverage = ((val - 1) / 300) + 1;
147 + ic->ic_coverageclass = ((sc->sc_coverage - 1) / 3) + 1;
149 + sc->sc_coverage = 0;
150 + ic->ic_coverageclass = 0;
152 + ath_set_timing(sc);
155 if (val != sc->sc_softled) {
156 @@ -11332,6 +11382,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
158 val = sc->sc_chanbw ?: 20;
161 + val = sc->sc_coverage * 300;
164 val = ath_hal_getslottime(ah);
166 @@ -11453,6 +11506,12 @@ static const ctl_table ath_sysctl_templa
167 .extra2 = (void *)ATH_CTSTIMEOUT,
169 { .ctl_name = CTL_AUTO,
170 + .procname = "distance",
172 + .proc_handler = ath_sysctl_halparam,
173 + .extra2 = (void *)ATH_DISTANCE,
175 + { .ctl_name = CTL_AUTO,
176 .procname = "softled",
178 .proc_handler = ath_sysctl_halparam,
179 --- a/ath/if_ath_hal.h
180 +++ b/ath/if_ath_hal.h
181 @@ -284,6 +284,17 @@ static inline u_int ath_hal_getslottime(
185 +static inline u_int ath_hal_geteifstime(struct ath_hal *ah)
188 + ATH_HAL_LOCK_IRQ(ah->ah_sc);
189 + ath_hal_set_function(__func__);
190 + ret = ah->ah_getEifsTime(ah);
191 + ath_hal_set_function(NULL);
192 + ATH_HAL_UNLOCK_IRQ(ah->ah_sc);
196 static inline void ath_hal_beaconinit(struct ath_hal *ah, u_int32_t nexttbtt,
199 @@ -841,6 +852,17 @@ static inline HAL_BOOL ath_hal_setslotti
203 +static inline HAL_BOOL ath_hal_seteifstime(struct ath_hal *ah, u_int a1)
206 + ATH_HAL_LOCK_IRQ(ah->ah_sc);
207 + ath_hal_set_function(__func__);
208 + ret = ah->ah_setEifsTime(ah, a1);
209 + ath_hal_set_function(NULL);
210 + ATH_HAL_UNLOCK_IRQ(ah->ah_sc);
214 static inline void ath_hal_setledstate(struct ath_hal *ah, HAL_LED_STATE a1)
216 ATH_HAL_LOCK_IRQ(ah->ah_sc);
217 --- a/ath/if_athvar.h
218 +++ b/ath/if_athvar.h
219 @@ -613,6 +613,15 @@ struct ath_rp {
223 +struct ath_timings {
233 struct ieee80211com sc_ic; /* NB: must be first */
234 struct net_device *sc_dev;
235 @@ -838,6 +847,8 @@ struct ath_softc {
237 u_int32_t sc_nexttbtt;
238 u_int64_t sc_last_tsf;
240 + struct ath_timings sc_timings;
243 typedef void (*ath_callback) (struct ath_softc *);
244 @@ -945,49 +956,76 @@ int ar_device(int devid);
245 DEV_NAME(_v->iv_ic->ic_dev))
247 void ath_radar_detected(struct ath_softc *sc, const char* message);
248 -static inline u_int getTimingOffset(struct ath_softc *sc)
250 - struct ieee80211com *ic = &sc->sc_ic;
252 - if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
254 - if (ic->ic_flags & IEEE80211_F_SHSLOT)
256 - } else if (IEEE80211_IS_CHAN_A(ic->ic_curchan))
259 - if (IEEE80211_IS_CHAN_TURBO(ic->ic_curchan))
262 - if (IEEE80211_IS_CHAN_HALF(ic->ic_curchan))
264 - else if (IEEE80211_IS_CHAN_QUARTER(ic->ic_curchan))
269 -static inline void ath_get_timings(struct ath_softc *sc, u_int *t_slot, u_int *t_sifs, u_int *t_difs)
271 - struct ieee80211_channel *c = sc->sc_ic.ic_curchan;
273 +#define MIN(a,b) ((a) < (b) ? (a) : (b))
276 +#define MAX(a,b) ((a) > (b) ? (a) : (b))
279 - *t_slot = getTimingOffset(sc) + sc->sc_slottimeconf;
281 - if (IEEE80211_IS_CHAN_HALF(c)) {
284 - } else if (IEEE80211_IS_CHAN_QUARTER(c)) {
287 - } else if (IEEE80211_IS_CHAN_TURBO(c)) {
294 +/* Calculate the transmit duration of a frame. */
295 +static inline unsigned
296 +calc_usecs_unicast_packet(struct ath_softc *sc, int length,
297 + int rix, int short_retries, int long_retries)
299 + const HAL_RATE_TABLE *rt = sc->sc_currates;
300 + struct ieee80211com *ic = &sc->sc_ic;
301 + struct ath_timings *t = &sc->sc_timings;
302 + unsigned int x = 0, tt = 0;
303 + unsigned int cix = rt->info[rix].controlRate;
304 + int rts = 0, cts = 0;
305 + int cw = ATH_DEFAULT_CWMIN;
307 + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
309 + if (!rt->info[rix].rateKbps) {
310 + printk(KERN_WARNING "rix %d (%d) bad ratekbps %d mode %u\n",
311 + rix, rt->info[rix].dot11Rate,
312 + rt->info[rix].rateKbps,
317 + if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
318 + (rt->info[rix].phy == IEEE80211_T_OFDM)) {
320 + if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
322 + else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY)
325 + cix = rt->info[sc->sc_protrix].controlRate;
328 + if ((rts || cts) && rt->info[cix].rateKbps) {
329 + int ctsrate = rt->info[cix].rateCode;
330 + int ctsduration = 0;
332 + ctsrate |= rt->info[cix].shortPreamble;
333 + if (rts) /* SIFS + CTS */
334 + ctsduration += rt->info[cix].spAckDuration;
336 + ctsduration += ath_hal_computetxtime(sc->sc_ah,
337 + rt, length, rix, AH_TRUE);
339 + if (cts) /* SIFS + ACK */
340 + ctsduration += rt->info[cix].spAckDuration;
342 + tt += (short_retries + 1) * ctsduration;
345 + tt += (long_retries + 1) * (t->sifs + rt->info[rix].spAckDuration);
346 + tt += (long_retries + 1) * ath_hal_computetxtime(sc->sc_ah, rt, length,
348 + for (x = 0; x <= short_retries + long_retries; x++) {
349 + cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2);
350 + tt += (t->slot * cw / 2);
356 struct ath_hw_detect {
357 const char *vendor_name;
358 const char *card_name;
359 --- a/ath_rate/minstrel/minstrel.c
360 +++ b/ath_rate/minstrel/minstrel.c
361 @@ -170,85 +170,6 @@ rate_to_ndx(struct minstrel_node *sn, in
365 -/* Calculate the transmit duration of a frame. */
367 -calc_usecs_unicast_packet(struct ath_softc *sc, int length,
368 - int rix, int short_retries, int long_retries)
370 - const HAL_RATE_TABLE *rt = sc->sc_currates;
371 - struct ieee80211com *ic = &sc->sc_ic;
372 - unsigned t_slot = 20;
373 - unsigned t_difs = 50;
374 - unsigned t_sifs = 10;
375 - unsigned int x = 0, tt = 0;
376 - unsigned int cix = rt->info[rix].controlRate;
377 - int rts = 0, cts = 0;
378 - int cw = ATH_DEFAULT_CWMIN;
380 - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
382 - if (!rt->info[rix].rateKbps) {
383 - printk(KERN_WARNING "rix %d (%d) bad ratekbps %d mode %u\n",
384 - rix, rt->info[rix].dot11Rate,
385 - rt->info[rix].rateKbps,
390 - ath_get_timings(sc, &t_slot, &t_sifs, &t_difs);
391 - if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
392 - (rt->info[rix].phy == IEEE80211_T_OFDM)) {
393 - if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
395 - else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY)
398 - cix = rt->info[sc->sc_protrix].controlRate;
402 - if (length > ic->ic_rtsthreshold)
407 - int ctsrate = rt->info[cix].rateCode;
408 - int ctsduration = 0;
410 - if (!rt->info[cix].rateKbps) {
412 - printk(KERN_WARNING "cix %d (%d) bad ratekbps %d mode %u\n",
413 - cix, rt->info[cix].dot11Rate,
414 - rt->info[cix].rateKbps,
421 - ctsrate |= rt->info[cix].shortPreamble;
422 - if (rts) /* SIFS + CTS */
423 - ctsduration += rt->info[cix].spAckDuration;
425 - ctsduration += ath_hal_computetxtime(sc->sc_ah,
426 - rt, length, rix, AH_TRUE);
428 - if (cts) /* SIFS + ACK */
429 - ctsduration += rt->info[cix].spAckDuration;
431 - tt += (short_retries + 1) * ctsduration;
434 - tt += (long_retries + 1) * (t_sifs + rt->info[rix].spAckDuration);
435 - tt += (long_retries + 1) * ath_hal_computetxtime(sc->sc_ah, rt, length,
437 - for (x = 0; x <= short_retries + long_retries; x++) {
438 - cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2);
439 - tt += (t_slot * cw / 2);
445 ath_rate_node_init(struct ath_softc *sc, struct ath_node *an)
447 --- a/ath_rate/sample/sample.c
448 +++ b/ath_rate/sample/sample.c
449 @@ -137,92 +137,6 @@ rate_to_ndx(struct sample_node *sn, int
454 - * Calculate the transmit duration of a frame.
457 -calc_usecs_unicast_packet(struct ath_softc *sc, int length,
458 - int rix, int short_retries, int long_retries)
460 - const HAL_RATE_TABLE *rt = sc->sc_currates;
466 - struct ieee80211com *ic = &sc->sc_ic;
467 - unsigned int tt = 0;
469 - unsigned int cw = ATH_DEFAULT_CWMIN;
470 - unsigned int cix = rt->info[rix].controlRate;
471 - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
473 - if (!rt->info[rix].rateKbps) {
474 - printk(KERN_WARNING "rix %u (%u) bad ratekbps %u mode %u\n",
475 - rix, rt->info[rix].dot11Rate,
476 - rt->info[rix].rateKbps,
482 - cix = rt->info[rix].controlRate;
484 - * XXX getting mac/phy level timings should be fixed for turbo
485 - * rates, and there is probably a way to get this from the
488 - ath_get_timings(sc, &t_slot, &t_sifs, &t_difs);
491 - if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
492 - rt->info[rix].phy == IEEE80211_T_OFDM) {
493 - if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
495 - else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY)
498 - cix = rt->info[sc->sc_protrix].controlRate;
501 - if (0 /*length > ic->ic_rtsthreshold */)
506 - int ctsduration = 0;
508 - if (!rt->info[cix].rateKbps) {
509 - printk(KERN_WARNING "cix %u (%u) bad ratekbps %u mode %u\n",
510 - cix, rt->info[cix].dot11Rate,
511 - rt->info[cix].rateKbps,
517 - ctsrate = rt->info[cix].rateCode | rt->info[cix].shortPreamble;
518 - if (rts) /* SIFS + CTS */
519 - ctsduration += rt->info[cix].spAckDuration;
521 - ctsduration += ath_hal_computetxtime(sc->sc_ah,
522 - rt, length, rix, AH_TRUE);
524 - if (cts) /* SIFS + ACK */
525 - ctsduration += rt->info[cix].spAckDuration;
527 - tt += (short_retries + 1) * ctsduration;
530 - tt += (long_retries+1)*(t_sifs + rt->info[rix].spAckDuration);
531 - tt += (long_retries+1)*ath_hal_computetxtime(sc->sc_ah, rt, length,
533 - for (x = 0; x <= short_retries + long_retries; x++) {
534 - cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2);
535 - tt += (t_slot * cw / 2);
541 ath_rate_node_init(struct ath_softc *sc, struct ath_node *an)
542 --- a/net80211/ieee80211_wireless.c
543 +++ b/net80211/ieee80211_wireless.c
544 @@ -2736,6 +2736,7 @@ ieee80211_ioctl_setparam(struct net_devi
545 case IEEE80211_PARAM_COVERAGE_CLASS:
546 if (value <= IEEE80211_COVERAGE_CLASS_MAX) {
547 ic->ic_coverageclass = value;
548 + ic->ic_set_coverageclass(ic);
550 ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
552 --- a/net80211/ieee80211_var.h
553 +++ b/net80211/ieee80211_var.h
556 #define IEEE80211_BGSCAN_TRIGGER_INTVL 20 /* min trigger interval for thresh based bgscan (secs) */
558 -#define IEEE80211_COVERAGE_CLASS_MAX 31 /* max coverage class */
559 +#define IEEE80211_COVERAGE_CLASS_MAX 255 /* max coverage class */
560 #define IEEE80211_REGCLASSIDS_MAX 10 /* max regclass id list */
562 #define IEEE80211_PS_SLEEP 0x1 /* STA is in power saving mode */
565 @@ -50,7 +50,7 @@ all: compile
569 -ALLPROGS= athstats 80211stats athkey athchans athctrl \
570 +ALLPROGS= athstats 80211stats athkey athchans \
571 athdebug 80211debug wlanconfig ath_info
573 OBJS= $(patsubst %,%.o,$(ALLPROGS))
574 --- a/tools/athctrl.c
578 - * Copyright (c) 2002-2004 Gunter Burchardt, Local-Web AG
579 - * All rights reserved.
581 - * Redistribution and use in source and binary forms, with or without
582 - * modification, are permitted provided that the following conditions
584 - * 1. Redistributions of source code must retain the above copyright
585 - * notice, this list of conditions and the following disclaimer,
586 - * without modification.
587 - * 2. Redistributions in binary form must reproduce at minimum a disclaimer
588 - * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
589 - * redistribution must be conditioned upon including a substantially
590 - * similar Disclaimer requirement for further binary redistribution.
591 - * 3. Neither the names of the above-listed copyright holders nor the names
592 - * of any contributors may be used to endorse or promote products derived
593 - * from this software without specific prior written permission.
595 - * Alternatively, this software may be distributed under the terms of the
596 - * GNU General Public License ("GPL") version 2 as published by the Free
597 - * Software Foundation.
600 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
601 - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
602 - * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
603 - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
604 - * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
605 - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
606 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
607 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
608 - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
609 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
610 - * THE POSSIBILITY OF SUCH DAMAGES.
612 - * $Id: athctrl.c 2394 2007-05-30 01:41:18Z mtaylor $
616 - * Simple Atheros-specific tool to inspect and set atheros specific values
617 - * athctrl [-i interface] [-d distance]
618 - * (default interface is wifi0).
620 -#include <sys/types.h>
621 -#include <sys/file.h>
631 -#include "do_multi.h"
634 -setsysctrl(const char *dev, const char *control , u_long value)
639 - snprintf(buffer, sizeof(buffer), "/proc/sys/dev/%s/%s", dev, control);
640 - fd = fopen(buffer, "w");
642 - fprintf(fd, "%li", value);
645 - fprintf(stderr, "Could not open %s for writing!\n", buffer);
650 -static void usage(void)
653 - "Atheros driver control\n"
654 - "Copyright (c) 2002-2004 Gunter Burchardt, Local-Web AG\n"
656 - "usage: athctrl [-i interface] [-d distance]\n"
659 - " -h show this usage\n"
660 - " -i interface (default interface is wifi0)\n"
661 - " -d specify the maximum distance of a sta or the distance\n"
662 - " of the master\n");
668 -CMD(athctrl)(int argc, char *argv[])
670 - char device[IFNAMSIZ + 1];
674 - strncpy(device, "wifi0", sizeof (device));
677 - c = getopt(argc, argv, "d:i:h");
685 - distance = atoi(optarg);
688 - strncpy(device, optarg, sizeof (device));
696 - if (distance >= 0) {
697 - int slottime = (distance / 300) + ((distance % 300) ? 1 : 0);
698 - int acktimeout = slottime * 2 + 3;
699 - int ctstimeout = slottime * 2 + 3;
701 - printf("Setting distance on interface %s to %i meters\n",
703 - setsysctrl(device, "slottime", slottime);
704 - setsysctrl(device, "acktimeout", acktimeout);
705 - setsysctrl(device, "ctstimeout", ctstimeout);
710 --- a/tools/do_multi.c
711 +++ b/tools/do_multi.c
712 @@ -18,8 +18,6 @@ main(int argc, char *argv[])
713 ret = a80211stats_init(argc, argv);
714 if(strcmp(progname, "athchans") == 0)
715 ret = athchans_init(argc, argv);
716 - if(strcmp(progname, "athctrl") == 0)
717 - ret = athctrl_init(argc, argv);
719 if(strcmp(progname, "athdebug") == 0)
720 ret = athdebug_init(argc, argv);
721 --- a/tools/do_multi.h
722 +++ b/tools/do_multi.h
724 int a80211debug_init(int argc, char *argv[]);
725 int a80211stats_init(int argc, char *argv[]);
726 int athchans_init(int argc, char *argv[]);
727 -int athctrl_init(int argc, char *argv[]);
728 int athdebug_init(int argc, char *argv[]);
729 int athkey_init(int argc, char *argv[]);
730 int athstats_init(int argc, char *argv[]);
731 --- a/ath_rate/minstrel/minstrel.h
732 +++ b/ath_rate/minstrel/minstrel.h
733 @@ -172,14 +172,6 @@ struct minstrel_node {
735 #define ATH_NODE_MINSTREL(an) ((struct minstrel_node *)&an[1])
739 -#define MIN(a,b) ((a) < (b) ? (a) : (b))
742 -#define MAX(a,b) ((a) > (b) ? (a) : (b))
746 * Definitions for pulling the rate and trie counts from
747 * a 5212 h/w descriptor. These Don't belong here; the
748 --- a/ath_rate/sample/sample.h
749 +++ b/ath_rate/sample/sample.h
750 @@ -98,14 +98,6 @@ struct sample_node {
752 #define ATH_NODE_SAMPLE(an) ((struct sample_node *)&an[1])
756 -#define MIN(a,b) ((a) < (b) ? (a) : (b))
759 -#define MAX(a,b) ((a) > (b) ? (a) : (b))
763 * Definitions for pulling the rate and trie counts from
764 * a 5212 h/w descriptor. These Don't belong here; the