提交 459f5f90 编写于 作者: S Sujith 提交者: John W. Linville

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: NSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 980b24da
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
/* Implementation of beacon processing. */ /* Implementation of beacon processing. */
#include <asm/unaligned.h>
#include "core.h" #include "core.h"
/* /*
...@@ -305,6 +304,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) ...@@ -305,6 +304,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
struct ath_buf *bf; struct ath_buf *bf;
struct sk_buff *skb; struct sk_buff *skb;
__le64 tstamp;
avp = sc->sc_vaps[if_id]; avp = sc->sc_vaps[if_id];
ASSERT(avp); ASSERT(avp);
...@@ -370,6 +370,9 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) ...@@ -370,6 +370,9 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
return -ENOMEM; return -ENOMEM;
} }
tstamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
sc->bc_tstamp = le64_to_cpu(tstamp);
/* /*
* Calculate a TSF adjustment factor required for * Calculate a TSF adjustment factor required for
* staggered beacons. Note that we assume the format * staggered beacons. Note that we assume the format
...@@ -669,8 +672,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -669,8 +672,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
conf.bmiss_timeout = ATH_DEFAULT_BMISS_LIMIT * conf.beacon_interval; conf.bmiss_timeout = ATH_DEFAULT_BMISS_LIMIT * conf.beacon_interval;
/* extract tstamp from last beacon and convert to TU */ /* extract tstamp from last beacon and convert to TU */
nexttbtt = TSF_TO_TU(get_unaligned_le32(conf.u.last_tstamp + 4), nexttbtt = TSF_TO_TU(sc->bc_tstamp >> 32, sc->bc_tstamp);
get_unaligned_le32(conf.u.last_tstamp));
/* XXX conditionalize multi-bss support? */ /* XXX conditionalize multi-bss support? */
if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) { if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
/* /*
......
...@@ -1001,6 +1001,7 @@ struct ath_softc { ...@@ -1001,6 +1001,7 @@ struct ath_softc {
u32 sc_bhalq; u32 sc_bhalq;
u32 sc_bmisscount; u32 sc_bmisscount;
u32 ast_be_xmit; /* beacons transmitted */ u32 ast_be_xmit; /* beacons transmitted */
u64 bc_tstamp;
/* Rate */ /* Rate */
struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册