From: damien Date: Wed, 27 Aug 2008 10:34:24 +0000 (+0000) Subject: pass FCS to radiotap. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=06375c52cb800edb1edc9ae8f9c793cafc06d914;p=openbsd pass FCS to radiotap. --- diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index 0adacf6c1bd..f84f4ddbbba 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.107 2008/08/27 09:05:03 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.108 2008/08/27 10:34:24 damien Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -771,7 +771,6 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) /* finalize mbuf */ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = (letoh32(desc->flags) >> 16) & 0xfff; - m_adj(m, -IEEE80211_CRC_LEN); /* trim FCS */ s = splnet(); @@ -780,7 +779,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) struct mbuf mb; struct ural_rx_radiotap_header *tap = &sc->sc_rxtap; - tap->wr_flags = 0; + tap->wr_flags = IEEE80211_RADIOTAP_F_FCS; tap->wr_rate = ural_rxrate(desc); tap->wr_chan_freq = htole16(ic->ic_bss->ni_chan->ic_freq); tap->wr_chan_flags = htole16(ic->ic_bss->ni_chan->ic_flags); @@ -796,6 +795,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN); } #endif + m_adj(m, -IEEE80211_CRC_LEN); /* trim FCS */ wh = mtod(m, struct ieee80211_frame *); ni = ieee80211_find_rxnode(ic, wh); diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index 71dc2102db4..a7496e3319f 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.37 2008/08/08 12:20:24 thib Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.38 2008/08/27 10:34:24 damien Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -1789,9 +1789,6 @@ upgt_rx(struct upgt_softc *sc, uint8_t *data, int pkglen) } m_adj(m, ETHER_ALIGN); - /* trim FCS */ - m_adj(m, -IEEE80211_CRC_LEN); - s = splnet(); #if NBPFILTER > 0 @@ -1799,7 +1796,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t *data, int pkglen) struct mbuf mb; struct upgt_rx_radiotap_header *tap = &sc->sc_rxtap; - tap->wr_flags = 0; + tap->wr_flags = IEEE80211_RADIOTAP_F_FCS; tap->wr_rate = upgt_rx_rate(sc, rxdesc->rate); tap->wr_chan_freq = htole16(ic->ic_bss->ni_chan->ic_freq); tap->wr_chan_flags = htole16(ic->ic_bss->ni_chan->ic_flags); @@ -1814,6 +1811,8 @@ upgt_rx(struct upgt_softc *sc, uint8_t *data, int pkglen) bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN); } #endif + /* trim FCS */ + m_adj(m, -IEEE80211_CRC_LEN); wh = mtod(m, struct ieee80211_frame *); ni = ieee80211_find_rxnode(ic, wh);