diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-09-17 00:45:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-24 16:18:02 -0400 |
commit | 459f5f90f1bd959ced04761406415b178b315177 (patch) | |
tree | 4942464314d109e400d0a266e7f596bd4cbda969 /drivers/net | |
parent | 980b24da6f1725c2d0b32c9484d06cd7d09d3c4b (diff) |
ath9k: Fix nexttbtt calculation
nexttbtt has to be obtained from the timestamp of the beacon
obtained from mac80211. Fix this.
And <asm/unaligned.h> is not needed anymore.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath9k/beacon.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index f8d952ca3f85..eedb465d25d3 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | /* Implementation of beacon processing. */ | 17 | /* Implementation of beacon processing. */ |
18 | 18 | ||
19 | #include <asm/unaligned.h> | ||
20 | #include "core.h" | 19 | #include "core.h" |
21 | 20 | ||
22 | /* | 21 | /* |
@@ -305,6 +304,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) | |||
305 | struct ieee80211_hdr *hdr; | 304 | struct ieee80211_hdr *hdr; |
306 | struct ath_buf *bf; | 305 | struct ath_buf *bf; |
307 | struct sk_buff *skb; | 306 | struct sk_buff *skb; |
307 | __le64 tstamp; | ||
308 | 308 | ||
309 | avp = sc->sc_vaps[if_id]; | 309 | avp = sc->sc_vaps[if_id]; |
310 | ASSERT(avp); | 310 | ASSERT(avp); |
@@ -370,6 +370,9 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) | |||
370 | return -ENOMEM; | 370 | return -ENOMEM; |
371 | } | 371 | } |
372 | 372 | ||
373 | tstamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; | ||
374 | sc->bc_tstamp = le64_to_cpu(tstamp); | ||
375 | |||
373 | /* | 376 | /* |
374 | * Calculate a TSF adjustment factor required for | 377 | * Calculate a TSF adjustment factor required for |
375 | * staggered beacons. Note that we assume the format | 378 | * staggered beacons. Note that we assume the format |
@@ -669,8 +672,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) | |||
669 | conf.bmiss_timeout = ATH_DEFAULT_BMISS_LIMIT * conf.beacon_interval; | 672 | conf.bmiss_timeout = ATH_DEFAULT_BMISS_LIMIT * conf.beacon_interval; |
670 | 673 | ||
671 | /* extract tstamp from last beacon and convert to TU */ | 674 | /* extract tstamp from last beacon and convert to TU */ |
672 | nexttbtt = TSF_TO_TU(get_unaligned_le32(conf.u.last_tstamp + 4), | 675 | nexttbtt = TSF_TO_TU(sc->bc_tstamp >> 32, sc->bc_tstamp); |
673 | get_unaligned_le32(conf.u.last_tstamp)); | 676 | |
674 | /* XXX conditionalize multi-bss support? */ | 677 | /* XXX conditionalize multi-bss support? */ |
675 | if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) { | 678 | if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) { |
676 | /* | 679 | /* |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index b66de29cf662..6ff3befe39f7 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -1001,6 +1001,7 @@ struct ath_softc { | |||
1001 | u32 sc_bhalq; | 1001 | u32 sc_bhalq; |
1002 | u32 sc_bmisscount; | 1002 | u32 sc_bmisscount; |
1003 | u32 ast_be_xmit; /* beacons transmitted */ | 1003 | u32 ast_be_xmit; /* beacons transmitted */ |
1004 | u64 bc_tstamp; | ||
1004 | 1005 | ||
1005 | /* Rate */ | 1006 | /* Rate */ |
1006 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; | 1007 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; |