From 2bc3ce7732b7ca91e77c133c89af3dfb482ba5b8 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Wed, 18 Mar 2009 19:28:17 +0000 Subject: Minor cleanups of tdma protocol handling: o break out version-related code to simplify rev'ing the protocol o add parameter validation macros so checks that appear multiple places are consistent (and easy to change) o add protocol version check when looking for a scan candidate o improve scan debug output format o rewrite beacon update handling to calculate a bitmask of changed values and pass that down through the driver callback so drivers can optimize work o do slot bounds check before use when parsing received beacons --- sys/dev/ath/if_ath.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/ath') diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 3a401fefe723..7a59520f95ef 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -225,7 +225,7 @@ static void ath_tdma_bintvalsetup(struct ath_softc *sc, const struct ieee80211_tdma_state *tdma); static void ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap); static void ath_tdma_update(struct ieee80211_node *ni, - const struct ieee80211_tdma_param *tdma); + const struct ieee80211_tdma_param *tdma, int); static void ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap); @@ -7477,7 +7477,7 @@ ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap) */ static void ath_tdma_update(struct ieee80211_node *ni, - const struct ieee80211_tdma_param *tdma) + const struct ieee80211_tdma_param *tdma, int changed) { #define TSF_TO_TU(_h,_l) \ ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) @@ -7498,7 +7498,7 @@ ath_tdma_update(struct ieee80211_node *ni, /* * Check for and adopt configuration changes. */ - if (isset(ATH_VAP(vap)->av_boff.bo_flags, IEEE80211_BEACON_TDMA)) { + if (changed != 0) { const struct ieee80211_tdma_state *ts = vap->iv_tdma; ath_tdma_bintvalsetup(sc, ts); -- cgit v1.3