* [PATCH] ath9k: Further fix for mesh beaconing
@ 2011-05-24 12:42 ` Fabrice Deyber
0 siblings, 0 replies; 5+ messages in thread
From: Fabrice Deyber @ 2011-05-24 12:42 UTC (permalink / raw)
To: linville
Cc: devel, ath9k-devel, linux-wireless, lrodriguez, nbd, 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.
Signed-off-by: Fabrice Deyber <fabricedeyber@agilemesh.com>
---
drivers/net/wireless/ath/ath9k/beacon.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index d4d8cec..34675ae 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -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);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [ath9k-devel] [PATCH] ath9k: Further fix for mesh beaconing
@ 2011-05-24 12:42 ` Fabrice Deyber
0 siblings, 0 replies; 5+ messages in thread
From: Fabrice Deyber @ 2011-05-24 12:42 UTC (permalink / raw)
To: ath9k-devel
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.
Signed-off-by: Fabrice Deyber <fabricedeyber@agilemesh.com>
---
drivers/net/wireless/ath/ath9k/beacon.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index d4d8cec..34675ae 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -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);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ath9k: Further fix for mesh beaconing
2011-05-24 12:42 ` [ath9k-devel] " Fabrice Deyber
@ 2011-05-24 13:19 ` Felix Fietkau
-1 siblings, 0 replies; 5+ messages in thread
From: Felix Fietkau @ 2011-05-24 13:19 UTC (permalink / raw)
To: Fabrice Deyber; +Cc: linville, devel, ath9k-devel, linux-wireless, lrodriguez
On 2011-05-24 2:42 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 the absence of beacons.
>
> Signed-off-by: Fabrice Deyber<fabricedeyber@agilemesh.com>
> ---
> drivers/net/wireless/ath/ath9k/beacon.c | 15 +++------------
> 1 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
> index d4d8cec..34675ae 100644
> --- a/drivers/net/wireless/ath/ath9k/beacon.c
> +++ b/drivers/net/wireless/ath/ath9k/beacon.c
> @@ -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;
There's some whitespace damage here, please fix the indentation.
- Felix
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ath9k-devel] [PATCH] ath9k: Further fix for mesh beaconing
@ 2011-05-24 13:19 ` Felix Fietkau
0 siblings, 0 replies; 5+ messages in thread
From: Felix Fietkau @ 2011-05-24 13:19 UTC (permalink / raw)
To: ath9k-devel
On 2011-05-24 2:42 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 the absence of beacons.
>
> Signed-off-by: Fabrice Deyber<fabricedeyber@agilemesh.com>
> ---
> drivers/net/wireless/ath/ath9k/beacon.c | 15 +++------------
> 1 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
> index d4d8cec..34675ae 100644
> --- a/drivers/net/wireless/ath/ath9k/beacon.c
> +++ b/drivers/net/wireless/ath/ath9k/beacon.c
> @@ -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;
There's some whitespace damage here, please fix the indentation.
- Felix
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ath9k: Further fix for mesh beaconing
@ 2011-05-24 13:44 Fabrice Deyber
0 siblings, 0 replies; 5+ messages in thread
From: Fabrice Deyber @ 2011-05-24 13:44 UTC (permalink / raw)
To: linville
Cc: devel, ath9k-devel, linux-wireless, lrodriguez, nbd, 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.
Signed-off-by: Fabrice Deyber <fabricedeyber@agilemesh.com>
---
drivers/net/wireless/ath/ath9k/beacon.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index d4d8cec..b7864e0 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -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);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-24 13:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-24 12:42 [PATCH] ath9k: Further fix for mesh beaconing Fabrice Deyber
2011-05-24 12:42 ` [ath9k-devel] " Fabrice Deyber
2011-05-24 13:19 ` Felix Fietkau
2011-05-24 13:19 ` [ath9k-devel] " Felix Fietkau
2011-05-24 13:44 Fabrice Deyber
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.