Skip to content

Commit

Permalink
ath9k: Add sanity check for beacon_int in adhoc/mesh case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Jun 3, 2009
1 parent 73ca520 commit 546256f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/ath/ath9k/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,14 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,

intval = conf->beacon_interval & ATH9K_BEACON_PERIOD;

/*
* It looks like mac80211 may end up using beacon interval of zero in
* some cases (at least for mesh point). Avoid getting into an
* infinite loop by using a bit safer value instead..
*/
if (intval == 0)
intval = 100;

/* Pull nexttbtt forward to reflect the current TSF */

nexttbtt = TSF_TO_TU(sc->beacon.bc_tstamp >> 32, sc->beacon.bc_tstamp);
Expand Down

0 comments on commit 546256f

Please sign in to comment.