summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-11-17 14:12:34 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-11-17 14:12:34 +0000
commit3ea98a69ad309c5c7a1ae4e6cb179e6b4af65416 (patch)
tree66c892ca89ca9a9808e7e6bf0a98ce7f695e701b
parent2bfe3cbfe2f8ce82834fe767c1eb83da9fa22745 (diff)
Make iwm(4) pass Tx/Rx MCS rates to bpf so they can be examined with tcpdump.
ok mpi@
-rw-r--r--sys/dev/pci/if_iwm.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 012a167d1af..2388e4954ea 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.146 2016/11/01 13:49:50 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.147 2016/11/17 14:12:33 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -3319,12 +3319,9 @@ iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
tap->wr_tsft = phy_info->system_timestamp;
if (phy_info->phy_flags &
htole16(IWM_RX_RES_PHY_FLAGS_OFDM_HT)) {
-#ifdef notyet
uint8_t mcs = (phy_info->rate_n_flags &
htole32(IWM_RATE_HT_MCS_RATE_CODE_MSK));
-#endif
- /* XXX need a way to pass current MCS in 11n mode */
- tap->wr_rate = 0;
+ tap->wr_rate = (0x80 | mcs);
} else {
uint8_t rate = (phy_info->rate_n_flags &
htole32(IWM_RATE_LEGACY_RATE_MSK));
@@ -3940,9 +3937,11 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac)
tap->wt_flags = 0;
tap->wt_chan_freq = htole16(ni->ni_chan->ic_freq);
tap->wt_chan_flags = htole16(ni->ni_chan->ic_flags);
- if (rinfo->plcp == IWM_RATE_INVM_PLCP) {
- /* XXX need a way to pass current MCS in 11n mode */
- tap->wt_rate = 0;
+ if ((ni->ni_flags & IEEE80211_NODE_HT) &&
+ !IEEE80211_IS_MULTICAST(wh->i_addr1) &&
+ type == IEEE80211_FC0_TYPE_DATA &&
+ rinfo->plcp == IWM_RATE_INVM_PLCP) {
+ tap->wt_rate = (0x80 | rinfo->ht_plcp);
} else
tap->wt_rate = rinfo->rate;
tap->wt_hwqueue = ac;