diff options
author | adrian <adrian@FreeBSD.org> | 2012-03-14 16:43:22 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-03-14 16:43:22 +0000 |
commit | 8dc16cc83eb816a1af41deb284900cefbf64abfb (patch) | |
tree | 1a6ee7cc52a6c3fc2bf9dcfd8d1ab8e49a68c135 /sys/dev/wtap | |
parent | 1204585265bed911e1a2b478cfc9393e528cc941 (diff) | |
download | FreeBSD-src-8dc16cc83eb816a1af41deb284900cefbf64abfb.zip FreeBSD-src-8dc16cc83eb816a1af41deb284900cefbf64abfb.tar.gz |
Correctly calculate the callout interval for beacon generation.
Submitted by: monthadar@gmail.com
Diffstat (limited to 'sys/dev/wtap')
-rw-r--r-- | sys/dev/wtap/if_wtap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index 29a90cb..948c1c4 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -305,6 +305,9 @@ wtap_bmiss(struct ieee80211vap *vap) avp->av_bmiss(vap); } +/* XXX */ +#define msecs_to_ticks(ms) (((ms) * hz) / 1000) + static struct ieee80211vap * wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, @@ -322,7 +325,7 @@ wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], M_80211_VAP, M_NOWAIT | M_ZERO); avp->id = sc->id; avp->av_md = sc->sc_md; - avp->av_bcinterval = BEACON_INTRERVAL + 100*sc->id; + avp->av_bcinterval = msecs_to_ticks(BEACON_INTRERVAL + 100*sc->id); vap = (struct ieee80211vap *) avp; error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS, flags | IEEE80211_CLONE_NOBEACONS, bssid, mac); @@ -346,6 +349,7 @@ wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], vap->iv_bss->ni_txrate = 130; return vap; } +#undef msecs_to_ticks static void wtap_vap_delete(struct ieee80211vap *vap) |