From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felix Fietkau Date: Mon, 23 May 2011 23:53:19 +0200 Subject: [ath9k-devel] [PATCH] ath9k: Futher fix for mesh beaconing. In-Reply-To: <1306171357-24988-1-git-send-email-fabricedeyber@agilemesh.com> References: <1306171357-24988-1-git-send-email-fabricedeyber@agilemesh.com> Message-ID: <4DDAD74F.1040400@openwrt.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On 2011-05-23 7:22 PM, Fabrice Deyber wrote: > This fix ensure the timers to be set at beacon interval boundaries. Without this change timers can > be set improperly resulting in absence of beacons. > > > Signed-off-by: Fabrice Deyber > --- > drivers/net/wireless/ath/ath9k/beacon.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c > index d4d8cec..ffb3d81 100644 > --- a/drivers/net/wireless/ath/ath9k/beacon.c > +++ b/drivers/net/wireless/ath/ath9k/beacon.c > @@ -669,6 +669,8 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, > nexttbtt = tsf + intval - (delta % intval); > } > > + nexttbtt = roundup(nexttbtt, intval); > + If you're placing the nexttbtt boundary that way, you can easily also simplify the previous code to not calculate the delta between the last timestamp and the current one, but instead just round up tsf + TU_TO_USEC(FUDGE) to intval, making the code easier to read. - Felix