From owner-svn-src-head@freebsd.org Mon Oct 19 01:14:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8153AA18101; Mon, 19 Oct 2015 01:14:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 355C61BE9; Mon, 19 Oct 2015 01:14:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9J1EQHO080081; Mon, 19 Oct 2015 01:14:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9J1EQOg080080; Mon, 19 Oct 2015 01:14:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510190114.t9J1EQOg080080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 19 Oct 2015 01:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289556 - head/sys/dev/otus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 01:14:27 -0000 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. */