Deleted Added
full compact
ieee80211_freebsd.h (170360) ieee80211_freebsd.h (170530)
1/*-
2 * Copyright (c) 2003-2007 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
1/*-
2 * Copyright (c) 2003-2007 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * $FreeBSD: head/sys/net80211/ieee80211_freebsd.h 170360 2007-06-06 04:56:04Z sam $
25 * $FreeBSD: head/sys/net80211/ieee80211_freebsd.h 170530 2007-06-11 03:36:55Z sam $
26 */
27#ifndef _NET80211_IEEE80211_FREEBSD_H_
28#define _NET80211_IEEE80211_FREEBSD_H_
29
30#ifdef _KERNEL
31/*
26 */
27#ifndef _NET80211_IEEE80211_FREEBSD_H_
28#define _NET80211_IEEE80211_FREEBSD_H_
29
30#ifdef _KERNEL
31/*
32 * Common state locking definitions.
33 */
34typedef struct mtx ieee80211_com_lock_t;
35#define IEEE80211_LOCK_INIT(_ic, _name) \
36 mtx_init(&(_ic)->ic_comlock, _name, "802.11 com lock", MTX_DEF)
37#define IEEE80211_LOCK_DESTROY(_ic) mtx_destroy(&(_ic)->ic_comlock)
38#define IEEE80211_LOCK(_ic) mtx_lock(&(_ic)->ic_comlock)
39#define IEEE80211_UNLOCK(_ic) mtx_unlock(&(_ic)->ic_comlock)
40#define IEEE80211_LOCK_ASSERT(_ic) \
41 mtx_assert(&(_ic)->ic_comlock, MA_OWNED)
42
43/*
32 * Beacon locking definitions.
33 */
34typedef struct mtx ieee80211_beacon_lock_t;
35#define IEEE80211_BEACON_LOCK_INIT(_ic, _name) \
36 mtx_init(&(_ic)->ic_beaconlock, _name, "802.11 beacon lock", MTX_DEF)
37#define IEEE80211_BEACON_LOCK_DESTROY(_ic) mtx_destroy(&(_ic)->ic_beaconlock)
38#define IEEE80211_BEACON_LOCK(_ic) mtx_lock(&(_ic)->ic_beaconlock)
39#define IEEE80211_BEACON_UNLOCK(_ic) mtx_unlock(&(_ic)->ic_beaconlock)

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

55#define IEEE80211_NODE_LOCK_ASSERT(_nt) \
56 mtx_assert(&(_nt)->nt_nodelock, MA_OWNED)
57
58/*
59 * Node table scangen locking definitions.
60 */
61typedef struct mtx ieee80211_scan_lock_t;
62#define IEEE80211_SCAN_LOCK_INIT(_nt, _name) \
44 * Beacon locking definitions.
45 */
46typedef struct mtx ieee80211_beacon_lock_t;
47#define IEEE80211_BEACON_LOCK_INIT(_ic, _name) \
48 mtx_init(&(_ic)->ic_beaconlock, _name, "802.11 beacon lock", MTX_DEF)
49#define IEEE80211_BEACON_LOCK_DESTROY(_ic) mtx_destroy(&(_ic)->ic_beaconlock)
50#define IEEE80211_BEACON_LOCK(_ic) mtx_lock(&(_ic)->ic_beaconlock)
51#define IEEE80211_BEACON_UNLOCK(_ic) mtx_unlock(&(_ic)->ic_beaconlock)

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

67#define IEEE80211_NODE_LOCK_ASSERT(_nt) \
68 mtx_assert(&(_nt)->nt_nodelock, MA_OWNED)
69
70/*
71 * Node table scangen locking definitions.
72 */
73typedef struct mtx ieee80211_scan_lock_t;
74#define IEEE80211_SCAN_LOCK_INIT(_nt, _name) \
63 mtx_init(&(_nt)->nt_scanlock, _name, "802.11 scangen", MTX_DEF)
75 mtx_init(&(_nt)->nt_scanlock, _name, "802.11 node scangen", MTX_DEF)
64#define IEEE80211_SCAN_LOCK_DESTROY(_nt) mtx_destroy(&(_nt)->nt_scanlock)
65#define IEEE80211_SCAN_LOCK(_nt) mtx_lock(&(_nt)->nt_scanlock)
66#define IEEE80211_SCAN_UNLOCK(_nt) mtx_unlock(&(_nt)->nt_scanlock)
67#define IEEE80211_SCAN_LOCK_ASSERT(_nt) \
68 mtx_assert(&(_nt)->nt_scanlock, MA_OWNED)
69
70/*
71 * Per-node power-save queue definitions.

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

160 atomic_subtract_int(&(_ni)->ni_refcnt, 1)
161struct ieee80211_node;
162int ieee80211_node_dectestref(struct ieee80211_node *ni);
163#define ieee80211_node_refcnt(_ni) (_ni)->ni_refcnt
164
165struct ifqueue;
166void ieee80211_drain_ifq(struct ifqueue *);
167
76#define IEEE80211_SCAN_LOCK_DESTROY(_nt) mtx_destroy(&(_nt)->nt_scanlock)
77#define IEEE80211_SCAN_LOCK(_nt) mtx_lock(&(_nt)->nt_scanlock)
78#define IEEE80211_SCAN_UNLOCK(_nt) mtx_unlock(&(_nt)->nt_scanlock)
79#define IEEE80211_SCAN_LOCK_ASSERT(_nt) \
80 mtx_assert(&(_nt)->nt_scanlock, MA_OWNED)
81
82/*
83 * Per-node power-save queue definitions.

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

172 atomic_subtract_int(&(_ni)->ni_refcnt, 1)
173struct ieee80211_node;
174int ieee80211_node_dectestref(struct ieee80211_node *ni);
175#define ieee80211_node_refcnt(_ni) (_ni)->ni_refcnt
176
177struct ifqueue;
178void ieee80211_drain_ifq(struct ifqueue *);
179
168struct mbuf *ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen);
180#define msecs_to_ticks(ms) ((ms)*1000/hz)
181#define time_after(a,b) ((long)(b) - (long)(a) < 0)
182#define time_before(a,b) time_after(b,a)
183#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0)
184#define time_before_eq(a,b) time_after_eq(b,a)
185
186struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
187/* tx path usage */
169#define M_LINK0 M_PROTO1 /* WEP requested */
170#define M_PWR_SAV M_PROTO4 /* bypass PS handling */
171#define M_MORE_DATA M_PROTO5 /* more data frames to follow */
188#define M_LINK0 M_PROTO1 /* WEP requested */
189#define M_PWR_SAV M_PROTO4 /* bypass PS handling */
190#define M_MORE_DATA M_PROTO5 /* more data frames to follow */
191#define M_FF 0x20000 /* fast frame */
192#define M_TXCB 0x40000 /* do tx complete callback */
193/* rx path usage */
194#define M_AMPDU M_PROTO1 /* A-MPDU processing done */
172/*
173 * Encode WME access control bits in the PROTO flags.
174 * This is safe since it's passed directly in to the
175 * driver and there's no chance someone else will clobber
176 * them on us.
177 */
178#define M_WME_AC_MASK (M_PROTO2|M_PROTO3)
179/* XXX 5 is wrong if M_PROTO* are redefined */

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

188 * Mbufs on the power save queue are tagged with an age and
189 * timed out. We reuse the hardware checksum field in the
190 * mbuf packet header to store this data.
191 */
192#define M_AGE_SET(m,v) (m->m_pkthdr.csum_data = v)
193#define M_AGE_GET(m) (m->m_pkthdr.csum_data)
194#define M_AGE_SUB(m,adj) (m->m_pkthdr.csum_data -= adj)
195
195/*
196 * Encode WME access control bits in the PROTO flags.
197 * This is safe since it's passed directly in to the
198 * driver and there's no chance someone else will clobber
199 * them on us.
200 */
201#define M_WME_AC_MASK (M_PROTO2|M_PROTO3)
202/* XXX 5 is wrong if M_PROTO* are redefined */

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

211 * Mbufs on the power save queue are tagged with an age and
212 * timed out. We reuse the hardware checksum field in the
213 * mbuf packet header to store this data.
214 */
215#define M_AGE_SET(m,v) (m->m_pkthdr.csum_data = v)
216#define M_AGE_GET(m) (m->m_pkthdr.csum_data)
217#define M_AGE_SUB(m,adj) (m->m_pkthdr.csum_data -= adj)
218
219#define MTAG_ABI_NET80211 1132948340 /* net80211 ABI */
220
221struct ieee80211_cb {
222 void (*func)(struct ieee80211_node *, void *, int status);
223 void *arg;
224};
225#define NET80211_TAG_CALLBACK 0 /* xmit complete callback */
226int ieee80211_add_callback(struct mbuf *m,
227 void (*func)(struct ieee80211_node *, void *, int), void *arg);
228void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int);
229
196void get_random_bytes(void *, size_t);
197
198struct ieee80211com;
199
200void ieee80211_sysctl_attach(struct ieee80211com *);
201void ieee80211_sysctl_detach(struct ieee80211com *);
202
203void ieee80211_load_module(const char *);
230void get_random_bytes(void *, size_t);
231
232struct ieee80211com;
233
234void ieee80211_sysctl_attach(struct ieee80211com *);
235void ieee80211_sysctl_detach(struct ieee80211com *);
236
237void ieee80211_load_module(const char *);
238
239#define IEEE80211_CRYPTO_MODULE(name, version) \
240static int \
241name##_modevent(module_t mod, int type, void *unused) \
242{ \
243 switch (type) { \
244 case MOD_LOAD: \
245 ieee80211_crypto_register(&name); \
246 return 0; \
247 case MOD_UNLOAD: \
248 case MOD_QUIESCE: \
249 if (nrefs) { \
250 printf("wlan_##name: still in use (%u dynamic refs)\n",\
251 nrefs); \
252 return EBUSY; \
253 } \
254 if (type == MOD_UNLOAD) \
255 ieee80211_crypto_unregister(&name); \
256 return 0; \
257 } \
258 return EINVAL; \
259} \
260static moduledata_t name##_mod = { \
261 "wlan_" #name, \
262 name##_modevent, \
263 0 \
264}; \
265DECLARE_MODULE(wlan_##name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\
266MODULE_VERSION(wlan_##name, version); \
267MODULE_DEPEND(wlan_##name, wlan, 1, 1, 1)
204#endif /* _KERNEL */
205
206/* XXX this stuff belongs elsewhere */
207/*
208 * Message formats for messages from the net80211 layer to user
209 * applications via the routing socket. These messages are appended
210 * to an if_announcemsghdr structure.
211 */

--- 68 unchanged lines hidden ---
268#endif /* _KERNEL */
269
270/* XXX this stuff belongs elsewhere */
271/*
272 * Message formats for messages from the net80211 layer to user
273 * applications via the routing socket. These messages are appended
274 * to an if_announcemsghdr structure.
275 */

--- 68 unchanged lines hidden ---