svn commit: r297405 - in head/sys: dev/ath net80211

Adrian Chadd adrian at FreeBSD.org
Wed Mar 30 00:44:12 UTC 2016


Author: adrian
Date: Wed Mar 30 00:44:10 2016
New Revision: 297405
URL: https://svnweb.freebsd.org/changeset/base/297405

Log:
  [net80211] migrate the time_* macros to ieee80211_* namespace.
  
  It turns out that these will clash very annoyingly with the linux
  macros in the linuxkpi layer, so let the wookie^Wlinux win.
  
  The only user that I can find is ath(4), so fix it there too.

Modified:
  head/sys/dev/ath/if_ath_lna_div.c
  head/sys/net80211/ieee80211_dfs.c
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_power.c
  head/sys/net80211/ieee80211_scan_sta.c
  head/sys/net80211/ieee80211_scan_sw.c
  head/sys/net80211/ieee80211_sta.c

Modified: head/sys/dev/ath/if_ath_lna_div.c
==============================================================================
--- head/sys/dev/ath/if_ath_lna_div.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/dev/ath/if_ath_lna_div.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -766,7 +766,7 @@ ath_lna_rx_comb_scan(struct ath_softc *s
 
 	/* Short scan check */
 	if (antcomb->scan && antcomb->alt_good) {
-		if (time_after(ticks, antcomb->scan_start_time +
+		if (ieee80211_time_after(ticks, antcomb->scan_start_time +
 		    msecs_to_jiffies(ATH_ANT_DIV_COMB_SHORT_SCAN_INTR)))
 			short_scan = AH_TRUE;
 		else

Modified: head/sys/net80211/ieee80211_dfs.c
==============================================================================
--- head/sys/net80211/ieee80211_dfs.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_dfs.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -245,7 +245,7 @@ dfs_timeout(void *arg)
 	for (i = 0; i < ic->ic_nchans; i++) {
 		c = &ic->ic_channels[i];
 		if (IEEE80211_IS_CHAN_RADAR(c)) {
-			if (time_after_eq(now, dfs->nol_event[i]+NOL_TIMEOUT)) {
+			if (ieee80211_time_after_eq(now, dfs->nol_event[i]+NOL_TIMEOUT)) {
 				c->ic_state &= ~IEEE80211_CHANSTATE_RADAR;
 				if (c->ic_state & IEEE80211_CHANSTATE_NORADAR) {
 					/*

Modified: head/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.h	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_freebsd.h	Wed Mar 30 00:44:10 2016	(r297405)
@@ -251,10 +251,10 @@ void	ieee80211_vap_destroy(struct ieee80
 #define	ticks_to_msecs(t)	(1000*(t) / hz)
 #define	ticks_to_secs(t)	((t) / hz)
 
-#define time_after(a,b) 	((long)(b) - (long)(a) < 0)
-#define time_before(a,b)	time_after(b,a)
-#define time_after_eq(a,b)	((long)(a) - (long)(b) >= 0)
-#define time_before_eq(a,b)	time_after_eq(b,a)
+#define ieee80211_time_after(a,b) 	((long)(b) - (long)(a) < 0)
+#define ieee80211_time_before(a,b)	ieee80211_time_after(b,a)
+#define ieee80211_time_after_eq(a,b)	((long)(a) - (long)(b) >= 0)
+#define ieee80211_time_before_eq(a,b)	ieee80211_time_after_eq(b,a)
 
 struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
 

Modified: head/sys/net80211/ieee80211_ht.c
==============================================================================
--- head/sys/net80211/ieee80211_ht.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_ht.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -1406,7 +1406,7 @@ ieee80211_ht_timeout(struct ieee80211com
 	IEEE80211_LOCK_ASSERT(ic);
 
 	if ((ic->ic_flags_ht & IEEE80211_FHT_NONHT_PR) &&
-	    time_after(ticks, ic->ic_lastnonht + IEEE80211_NONHT_PRESENT_AGE)) {
+	    ieee80211_time_after(ticks, ic->ic_lastnonht + IEEE80211_NONHT_PRESENT_AGE)) {
 #if 0
 		IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni,
 		    "%s", "time out non-HT STA present on channel");

Modified: head/sys/net80211/ieee80211_node.c
==============================================================================
--- head/sys/net80211/ieee80211_node.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_node.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -2638,7 +2638,7 @@ ieee80211_erp_timeout(struct ieee80211co
 	IEEE80211_LOCK_ASSERT(ic);
 
 	if ((ic->ic_flags_ext & IEEE80211_FEXT_NONERP_PR) &&
-	    time_after(ticks, ic->ic_lastnonerp + IEEE80211_NONERP_PRESENT_AGE)) {
+	    ieee80211_time_after(ticks, ic->ic_lastnonerp + IEEE80211_NONERP_PRESENT_AGE)) {
 #if 0
 		IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni,
 		    "%s", "age out non-ERP sta present on channel");

Modified: head/sys/net80211/ieee80211_power.c
==============================================================================
--- head/sys/net80211/ieee80211_power.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_power.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -623,7 +623,7 @@ ieee80211_sta_ps_timer_check(struct ieee
 
 	/* If we've done any data within our idle interval, bail */
 	/* XXX hard-coded to one second for now, ew! */
-	if (time_after(ic->ic_lastdata + 500, ticks))
+	if (ieee80211_time_after(ic->ic_lastdata + 500, ticks))
 		goto out;
 
 	/*

Modified: head/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_scan_sta.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_scan_sta.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -1323,7 +1323,7 @@ sta_roam_check(struct ieee80211_scan_sta
 	 * XXX deauth current ap
 	 */
 	if (curRate < roamRate || curRssi < roamRssi) {
-		if (time_after(ticks, ic->ic_lastscan + vap->iv_scanvalid)) {
+		if (ieee80211_time_after(ticks, ic->ic_lastscan + vap->iv_scanvalid)) {
 			/*
 			 * Scan cache contents are too old; force a scan now
 			 * if possible so we have current state to make a
@@ -1333,7 +1333,7 @@ sta_roam_check(struct ieee80211_scan_sta
 			 * XXX force immediate switch on scan complete
 			 */
 			if (!IEEE80211_IS_CHAN_DTURBO(ic->ic_curchan) &&
-			    time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle))
+			    ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle))
 				ieee80211_bg_scan(vap, 0);
 			return;
 		}

Modified: head/sys/net80211/ieee80211_scan_sw.c
==============================================================================
--- head/sys/net80211/ieee80211_scan_sw.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_scan_sw.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -304,7 +304,7 @@ ieee80211_swscan_check_scan(const struct
 		}
 		if ((ic->ic_flags & IEEE80211_F_SCAN) == 0 &&
 		    (flags & IEEE80211_SCAN_FLUSH) == 0 &&
-		    time_before(ticks, ic->ic_lastscan + vap->iv_scanvalid)) {
+		    ieee80211_time_before(ticks, ic->ic_lastscan + vap->iv_scanvalid)) {
 			/*
 			 * We're not currently scanning and the cache is
 			 * deemed hot enough to consult.  Lock out others
@@ -674,7 +674,7 @@ end:
 
 	if (scandone || (ss->ss_flags & IEEE80211_SCAN_GOTPICK) ||
 	    (ss_priv->ss_iflags & ISCAN_ABORT) ||
-	     time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) {
+	     ieee80211_time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) {
 		ss_priv->ss_iflags &= ~ISCAN_RUNNING;
 		scan_end(ss, scandone);
 		return;
@@ -686,7 +686,7 @@ end:
 	/*
 	 * Watch for truncation due to the scan end time.
 	 */
-	if (time_after(ticks + ss->ss_maxdwell, ss_priv->ss_scanend))
+	if (ieee80211_time_after(ticks + ss->ss_maxdwell, ss_priv->ss_scanend))
 		maxdwell = ss_priv->ss_scanend - ticks;
 	else
 		maxdwell = ss->ss_maxdwell;
@@ -807,7 +807,7 @@ scan_end(struct ieee80211_scan_state *ss
 	if ((ss_priv->ss_iflags & ISCAN_CANCEL) == 0 &&
 	    !ss->ss_ops->scan_end(ss, vap) &&
 	    (ss->ss_flags & IEEE80211_SCAN_ONCE) == 0 &&
-	    time_before(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) {
+	    ieee80211_time_before(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) {
 		IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
 		    "%s: done, restart "
 		    "[ticks %u, dwell min %lu scanend %lu]\n",
@@ -923,7 +923,7 @@ ieee80211_swscan_add_scan(struct ieee802
 		 * the timer so we'll switch to the next channel.
 		 */
 		if ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_MINDWELL) == 0 &&
-		    time_after_eq(ticks, SCAN_PRIVATE(ss)->ss_chanmindwell)) {
+		    ieee80211_time_after_eq(ticks, SCAN_PRIVATE(ss)->ss_chanmindwell)) {
 			IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
 			    "%s: chan %3d%c min dwell met (%u > %lu)\n",
 			    __func__,

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Wed Mar 30 00:42:18 2016	(r297404)
+++ head/sys/net80211/ieee80211_sta.c	Wed Mar 30 00:44:10 2016	(r297405)
@@ -1253,7 +1253,7 @@ contbgscan(struct ieee80211vap *vap)
 	return ((ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) &&
 	    (ic->ic_flags & IEEE80211_F_CSAPENDING) == 0 &&
 	    vap->iv_state == IEEE80211_S_RUN &&		/* XXX? */
-	    time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle));
+	    ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle));
 }
 
 /*
@@ -1274,8 +1274,8 @@ startbgscan(struct ieee80211vap *vap)
 #ifdef IEEE80211_SUPPORT_SUPERG
 	    !IEEE80211_IS_CHAN_DTURBO(ic->ic_curchan) &&
 #endif
-	    time_after(ticks, ic->ic_lastscan + vap->iv_bgscanintvl) &&
-	    time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle));
+	    ieee80211_time_after(ticks, ic->ic_lastscan + vap->iv_bgscanintvl) &&
+	    ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle));
 }
 
 static void


More information about the svn-src-head mailing list