Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Oct 2015 01:14:26 +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: r289556 - head/sys/dev/otus
Message-ID:  <201510190114.t9J1EQOg080080@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Oct 19 01:14:26 2015
New Revision: 289556
URL: https://svnweb.freebsd.org/changeset/base/289556

Log:
  otus(4) - add initial monitor mode; use lowest rate for EAPOL
  
  The monitor mode stuff is from the openbsd driver, but it doesn't
  100% work.  It doesn't seem to get all frames for all BSSes.
  However, it's enough to at start debugging things.  That 0xffffffff
  write is /I think/ the RX filter, but I am still not 100% sure about
  it all.
  
  Then, whilst here, use the lowest rate for EAPOL frames.  This is just
  generally a good thing to do.

Modified:
  head/sys/dev/otus/if_otus.c

Modified: head/sys/dev/otus/if_otus.c
==============================================================================
--- head/sys/dev/otus/if_otus.c	Mon Oct 19 00:36:54 2015	(r289555)
+++ head/sys/dev/otus/if_otus.c	Mon Oct 19 01:14:26 2015	(r289556)
@@ -759,6 +759,7 @@ otus_attachhook(struct otus_softc *sc)
 	    IEEE80211_C_WME |		/* WME/QoS */
 	    IEEE80211_C_SHSLOT |	/* Short slot time supported. */
 	    IEEE80211_C_FF |		/* Atheros fast-frames supported. */
+	    IEEE80211_C_MONITOR |
 	    IEEE80211_C_WPA;		/* WPA/RSN. */
 
 	/* XXX TODO: 11n */
@@ -2229,6 +2230,9 @@ otus_tx(struct otus_softc *sc, struct ie
 	    (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) {
 		/* Get lowest rate */
 		rate = otus_rate_to_hw_rate(sc, 0);
+	} else if (m->m_flags & M_EAPOL) {
+		/* Get lowest rate */
+		rate = otus_rate_to_hw_rate(sc, 0);
 	} else {
 		(void) ieee80211_ratectl_rate(ni, NULL, 0);
 		rate = otus_rate_to_hw_rate(sc, ni->ni_txrate);
@@ -3094,13 +3098,22 @@ otus_init(struct otus_softc *sc)
 	}
 #endif
 
-	/* Expect STA operation */
-	otus_write(sc, 0x1c3700, 0x0f000002);
-	otus_write(sc, 0x1c3c40, 0x1);
+	switch (ic->ic_opmode) {
+	case IEEE80211_M_STA:
+		otus_write(sc, 0x1c3700, 0x0f000002);
+		otus_write(sc, 0x1c3c40, 0x1);
+		break;
+	case IEEE80211_M_MONITOR:
+		otus_write(sc, 0x1c368c, 0xffffffff);
+		break;
+	default:
+		break;
+	}
 
 	/* XXX ic_opmode? */
 	otus_write(sc, AR_MAC_REG_SNIFFER,
 	    (ic->ic_opmode == IEEE80211_M_MONITOR) ? 0x2000001 : 0x2000000);
+
 	(void)otus_write_barrier(sc);
 
 	sc->bb_reset = 1;	/* Force cold reset. */



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