summaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches/366-bstuck_thresh.patch
blob: cde1f5c98ce422e1e8128cc9b6aabb08ba5db9d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- a/ath/if_ath.c
+++ b/ath/if_ath.c
@@ -389,6 +389,7 @@ static int ath_countrycode = CTRY_DEFAUL
 static int ath_outdoor = AH_FALSE;		/* enable outdoor use */
 static int ath_xchanmode = AH_TRUE;		/* enable extended channels */
 static int ath_maxvaps = ATH_MAXVAPS_DEFAULT;   /* set default maximum vaps */
+static int bstuck_thresh = BSTUCK_THRESH;       /* Stuck beacon count required for reset */
 static char *autocreate = NULL;
 static char *ratectl = DEF_RATE_CTL;
 static int rfkill = 0;
@@ -432,6 +433,7 @@ MODULE_PARM(rfkill, "i");
 #ifdef ATH_CAP_TPC
 MODULE_PARM(tpc, "i");
 #endif
+MODULE_PARM(bstuck_thresh, "i");
 MODULE_PARM(autocreate, "s");
 MODULE_PARM(ratectl, "s");
 #else
@@ -445,6 +447,7 @@ module_param(rfkill, int, 0600);
 #ifdef ATH_CAP_TPC
 module_param(tpc, int, 0600);
 #endif
+module_param(bstuck_thresh, int, 0600);
 module_param(autocreate, charp, 0600);
 module_param(ratectl, charp, 0600);
 #endif
@@ -457,6 +460,7 @@ MODULE_PARM_DESC(rfkill, "Enable/disable
 MODULE_PARM_DESC(tpc, "Enable/disable per-packet transmit power control (TPC) "
 		"capability");
 #endif
+MODULE_PARM_DESC(bstuck_thresh, "Override default stuck beacon threshold");
 MODULE_PARM_DESC(autocreate, "Create ath device in "
 		"[sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use "
 		"'none' to disable");
@@ -5072,7 +5076,7 @@ ath_beacon_send(struct ath_softc *sc, in
 		DPRINTF(sc, ATH_DEBUG_BEACON_PROC,
 			"Missed %u consecutive beacons (n_beacon=%u)\n",
 			sc->sc_bmisscount, n_beacon);
-		if (sc->sc_bmisscount > BSTUCK_THRESH)
+		if (sc->sc_bmisscount > bstuck_thresh)
 			ATH_SCHEDULE_TQUEUE(&sc->sc_bstucktq, needmark);
 		return;
 	}
@@ -5230,7 +5234,7 @@ ath_bstuck_tasklet(TQUEUE_ARG data)
 	 *     check will be true, in which case return
 	 *     without resetting the driver.
 	 */
-	if (sc->sc_bmisscount <= BSTUCK_THRESH)
+	if (sc->sc_bmisscount <= bstuck_thresh)
 		return;
 	EPRINTF(sc, "Stuck beacon; resetting (beacon miss count: %u)\n",
 		sc->sc_bmisscount);