Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2011 16:05:18 +0800
From:      Kang Yin Su <cantona@cantona.net>
To:        freebsd-wireless@freebsd.org
Subject:   [PATCH] AR5416 BEACON TIMER
Message-ID:  <CAHjFwoBqRpkUODu%2BCKaGU9U89akGSMO6=M8M_p-1iC1Y9y3a6Q@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi all,

Patch for AR5416
- Shift the timer value from 1/8 TU directly to USEC.
- Correct AR_NEXT_TBTT from 1 TU to USEC

Regards,
Yin

Adrian Chadd <adrian@freebsd.org>
On Tue, Aug 23, 2011 at 3:53 PM, Adrian Chadd <adrian@freebsd.org> wrote:

> Cool, thanks. :)
>
> And please forward your latest patch. :) I'll commit it tonight or
> tomorrow.
>
>
> ADrian
>
>

[-- Attachment #2 --]
Index: sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c
===================================================================
--- sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c	(revision 225075)
+++ sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c	(working copy)
@@ -26,6 +26,7 @@
 #include "ar5416/ar5416phy.h"
 
 #define TU_TO_USEC(_tu)		((_tu) << 10)
+#define ONE_EIGHTH_TU_TO_USEC(_tu8)	((_tu8) << 7)
 
 /*
  * Initialize all of the hardware registers used to
@@ -38,8 +39,8 @@
 	uint32_t bperiod;
 
 	OS_REG_WRITE(ah, AR_NEXT_TBTT, TU_TO_USEC(bt->bt_nexttbtt));
-	OS_REG_WRITE(ah, AR_NEXT_DBA, TU_TO_USEC(bt->bt_nextdba) >> 3);
-	OS_REG_WRITE(ah, AR_NEXT_SWBA, TU_TO_USEC(bt->bt_nextswba) >> 3);
+	OS_REG_WRITE(ah, AR_NEXT_DBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextdba));
+	OS_REG_WRITE(ah, AR_NEXT_SWBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextswba));
 	OS_REG_WRITE(ah, AR_NEXT_NDP, TU_TO_USEC(bt->bt_nextatim));
 
 	bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD);
@@ -144,7 +145,7 @@
 	
 	/* NB: no cfp setting since h/w automatically takes care */
 
-	OS_REG_WRITE(ah, AR_NEXT_TBTT, bs->bs_nexttbtt);
+	OS_REG_WRITE(ah, AR_NEXT_TBTT, TU_TO_USEC(bs->bs_nexttbtt));
 
 	/*
 	 * Start the beacon timers by setting the BEACON register
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHjFwoBqRpkUODu%2BCKaGU9U89akGSMO6=M8M_p-1iC1Y9y3a6Q>