huge madwifi update (work in progress, disabled by default, compiles but breaks at...
[librecmc/librecmc.git] / package / madwifi / patches-r3776 / 330-bstuck_thresh.patch
1 Index: madwifi-trunk-r3776/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3776.orig/ath/if_ath.c       2008-07-17 04:11:45.000000000 +0200
4 +++ madwifi-trunk-r3776/ath/if_ath.c    2008-07-17 04:12:51.000000000 +0200
5 @@ -354,6 +354,7 @@
6  static int ath_outdoor = AH_FALSE;             /* enable outdoor use */
7  static int ath_xchanmode = AH_TRUE;            /* enable extended channels */
8  static int ath_maxvaps = ATH_MAXVAPS_DEFAULT;   /* set default maximum vaps */
9 +static int bstuck_thresh = BSTUCK_THRESH;       /* Stuck beacon count required for reset */
10  static char *autocreate = "sta";
11  static char *ratectl = DEF_RATE_CTL;
12  static int rfkill = 0;
13 @@ -397,6 +398,7 @@
14  #ifdef ATH_CAP_TPC
15  MODULE_PARM(hal_tpc, "i");
16  #endif
17 +MODULE_PARM(bstuck_thresh, "i");
18  MODULE_PARM(autocreate, "s");
19  MODULE_PARM(ratectl, "s");
20  #else
21 @@ -410,6 +412,7 @@
22  #ifdef ATH_CAP_TPC
23  module_param(hal_tpc, int, 0600);
24  #endif
25 +module_param(bstuck_thresh, int, 0600);
26  module_param(autocreate, charp, 0600);
27  module_param(ratectl, charp, 0600);
28  #endif
29 @@ -422,6 +425,7 @@
30  MODULE_PARM_DESC(hal_tpc, "Disables manual per-packet transmit power control and "
31                 "lets this be managed by the HAL.  Default is OFF.");
32  #endif
33 +MODULE_PARM_DESC(bstuck_thresh, "Override default stuck beacon threshold");
34  MODULE_PARM_DESC(autocreate, "Create ath device in "
35                 "[sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use "
36                 "'none' to disable");
37 @@ -5238,7 +5242,7 @@
38                 DPRINTF(sc, ATH_DEBUG_BEACON_PROC,
39                         "Missed %u consecutive beacons (n_beacon=%u)\n",
40                         sc->sc_bmisscount, n_beacon);
41 -               if (sc->sc_bmisscount > BSTUCK_THRESH)
42 +               if (sc->sc_bmisscount > bstuck_thresh)
43                         ATH_SCHEDULE_TQUEUE(&sc->sc_bstucktq, needmark);
44                 return;
45         }
46 @@ -5409,7 +5413,7 @@
47          *     check will be true, in which case return
48          *     without resetting the driver.
49          */
50 -       if (sc->sc_bmisscount <= BSTUCK_THRESH)
51 +       if (sc->sc_bmisscount <= bstuck_thresh)
52                 return;
53         EPRINTF(sc, "Stuck beacon; resetting (beacon miss count: %u)\n",
54                 sc->sc_bmisscount);