Deleted Added
full compact
ieee80211_freebsd.h (184286) ieee80211_freebsd.h (184288)
1/*-
2 * Copyright (c) 2003-2008 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-2008 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 184286 2008-10-26 00:55:38Z sam $
25 * $FreeBSD: head/sys/net80211/ieee80211_freebsd.h 184288 2008-10-26 01:04:46Z sam $
26 */
27#ifndef _NET80211_IEEE80211_FREEBSD_H_
28#define _NET80211_IEEE80211_FREEBSD_H_
29
30#ifdef _KERNEL
31#include <sys/param.h>
32#include <sys/lock.h>
33#include <sys/mutex.h>

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

107 (_ifq)->ifq_head = (_m); \
108 } \
109 M_AGE_SET(_m, _age); \
110 (_ifq)->ifq_tail = (_m); \
111 (_qlen) = ++(_ifq)->ifq_len; \
112} while (0)
113
114/*
26 */
27#ifndef _NET80211_IEEE80211_FREEBSD_H_
28#define _NET80211_IEEE80211_FREEBSD_H_
29
30#ifdef _KERNEL
31#include <sys/param.h>
32#include <sys/lock.h>
33#include <sys/mutex.h>

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

107 (_ifq)->ifq_head = (_m); \
108 } \
109 M_AGE_SET(_m, _age); \
110 (_ifq)->ifq_tail = (_m); \
111 (_qlen) = ++(_ifq)->ifq_len; \
112} while (0)
113
114/*
115 * Per-node power-save queue definitions.
115 * Power-save queue definitions.
116 */
116 */
117#define IEEE80211_NODE_SAVEQ_INIT(_ni, _name) do { \
118 mtx_init(&(_ni)->ni_savedq.ifq_mtx, _name, "802.11 ps queue", MTX_DEF);\
119 (_ni)->ni_savedq.ifq_maxlen = IEEE80211_PS_MAX_QUEUE; \
120} while (0)
121#define IEEE80211_NODE_SAVEQ_DESTROY(_ni) \
122 mtx_destroy(&(_ni)->ni_savedq.ifq_mtx)
123#define IEEE80211_NODE_SAVEQ_QLEN(_ni) \
124 _IF_QLEN(&(_ni)->ni_savedq)
125#define IEEE80211_NODE_SAVEQ_LOCK(_ni) do { \
126 IF_LOCK(&(_ni)->ni_savedq); \
127} while (0)
128#define IEEE80211_NODE_SAVEQ_UNLOCK(_ni) do { \
129 IF_UNLOCK(&(_ni)->ni_savedq); \
130} while (0)
131#define IEEE80211_NODE_SAVEQ_DEQUEUE(_ni, _m, _qlen) do { \
132 IEEE80211_NODE_SAVEQ_LOCK(_ni); \
133 _IF_DEQUEUE(&(_ni)->ni_savedq, _m); \
134 (_qlen) = IEEE80211_NODE_SAVEQ_QLEN(_ni); \
135 IEEE80211_NODE_SAVEQ_UNLOCK(_ni); \
136} while (0)
137#define IEEE80211_NODE_SAVEQ_DRAIN(_ni, _qlen) do { \
138 IEEE80211_NODE_SAVEQ_LOCK(_ni); \
139 (_qlen) = IEEE80211_NODE_SAVEQ_QLEN(_ni); \
140 _IF_DRAIN(&(_ni)->ni_savedq); \
141 IEEE80211_NODE_SAVEQ_UNLOCK(_ni); \
142} while (0)
143/* XXX could be optimized */
144#define _IEEE80211_NODE_SAVEQ_DEQUEUE_HEAD(_ni, _m) do { \
145 _IF_DEQUEUE(&(_ni)->ni_savedq, m); \
146} while (0)
147#define _IEEE80211_NODE_SAVEQ_ENQUEUE(_ni, _m, _qlen, _age) do {\
148 _AGEQ_ENQUEUE(&ni->ni_savedq, _m, _qlen, _age); \
149} while (0)
117typedef struct mtx ieee80211_psq_lock_t;
118#define IEEE80211_PSQ_INIT(_psq, _name) \
119 mtx_init(&(_psq)->psq_lock, _name, "802.11 ps q", MTX_DEF);
120#define IEEE80211_PSQ_DESTROY(_psq) mtx_destroy(&(_psq)->psq_lock)
121#define IEEE80211_PSQ_LOCK(_psq) mtx_lock(&(_psq)->psq_lock)
122#define IEEE80211_PSQ_UNLOCK(_psq) mtx_unlock(&(_psq)->psq_lock)
150
151#ifndef IF_PREPEND_LIST
152#define _IF_PREPEND_LIST(ifq, mhead, mtail, mcount) do { \
153 (mtail)->m_nextpkt = (ifq)->ifq_head; \
154 if ((ifq)->ifq_tail == NULL) \
155 (ifq)->ifq_tail = (mtail); \
156 (ifq)->ifq_head = (mhead); \
157 (ifq)->ifq_len += (mcount); \

--- 392 unchanged lines hidden ---
123
124#ifndef IF_PREPEND_LIST
125#define _IF_PREPEND_LIST(ifq, mhead, mtail, mcount) do { \
126 (mtail)->m_nextpkt = (ifq)->ifq_head; \
127 if ((ifq)->ifq_tail == NULL) \
128 (ifq)->ifq_tail = (mtail); \
129 (ifq)->ifq_head = (mhead); \
130 (ifq)->ifq_len += (mcount); \

--- 392 unchanged lines hidden ---