Skip to contentSkip to conversation

ath9k: Further fix for mesh beaconing

PATCH New Fabrice Deyber 2 participants 2 messages May 24, 2011 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: Further fix for mesh beaconing

This fix ensure the timers to be set at beacon interval boundaries. Without this change timers can be set improperly resulting in the absence of beacons.

---
 drivers/net/wireless/ath/ath9k/beacon.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +3 -12
index d4d8cec..34675ae 100644
@@ -656,19 +656,10 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
 
 	ath9k_reset_beacon_status(sc);
 
-	tsf = ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE);
 	intval = TU_TO_USEC(conf->beacon_interval & ATH9K_BEACON_PERIOD);
-
-	if (!sc->beacon.bc_tstamp)
-		nexttbtt = tsf + intval;
-	else {
-		if (tsf > sc->beacon.bc_tstamp)
-			delta = (tsf - sc->beacon.bc_tstamp);
-		else
-			delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp));
-		nexttbtt = tsf + intval - (delta % intval);
-	}
-
+    tsf = roundup(ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE), intval);	
+    nexttbtt = tsf + intval;
+    
 	ath_dbg(common, ATH_DBG_BEACON,
 		"IBSS nexttbtt %u intval %u (%u)\n",
 		nexttbtt, intval, conf->beacon_interval);
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 ath9k: Further fix for mesh beaconing

Quoted 21 lines · Fabrice Deyber

This fix ensure the timers to be set at beacon interval boundaries. Without this change timers can be set improperly resulting in the absence of beacons.

---
  drivers/net/wireless/ath/ath9k/beacon.c |   15 +++------------
  1 files changed, 3 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +0 -4
index d4d8cec..34675ae 100644
@@ -656,19 +656,10 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
 
  	ath9k_reset_beacon_status(sc);
 
-	tsf = ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE);
  	intval = TU_TO_USEC(conf->beacon_interval&  ATH9K_BEACON_PERIOD);
-
-	if (!sc->beacon.bc_tstamp)
-		nexttbtt = tsf + intval;

drivers/net/wireless/ath/ath9k/beacon.c static void ath_beacon_config_adhoc(struct ath_softc *sc, · line 661

Quoted 10 lines
drivers/net/wireless/ath/ath9k/beacon.c +2 -8
-	else {
-		if (tsf>  sc->beacon.bc_tstamp)
-			delta = (tsf - sc->beacon.bc_tstamp);
-		else
-			delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp));
-		nexttbtt = tsf + intval - (delta % intval);
-	}
-
+    tsf = roundup(ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE), intval);	
+    nexttbtt = tsf + intval;

There's some whitespace damage here, please fix the indentation.

- Felix