Deleted Added
full compact
ieee80211_input.c (218927) ieee80211_input.c (220445)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_input.c 218927 2011-02-21 19:59:43Z bschmidt $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_input.c 220445 2011-04-08 09:20:45Z adrian $");
29
30#include "opt_wlan.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/mbuf.h>
35#include <sys/malloc.h>
36#include <sys/endian.h>

--- 15 unchanged lines hidden (view full) ---

52
53#include <net/bpf.h>
54
55#ifdef INET
56#include <netinet/in.h>
57#include <net/ethernet.h>
58#endif
59
29
30#include "opt_wlan.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/mbuf.h>
35#include <sys/malloc.h>
36#include <sys/endian.h>

--- 15 unchanged lines hidden (view full) ---

52
53#include <net/bpf.h>
54
55#ifdef INET
56#include <netinet/in.h>
57#include <net/ethernet.h>
58#endif
59
60static void
61ieee80211_process_mimo(struct ieee80211_node *ni, struct ieee80211_rx_stats *rx)
62{
63 int i;
64
65 /* Verify the required MIMO bits are set */
66 if ((rx->r_flags & (IEEE80211_R_C_CHAIN | IEEE80211_R_C_NF | IEEE80211_R_C_RSSI)) !=
67 (IEEE80211_R_C_CHAIN | IEEE80211_R_C_NF | IEEE80211_R_C_RSSI))
68 return;
69
70 /* XXX This assumes the MIMO radios have both ctl and ext chains */
71 for (i = 0; i < MIN(rx->c_chain, IEEE80211_MAX_CHAINS); i++) {
72 IEEE80211_RSSI_LPF(ni->ni_mimo_rssi_ctl[i], rx->c_rssi_ctl[i]);
73 IEEE80211_RSSI_LPF(ni->ni_mimo_rssi_ext[i], rx->c_rssi_ext[i]);
74 }
75
76 /* XXX This also assumes the MIMO radios have both ctl and ext chains */
77 for(i = 0; i < MIN(rx->c_chain, IEEE80211_MAX_CHAINS); i++) {
78 ni->ni_mimo_noise_ctl[i] = rx->c_nf_ctl[i];
79 ni->ni_mimo_noise_ext[i] = rx->c_nf_ext[i];
80 }
81 ni->ni_mimo_chains = rx->c_chain;
82}
83
60int
84int
85ieee80211_input_mimo(struct ieee80211_node *ni, struct mbuf *m,
86 struct ieee80211_rx_stats *rx)
87{
88 /* XXX should assert IEEE80211_R_NF and IEEE80211_R_RSSI are set */
89 ieee80211_process_mimo(ni, rx);
90 return ieee80211_input(ni, m, rx->rssi, rx->nf);
91}
92
93int
61ieee80211_input_all(struct ieee80211com *ic, struct mbuf *m, int rssi, int nf)
62{
94ieee80211_input_all(struct ieee80211com *ic, struct mbuf *m, int rssi, int nf)
95{
96 struct ieee80211_rx_stats rx;
97
98 rx.r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI;
99 rx.nf = nf;
100 rx.rssi = rssi;
101 return ieee80211_input_mimo_all(ic, m, &rx);
102}
103
104int
105ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m,
106 struct ieee80211_rx_stats *rx)
107{
63 struct ieee80211vap *vap;
64 int type = -1;
65
66 m->m_flags |= M_BCAST; /* NB: mark for bpf tap'ing */
67
68 /* XXX locking */
69 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
70 struct ieee80211_node *ni;

--- 20 unchanged lines hidden (view full) ---

91 /* XXX stat+msg */
92 continue;
93 }
94 } else {
95 mcopy = m;
96 m = NULL;
97 }
98 ni = ieee80211_ref_node(vap->iv_bss);
108 struct ieee80211vap *vap;
109 int type = -1;
110
111 m->m_flags |= M_BCAST; /* NB: mark for bpf tap'ing */
112
113 /* XXX locking */
114 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
115 struct ieee80211_node *ni;

--- 20 unchanged lines hidden (view full) ---

136 /* XXX stat+msg */
137 continue;
138 }
139 } else {
140 mcopy = m;
141 m = NULL;
142 }
143 ni = ieee80211_ref_node(vap->iv_bss);
99 type = ieee80211_input(ni, mcopy, rssi, nf);
144 type = ieee80211_input_mimo(ni, mcopy, rx);
100 ieee80211_free_node(ni);
101 }
102 if (m != NULL) /* no vaps, reclaim mbuf */
103 m_freem(m);
104 return type;
105}
106
107/*

--- 742 unchanged lines hidden ---
145 ieee80211_free_node(ni);
146 }
147 if (m != NULL) /* no vaps, reclaim mbuf */
148 m_freem(m);
149 return type;
150}
151
152/*

--- 742 unchanged lines hidden ---