summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-11-30 10:52:11 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-11-30 10:52:11 +0000
commit0c22ccde2bb318931fd75b841e55583acfab8290 (patch)
tree47d4181677bf9bed10160b0387f33db9dbb2eb82 /sys
parentac252ce1da1618c50b7b39f9f2dea08e540cfaae (diff)
Make iwn(4) receive MIMO frames in monitor mode. We can now sniff all 802.11n
frames the hardware is able to receive. Use an xT3R device for best results. This change has not yet been tested on 1T1R devices due to lack of hardware. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_iwn.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index 4c23ff89e63..4140cd89612 100644
--- a/sys/dev/pci/if_iwn.c
+++ b/sys/dev/pci/if_iwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwn.c,v 1.175 2016/10/28 10:11:22 stsp Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.176 2016/11/30 10:52:10 stsp Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -4504,13 +4504,18 @@ iwn_config(struct iwn_softc *sc)
sc->rxon.ht_triple_mask = 0xff;
rxchain =
IWN_RXCHAIN_VALID(sc->rxchainmask) |
- IWN_RXCHAIN_MIMO_COUNT(2) |
- IWN_RXCHAIN_IDLE_COUNT(2);
+ IWN_RXCHAIN_MIMO_COUNT(sc->nrxchains) |
+ IWN_RXCHAIN_IDLE_COUNT(sc->nrxchains);
+ if (ic->ic_opmode == IEEE80211_M_MONITOR) {
+ rxchain |= IWN_RXCHAIN_FORCE_SEL(sc->rxchainmask);
+ rxchain |= IWN_RXCHAIN_FORCE_MIMO_SEL(sc->rxchainmask);
+ rxchain |= (IWN_RXCHAIN_DRIVER_FORCE | IWN_RXCHAIN_MIMO_FORCE);
+ }
sc->rxon.rxchain = htole16(rxchain);
DPRINTF(("setting configuration\n"));
- DPRINTF(("%s: rxon chan %d flags %x cck %x ofdm %x\n", __func__,
- sc->rxon.chan, le32toh(sc->rxon.flags), sc->rxon.cck_mask,
- sc->rxon.ofdm_mask));
+ DPRINTF(("%s: rxon chan %d flags %x cck %x ofdm %x rxchain %x\n",
+ __func__, sc->rxon.chan, le32toh(sc->rxon.flags), sc->rxon.cck_mask,
+ sc->rxon.ofdm_mask, sc->rxon.rxchain));
error = iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 0);
if (error != 0) {
printf("%s: RXON command failed\n", sc->sc_dev.dv_xname);