aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-28 12:25:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:05:11 -0400
commit546256fbd06d70a87381020ea8553fb78c9abf43 (patch)
treebebb822415d2b798eaf91b037749f93260d93969
parent73ca5203366235f8a43e490767284ba8cfd8c479 (diff)
ath9k: Add sanity check for beacon_int in adhoc/mesh case
It looks like mac80211 can request the driver to start beaconing with a beacon interval of zero in some cases (at least for mesh point). This does not sound correct and something may need to be fixed in mac80211. However, taken into account the unpleasantness of getting stuck in an infinite busy loop with rtnl_lock held, let's add a quick workaround in the driver to avoid the worst symptom while someone more familiar with the mesh implementation can figure out what should be done with mac80211 as far as beacon interval configuration is concerned. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 0c67ed2e83ce..3639a2e6987d 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -674,6 +674,14 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
674 674
675 intval = conf->beacon_interval & ATH9K_BEACON_PERIOD; 675 intval = conf->beacon_interval & ATH9K_BEACON_PERIOD;
676 676
677 /*
678 * It looks like mac80211 may end up using beacon interval of zero in
679 * some cases (at least for mesh point). Avoid getting into an
680 * infinite loop by using a bit safer value instead..
681 */
682 if (intval == 0)
683 intval = 100;
684
677 /* Pull nexttbtt forward to reflect the current TSF */ 685 /* Pull nexttbtt forward to reflect the current TSF */
678 686
679 nexttbtt = TSF_TO_TU(sc->beacon.bc_tstamp >> 32, sc->beacon.bc_tstamp); 687 nexttbtt = TSF_TO_TU(sc->beacon.bc_tstamp >> 32, sc->beacon.bc_tstamp);