Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2012 16:43:23 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232978 - head/sys/dev/wtap
Message-ID:  <201203141643.q2EGhNd1022204@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Mar 14 16:43:22 2012
New Revision: 232978
URL: http://svn.freebsd.org/changeset/base/232978

Log:
  Correctly calculate the callout interval for beacon generation.
  
  Submitted by:	monthadar@gmail.com

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==============================================================================
--- head/sys/dev/wtap/if_wtap.c	Wed Mar 14 16:22:09 2012	(r232977)
+++ head/sys/dev/wtap/if_wtap.c	Wed Mar 14 16:43:22 2012	(r232978)
@@ -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,
 	    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,
 	vap->iv_bss->ni_txrate = 130;
 	return vap;
 }
+#undef	msecs_to_ticks
 
 static void
 wtap_vap_delete(struct ieee80211vap *vap)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203141643.q2EGhNd1022204>