-/* $OpenBSD: acx.c,v 1.84 2008/06/22 21:40:36 brad Exp $ */
+/* $OpenBSD: acx.c,v 1.85 2008/07/21 18:43:19 damien Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
struct acx_rxbuf_hdr *head;
struct acx_rxbuf *buf;
struct mbuf *m;
+ struct ieee80211_rxinfo rxi;
uint32_t desc_status;
uint16_t desc_ctrl;
int len, error;
sc->chip_rxbuf_exhdr);
wh = mtod(m, struct ieee80211_frame *);
+ rxi.rxi_flags = 0;
if ((wh->i_fc[1] & IEEE80211_FC1_WEP) &&
sc->chip_hw_crypt) {
/* Short circuit software WEP */
sc->chip_proc_wep_rxbuf(sc, m, &len);
wh = mtod(m, struct ieee80211_frame *);
}
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
}
m->m_len = m->m_pkthdr.len = len;
ni = ieee80211_find_rxnode(ic, wh);
- ieee80211_input(ifp, m, ni, head->rbh_level,
- letoh32(head->rbh_time));
+ rxi.rxi_rssi = head->rbh_level;
+ rxi.rxi_tstamp = letoh32(head->rbh_time);
+ ieee80211_input(ifp, m, ni, &rxi);
ieee80211_release_node(ic, ni);
} else {
-/* $OpenBSD: an.c,v 1.54 2007/09/30 11:33:14 kettenis Exp $ */
+/* $OpenBSD: an.c,v 1.55 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct an_rxframe frmhdr;
struct mbuf *m;
#endif /* NBPFILTER > 0 */
wh = mtod(m, struct ieee80211_frame *);
+ rxi.rxi_flags = 0;
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
/*
* WEP is decrypted by hardware. Clear WEP bit
* header for ieee80211_input().
*/
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
+
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
}
ni = ieee80211_find_rxnode(ic, wh);
- ieee80211_input(ifp, m, ni, frmhdr.an_rx_signal_strength,
- an_switch32(frmhdr.an_rx_time));
+ rxi.rxi_rssi = frmhdr.an_rx_signal_strength;
+ rxi.rxi_tstamp = an_switch32(frmhdr.an_rx_time);
+ ieee80211_input(ifp, m, ni, &rxi);
ieee80211_release_node(ic, ni);
}
-/* $OpenBSD: ath.c,v 1.69 2007/10/13 16:12:29 fgsch Exp $ */
+/* $OpenBSD: ath.c,v 1.70 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
void ath_rssadapt_updatenode(void *, struct ieee80211_node *);
void ath_rssadapt_updatestats(void *);
void ath_recv_mgmt(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *, int);
void ath_disable(struct ath_softc *);
void ath_power(int, void *);
struct ath_desc *ds;
struct mbuf *m;
struct ieee80211_frame *wh, whbuf;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct ath_node *an;
struct ath_recv_hist *rh;
bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN);
}
#endif
-
m_adj(m, -IEEE80211_CRC_LEN);
wh = mtod(m, struct ieee80211_frame *);
+ rxi.rxi_flags = 0;
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
/*
* WEP is decrypted by hardware. Clear WEP bit
* The header has probably moved.
*/
wh = mtod(m, struct ieee80211_frame *);
+
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
}
/*
/*
* Send frame up for processing.
*/
- ieee80211_input(ifp, m, ni,
- ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp);
+ rxi.rxi_rssi = ds->ds_rxstat.rs_rssi;
+ rxi.rxi_tstamp = ds->ds_rxstat.rs_tstamp;
+ ieee80211_input(ifp, m, ni, &rxi);
/* Handle the rate adaption */
ieee80211_rssadapt_input(ic, ni, &an->an_rssadapt,
void
ath_recv_mgmt(struct ieee80211com *ic, struct mbuf *m,
- struct ieee80211_node *ni, int subtype, int rssi, u_int32_t rstamp)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, int subtype)
{
struct ath_softc *sc = (struct ath_softc*)ic->ic_softc;
struct ath_hal *ah = sc->sc_ah;
- (*sc->sc_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp);
+ (*sc->sc_recv_mgmt)(ic, m, ni, rxi, subtype);
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
-/* $OpenBSD: athvar.h,v 1.22 2008/06/14 02:28:14 jsing Exp $ */
+/* $OpenBSD: athvar.h,v 1.23 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: athvar.h,v 1.10 2004/08/10 01:03:53 dyoung Exp $ */
/*-
const struct ieee80211_node *);
void (*sc_recv_mgmt)(struct ieee80211com *,
struct mbuf *, struct ieee80211_node *,
- int, int, u_int32_t);
+ struct ieee80211_rxinfo *, int);
#ifdef __FreeBSD__
device_t sc_dev;
#endif
-/* $OpenBSD: atw.c,v 1.59 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: atw.c,v 1.60 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */
/*-
int atw_newstate(struct ieee80211com *, enum ieee80211_state, int);
int atw_tune(struct atw_softc *);
void atw_recv_mgmt(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *, int);
void atw_next_scan(void *);
/* Device initialization */
void
atw_recv_mgmt(struct ieee80211com *ic, struct mbuf *m,
- struct ieee80211_node *ni, int subtype, int rssi, u_int32_t rstamp)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, int subtype)
{
struct atw_softc *sc = (struct atw_softc*)ic->ic_softc;
sc->sc_rev < ATW_REVISION_BA)
return;
- (*sc->sc_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp);
+ (*sc->sc_recv_mgmt)(ic, m, ni, rxi, subtype);
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
{
static int rate_tbl[] = {2, 4, 11, 22, 44};
struct ieee80211com *ic = &sc->sc_ic;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct ieee80211_frame *wh;
struct ifnet *ifp = &ic->ic_if;
wh = mtod(m, struct ieee80211_frame *);
ni = ieee80211_find_rxnode(ic, wh);
+ rxi.rxi_flags = 0;
#if 0
- if (atw_hw_decrypted(sc, wh))
+ if (atw_hw_decrypted(sc, wh)) {
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
+ }
#endif
- ieee80211_input(ifp, m, ni, (int)rssi, 0);
+ rxi.rxi_rssi = (int)rssi;
+ rxi.rxi_tstamp = 0;
+ ieee80211_input(ifp, m, ni, &rxi);
/*
* The frame may have caused the node to be marked for
* reclamation (e.g. in response to a DEAUTH message)
-/* $OpenBSD: atwvar.h,v 1.14 2008/06/27 06:03:08 ray Exp $ */
+/* $OpenBSD: atwvar.h,v 1.15 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: atwvar.h,v 1.13 2004/07/23 07:07:55 dyoung Exp $ */
/*
enum ieee80211_state, int);
void (*sc_recv_mgmt)(struct ieee80211com *,
struct mbuf *, struct ieee80211_node *,
- int, int, u_int32_t);
+ struct ieee80211_rxinfo *, int);
struct ieee80211_node *(*sc_node_alloc)(struct ieee80211com *);
void (*sc_node_free)(struct ieee80211com *,
struct ieee80211_node *);
-/* $OpenBSD: bwi.c,v 1.76 2008/06/11 00:17:17 jsg Exp $ */
+/* $OpenBSD: bwi.c,v 1.77 2008/07/21 18:43:19 damien Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
struct bwi_rxbuf *rb = &rbd->rbd_buf[idx];
struct bwi_rxbuf_hdr *hdr;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *m;
void *plcp;
ni = ieee80211_find_rxnode(ic, wh);
type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
- ieee80211_input(ifp, m, ni, hdr->rxh_rssi,
- letoh16(hdr->rxh_tsf));
+ rxi.rxi_rssi = hdr->rxh_rssi;
+ rxi.rxi_tstamp = letoh16(hdr->rxh_tsf);
+ ieee80211_input(ifp, m, ni, &rxi);
ieee80211_release_node(ic, ni);
-/* $OpenBSD: malo.c,v 1.82 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: malo.c,v 1.83 2008/07/21 18:43:19 damien Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
struct malo_rx_desc *desc;
struct malo_rx_data *data;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *mnew, *m;
uint32_t rxRdPtr, rxWrPtr;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, desc->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = desc->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: pgt.c,v 1.49 2008/07/01 11:44:12 claudio Exp $ */
+/* $OpenBSD: pgt.c,v 1.50 2008/07/21 18:43:19 damien Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
struct ether_header eh;
struct ifnet *ifp;
struct ieee80211_channel *chan;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct ieee80211com *ic;
struct pgt_rx_annex *pra;
bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN);
}
#endif
- ni->ni_rssi = rssi;
- ni->ni_rstamp = rstamp;
- ieee80211_input(ifp, m, ni, rssi, rstamp);
+ rxi.rxi_flags = 0;
+ ni->ni_rssi = rxi.rxi_rssi = rssi;
+ ni->ni_rstamp = rxi.rxi_tstamp = rstamp;
+ ieee80211_input(ifp, m, ni, &rxi);
/*
* The frame may have caused the node to be marked for
* reclamation (e.g. in response to a DEAUTH message)
-/* $OpenBSD: rt2560.c,v 1.36 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: rt2560.c,v 1.37 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *mnew, *m;
int hw, error;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, desc->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = desc->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: rt2661.c,v 1.41 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: rt2661.c,v 1.42 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2006
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *mnew, *m;
int error, rssi;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, desc->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = desc->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/*-
* Keep track of the average RSSI using an Exponential Moving
-/* $OpenBSD: rt2860.c,v 1.15 2008/06/08 19:34:14 jsg Exp $ */
+/* $OpenBSD: rt2860.c,v 1.16 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2007,2008
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *m, *mnew;
uint8_t ant, rssi;
m->m_pkthdr.len = m->m_len = letoh16(rxwi->len) & 0xfff;
wh = mtod(m, struct ieee80211_frame *);
- /* frame is decrypted by hardware */
- wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
+ rxi.rxi_flags = 0;
+ if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
+ /* frame is decrypted by hardware */
+ wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
+ }
/* HW may insert 2 padding bytes after 802.11 header */
if (rxd->flags & htole32(RT2860_RX_L2PAD)) {
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, rssi, 0);
+ rxi.rxi_rssi = rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: rtw.c,v 1.66 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: rtw.c,v 1.67 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */
/*-
void rtw_watchdog(struct ifnet *);
void rtw_next_scan(void *);
void rtw_recv_mgmt(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *, int);
struct ieee80211_node *rtw_node_alloc(struct ieee80211com *);
void rtw_node_free(struct ieee80211com *, struct ieee80211_node *);
void rtw_media_status(struct ifnet *, struct ifmediareq *);
struct rtw_rxsoft *rs;
struct rtw_rxdesc_blk *rdb;
struct mbuf *m;
-
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct ieee80211_frame *wh;
}
#endif /* NBPFILTER > 0 */
- ieee80211_input(&sc->sc_if, m, ni, rssi, htsftl);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = rssi;
+ rxi.rxi_tstamp = htsftl;
+ ieee80211_input(&sc->sc_if, m, ni, &rxi);
ieee80211_release_node(&sc->sc_ic, ni);
next:
rtw_rxdesc_init(rdb, rs, next, 0);
void
rtw_recv_mgmt(struct ieee80211com *ic, struct mbuf *m,
- struct ieee80211_node *ni, int subtype, int rssi, u_int32_t rstamp)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, int subtype)
{
struct rtw_softc *sc = (struct rtw_softc*)ic->ic_softc;
- (*sc->sc_mtbl.mt_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp);
+ (*sc->sc_mtbl.mt_recv_mgmt)(ic, m, ni, rxi, subtype);
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
if (ic->ic_opmode != IEEE80211_M_IBSS ||
ic->ic_state != IEEE80211_S_RUN)
return;
- rtw_ibss_merge(sc, ni, rstamp);
+ rtw_ibss_merge(sc, ni, rxi->rxi_tstamp);
break;
default:
break;
-/* $OpenBSD: rtwvar.h,v 1.23 2007/06/07 20:20:15 damien Exp $ */
+/* $OpenBSD: rtwvar.h,v 1.24 2008/07/21 18:43:19 damien Exp $ */
/* $NetBSD: rtwvar.h,v 1.10 2004/12/26 22:37:57 mycroft Exp $ */
/*-
enum ieee80211_state, int);
void (*mt_recv_mgmt)(struct ieee80211com *,
struct mbuf *, struct ieee80211_node *,
- int, int, u_int32_t);
+ struct ieee80211_rxinfo *, int);
struct ieee80211_node *(*mt_node_alloc)(struct ieee80211com *);
void (*mt_node_free)(struct ieee80211com *,
struct ieee80211_node *);
-/* $OpenBSD: if_ipw.c,v 1.72 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.73 2008/07/21 18:43:18 damien Exp $ */
/*-
* Copyright (c) 2004-2008
struct ifnet *ifp = &ic->ic_if;
struct mbuf *mnew, *m;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
int error;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the upper layer */
- ieee80211_input(ifp, m, ni, status->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = status->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
ieee80211_release_node(ic, ni);
}
-/* $OpenBSD: if_iwi.c,v 1.86 2007/11/17 19:09:16 damien Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.87 2008/07/21 18:43:18 damien Exp $ */
/*-
* Copyright (c) 2004-2006
struct ifnet *ifp = &ic->ic_if;
struct mbuf *mnew, *m;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
int error;
wh = mtod(m, struct ieee80211_frame *);
+ rxi.rxi_flags = 0;
if ((wh->i_fc[1] & IEEE80211_FC1_WEP) &&
ic->ic_opmode != IEEE80211_M_MONITOR) {
/*
m_adj(m, IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN);
m_adj(m, -IEEE80211_WEP_CRCLEN);
wh = mtod(m, struct ieee80211_frame *);
+
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
}
#if NBPFILTER > 0
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the upper layer */
- ieee80211_input(ifp, m, ni, frame->rssi_dbm, 0);
+ rxi.rxi_rssi = frame->rssi_dbm;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_iwn.c,v 1.20 2008/06/16 18:43:06 damien Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.21 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2007,2008
struct iwn_rx_ring *ring = &sc->rxq;
struct iwn_rbuf *rbuf;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *m, *mnew;
struct iwn_rx_stat *stat;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_wpi.c,v 1.61 2008/06/16 18:43:06 damien Exp $ */
+/* $OpenBSD: if_wpi.c,v 1.62 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2006, 2007
struct wpi_rx_tail *tail;
struct wpi_rbuf *rbuf;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *m, *mnew;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, stat->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = stat->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_atu.c,v 1.91 2007/11/27 16:22:13 martynas Exp $ */
+/* $OpenBSD: if_atu.c,v 1.92 2008/07/21 18:43:19 damien Exp $ */
/*
* Copyright (c) 2003, 2004
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
struct ifnet *ifp = &ic->ic_if;
struct atu_rx_hdr *h;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *m;
u_int32_t len;
}
#endif /* NBPFILTER > 0 */
+ rxi.rxi_flags = 0;
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
/*
* WEP is decrypted by hardware. Clear WEP bit
* header for ieee80211_input().
*/
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
}
- ieee80211_input(ifp, m, ni, h->rssi, UGETDW(h->rx_time));
+ rxi.rxi_rssi = h->rssi;
+ rxi.rxi_tstamp = UGETDW(h->rx_time);
+ ieee80211_input(ifp, m, ni, &rxi);
ieee80211_release_node(ic, ni);
done1:
-/* $OpenBSD: if_ral.c,v 1.103 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: if_ral.c,v 1.104 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
struct ifnet *ifp = &ic->ic_if;
const struct ural_rx_desc *desc;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *mnew, *m;
int s, len;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, desc->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = desc->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_rum.c,v 1.73 2008/06/29 00:43:11 deraadt Exp $ */
+/* $OpenBSD: if_rum.c,v 1.74 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
struct ifnet *ifp = &ic->ic_if;
const struct rum_rx_desc *desc;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *mnew, *m;
int s, len;
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the 802.11 layer */
- ieee80211_input(ifp, m, ni, desc->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = desc->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_uath.c,v 1.34 2008/06/08 20:43:31 yuo Exp $ */
+/* $OpenBSD: if_uath.c,v 1.35 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2006
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct uath_rx_desc *desc;
struct mbuf *mnew, *m;
data->buf = mtod(data->m, uint8_t *);
wh = mtod(m, struct ieee80211_frame *);
+ rxi.rxi_flags = 0;
if ((wh->i_fc[1] & IEEE80211_FC1_WEP) &&
ic->ic_opmode != IEEE80211_M_MONITOR) {
/*
m_adj(m, IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN);
m_adj(m, -IEEE80211_WEP_CRCLEN);
wh = mtod(m, struct ieee80211_frame *);
+
+ rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
}
#if NBPFILTER > 0
s = splnet();
ni = ieee80211_find_rxnode(ic, wh);
- ieee80211_input(ifp, m, ni, (int)betoh32(desc->rssi), 0);
+ rxi.rxi_rssi = (int)betoh32(desc->rssi);
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_upgt.c,v 1.35 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: if_upgt.c,v 1.36 2008/07/21 18:43:19 damien Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
struct ifnet *ifp = &ic->ic_if;
struct upgt_lmac_rx_desc *rxdesc;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
struct ieee80211_node *ni;
struct mbuf *m;
int s;
ni = ieee80211_find_rxnode(ic, wh);
/* push the frame up to the 802.11 stack */
- ieee80211_input(ifp, m, ni, rxdesc->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = rxdesc->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
-/* $OpenBSD: if_zyd.c,v 1.68 2008/05/27 00:11:11 jsg Exp $ */
+/* $OpenBSD: if_zyd.c,v 1.69 2008/07/21 18:43:19 damien Exp $ */
/*-
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_node *ni;
struct ieee80211_frame *wh;
+ struct ieee80211_rxinfo rxi;
const struct zyd_plcphdr *plcp;
const struct zyd_rx_stat *stat;
struct mbuf *m;
s = splnet();
wh = mtod(m, struct ieee80211_frame *);
ni = ieee80211_find_rxnode(ic, wh);
- ieee80211_input(ifp, m, ni, stat->rssi, 0);
+ rxi.rxi_flags = 0;
+ rxi.rxi_rssi = stat->rssi;
+ rxi.rxi_tstamp = 0; /* unused */
+ ieee80211_input(ifp, m, ni, &rxi);
/* node is no longer needed */
ieee80211_release_node(ic, ni);
/* $NetBSD: ieee80211_input.c,v 1.24 2004/05/31 11:12:24 dyoung Exp $ */
-/* $OpenBSD: ieee80211_input.c,v 1.80 2008/06/09 07:07:16 djm Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.81 2008/07/21 18:43:18 damien Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
int ieee80211_save_ie(const u_int8_t *, u_int8_t **);
void ieee80211_recv_pspoll(struct ieee80211com *, struct mbuf *);
void ieee80211_recv_probe_resp(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, u_int32_t, int);
+ struct ieee80211_node *, struct ieee80211_rxinfo *, int);
void ieee80211_recv_probe_req(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *);
void ieee80211_recv_auth(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *);
void ieee80211_recv_assoc_req(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, u_int32_t, int);
+ struct ieee80211_node *, struct ieee80211_rxinfo *, int);
void ieee80211_recv_assoc_resp(struct ieee80211com *, struct mbuf *,
struct ieee80211_node *, int);
void ieee80211_recv_deauth(struct ieee80211com *, struct mbuf *,
*/
void
ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
- int rssi, u_int32_t rstamp)
+ struct ieee80211_rxinfo *rxi)
{
struct ieee80211com *ic = (void *)ifp;
struct ieee80211_frame *wh;
goto out;
}
if (ic->ic_state != IEEE80211_S_SCAN) {
- ni->ni_rssi = rssi;
- ni->ni_rstamp = rstamp;
+ ni->ni_rssi = rxi->rxi_rssi;
+ ni->ni_rstamp = rxi->rxi_tstamp;
if (type == IEEE80211_FC0_TYPE_DATA &&
(wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS)) {
struct ieee80211_qosframe *qwh =
ic->ic_stats.is_rx_nowep++;
goto out;
}
+ } else if (!(rxi->rxi_flags & IEEE80211_RXI_HWDEC)) {
+ /* XXX */
}
- /*
- * XXX else: drivers should pass a flag to indicate if the
- * frame was successfully decrypted or not.
- */
#if NBPFILTER > 0
/* copy to listener after decrypt */
if (ic->ic_rawbpf)
ifp->if_xname,
ieee80211_mgt_subtype_name[subtype
>> IEEE80211_FC0_SUBTYPE_SHIFT],
- ether_sprintf(wh->i_addr2), rssi,
+ ether_sprintf(wh->i_addr2), rxi->rxi_rssi,
ieee80211_phymode_name[ieee80211_chan2mode(ic,
ic->ic_bss->ni_chan)]);
}
return;
}
#endif
- (*ic->ic_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp);
+ (*ic->ic_recv_mgmt)(ic, m, ni, rxi, subtype);
m_freem(m);
return;
{
/* check IE length */
if (frm[1] < 2) {
- IEEE80211_DPRINTF(("%s: invalid RSN/WPA2 IE;"
+ IEEE80211_DPRINTF(("%s: invalid RSN IE;"
" length %u, expecting at least 2\n", __func__, frm[1]));
ic->ic_stats.is_rx_elem_toosmall++;
return IEEE80211_STATUS_IE_INVALID;
*/
void
ieee80211_recv_probe_resp(struct ieee80211com *ic, struct mbuf *m0,
- struct ieee80211_node *ni, int rssi, u_int32_t rstamp, int isprobe)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, int isprobe)
{
const struct ieee80211_frame *wh;
const u_int8_t *frm, *efrm;
* potential better one.
*/
if ((ni = ieee80211_find_node_for_beacon(ic, wh->i_addr2,
- &ic->ic_channels[chan], ssid, rssi)) != NULL)
+ &ic->ic_channels[chan], ssid, rxi->rxi_rssi)) != NULL)
return;
#ifdef IEEE80211_DEBUG
memcpy(ni->ni_essid, &ssid[2], ssid[1]);
}
IEEE80211_ADDR_COPY(ni->ni_bssid, wh->i_addr3);
- ni->ni_rssi = rssi;
- ni->ni_rstamp = rstamp;
+ ni->ni_rssi = rxi->rxi_rssi;
+ ni->ni_rstamp = rxi->rxi_tstamp;
memcpy(ni->ni_tstamp, tstamp, sizeof(ni->ni_tstamp));
ni->ni_intval = bintval;
ni->ni_capinfo = capinfo;
*/
void
ieee80211_recv_probe_req(struct ieee80211com *ic, struct mbuf *m0,
- struct ieee80211_node *ni, int rssi, u_int32_t rstamp)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi)
{
const struct ieee80211_frame *wh;
const u_int8_t *frm, *efrm;
IEEE80211_DPRINTF(("%s: new probe req from %s\n",
__func__, ether_sprintf((u_int8_t *)wh->i_addr2)));
}
- ni->ni_rssi = rssi;
- ni->ni_rstamp = rstamp;
+ ni->ni_rssi = rxi->rxi_rssi;
+ ni->ni_rstamp = rxi->rxi_tstamp;
rate = ieee80211_setup_rates(ic, ni, rates, xrates,
IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO |
IEEE80211_F_DODEL);
*/
void
ieee80211_recv_auth(struct ieee80211com *ic, struct mbuf *m0,
- struct ieee80211_node *ni, int rssi, u_int32_t rstamp)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi)
{
const struct ieee80211_frame *wh;
const u_int8_t *frm, *efrm;
}
return;
}
- ieee80211_auth_open(ic, wh, ni, rssi, rstamp, seq, status);
+ ieee80211_auth_open(ic, wh, ni, rxi, seq, status);
}
/*-
*/
void
ieee80211_recv_assoc_req(struct ieee80211com *ic, struct mbuf *m0,
- struct ieee80211_node *ni, int rssi, u_int32_t rstamp, int reassoc)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, int reassoc)
{
const struct ieee80211_frame *wh;
const u_int8_t *frm, *efrm;
} else
ni->ni_rsnprotos = IEEE80211_PROTO_NONE;
- ni->ni_rssi = rssi;
- ni->ni_rstamp = rstamp;
+ ni->ni_rssi = rxi->rxi_rssi;
+ ni->ni_rstamp = rxi->rxi_tstamp;
ni->ni_intval = bintval;
ni->ni_capinfo = capinfo;
ni->ni_chan = ic->ic_bss->ni_chan;
void
ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
- struct ieee80211_node *ni, int subtype, int rssi, u_int32_t rstamp)
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, int subtype)
{
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_BEACON:
- ieee80211_recv_probe_resp(ic, m0, ni, rssi, rstamp, 0);
+ ieee80211_recv_probe_resp(ic, m0, ni, rxi, 0);
break;
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
- ieee80211_recv_probe_resp(ic, m0, ni, rssi, rstamp, 1);
+ ieee80211_recv_probe_resp(ic, m0, ni, rxi, 1);
break;
case IEEE80211_FC0_SUBTYPE_PROBE_REQ:
- ieee80211_recv_probe_req(ic, m0, ni, rssi, rstamp);
+ ieee80211_recv_probe_req(ic, m0, ni, rxi);
break;
case IEEE80211_FC0_SUBTYPE_AUTH:
- ieee80211_recv_auth(ic, m0, ni, rssi, rstamp);
+ ieee80211_recv_auth(ic, m0, ni, rxi);
break;
case IEEE80211_FC0_SUBTYPE_ASSOC_REQ:
- ieee80211_recv_assoc_req(ic, m0, ni, rssi, rstamp, 0);
+ ieee80211_recv_assoc_req(ic, m0, ni, rxi, 0);
break;
case IEEE80211_FC0_SUBTYPE_REASSOC_REQ:
- ieee80211_recv_assoc_req(ic, m0, ni, rssi, rstamp, 1);
+ ieee80211_recv_assoc_req(ic, m0, ni, rxi, 1);
break;
case IEEE80211_FC0_SUBTYPE_ASSOC_RESP:
ieee80211_recv_assoc_resp(ic, m0, ni, 0);
-/* $OpenBSD: ieee80211_proto.c,v 1.24 2008/06/09 07:07:16 djm Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.25 2008/07/21 18:43:18 damien Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
void
ieee80211_auth_open(struct ieee80211com *ic, const struct ieee80211_frame *wh,
- struct ieee80211_node *ni, int rssi, u_int32_t rstamp, u_int16_t seq,
+ struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, u_int16_t seq,
u_int16_t status)
{
struct ifnet *ifp = &ic->ic_if;
return;
}
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_bss->ni_bssid);
- ni->ni_rssi = rssi;
- ni->ni_rstamp = rstamp;
+ ni->ni_rssi = rxi->rxi_rssi;
+ ni->ni_rstamp = rxi->rxi_tstamp;
ni->ni_chan = ic->ic_bss->ni_chan;
}
IEEE80211_SEND_MGMT(ic, ni,
-/* $OpenBSD: ieee80211_proto.h,v 1.29 2008/04/21 19:37:18 damien Exp $ */
+/* $OpenBSD: ieee80211_proto.h,v 1.30 2008/07/21 18:43:18 damien Exp $ */
/* $NetBSD: ieee80211_proto.h,v 1.3 2003/10/13 04:23:56 dyoung Exp $ */
/*-
extern void ieee80211_proto_detach(struct ifnet *);
struct ieee80211_node;
+struct ieee80211_rxinfo;
extern u_int ieee80211_get_hdrlen(const void *);
extern void ieee80211_input(struct ifnet *, struct mbuf *,
- struct ieee80211_node *, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *);
extern int ieee80211_output(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
extern void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, int, u_int32_t);
+ struct ieee80211_node *, struct ieee80211_rxinfo *, int);
extern int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *,
int, int);
extern void ieee80211_recv_eapol(struct ieee80211com *, struct mbuf *,
extern void ieee80211_reset_erp(struct ieee80211com *);
extern void ieee80211_set_shortslottime(struct ieee80211com *, int);
extern void ieee80211_auth_open(struct ieee80211com *,
- const struct ieee80211_frame *, struct ieee80211_node *, int,
- u_int32_t, u_int16_t, u_int16_t);
+ const struct ieee80211_frame *, struct ieee80211_node *,
+ struct ieee80211_rxinfo *rs, u_int16_t, u_int16_t);
extern void ieee80211_gtk_rekey_timeout(void *);
extern void ieee80211_setkeys(struct ieee80211com *);
extern void ieee80211_setkeysdone(struct ieee80211com *);
-/* $OpenBSD: ieee80211_var.h,v 1.38 2008/04/16 18:32:15 damien Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.39 2008/07/21 18:43:18 damien Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
u_int16_t rsn_caps;
};
+struct ieee80211_rxinfo {
+ u_int32_t rxi_flags;
+ u_int32_t rxi_tstamp;
+ int rxi_rssi;
+};
+#define IEEE80211_RXI_HWDEC 0x00000001
+
#define IEEE80211_PS_SLEEP 0x1 /* STA is in power saving mode */
#define IEEE80211_PS_MAX_QUEUE 50 /* maximum saved packets */
LIST_ENTRY(ieee80211com) ic_list; /* chain of all ieee80211com */
void (*ic_recv_mgmt)(struct ieee80211com *,
struct mbuf *, struct ieee80211_node *,
- int, int, u_int32_t);
+ struct ieee80211_rxinfo *, int);
int (*ic_send_mgmt)(struct ieee80211com *,
struct ieee80211_node *, int, int);
void (*ic_recv_eapol)(struct ieee80211com *,