xref: /freebsd/sys/net80211/ieee80211_alq.h (revision 2b668041d1d6721bf256c0fc6e6bb6bc2599c593)
1f4e2f6c9SAdrian Chadd /*-
2f4e2f6c9SAdrian Chadd  * Copyright (c) 2011 Adrian Chadd, Xenion Lty Ltd
3f4e2f6c9SAdrian Chadd  * All rights reserved.
4f4e2f6c9SAdrian Chadd  *
5f4e2f6c9SAdrian Chadd  * Redistribution and use in source and binary forms, with or without
6f4e2f6c9SAdrian Chadd  * modification, are permitted provided that the following conditions
7f4e2f6c9SAdrian Chadd  * are met:
8f4e2f6c9SAdrian Chadd  * 1. Redistributions of source code must retain the above copyright
9f4e2f6c9SAdrian Chadd  *    notice, this list of conditions and the following disclaimer.
10f4e2f6c9SAdrian Chadd  * 2. Redistributions in binary form must reproduce the above copyright
11f4e2f6c9SAdrian Chadd  *    notice, this list of conditions and the following disclaimer in the
12f4e2f6c9SAdrian Chadd  *    documentation and/or other materials provided with the distribution.
13f4e2f6c9SAdrian Chadd  *
14f4e2f6c9SAdrian Chadd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15f4e2f6c9SAdrian Chadd  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16f4e2f6c9SAdrian Chadd  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17f4e2f6c9SAdrian Chadd  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18f4e2f6c9SAdrian Chadd  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19f4e2f6c9SAdrian Chadd  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20f4e2f6c9SAdrian Chadd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21f4e2f6c9SAdrian Chadd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22f4e2f6c9SAdrian Chadd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23f4e2f6c9SAdrian Chadd  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24f4e2f6c9SAdrian Chadd  *
25f4e2f6c9SAdrian Chadd  * $FreeBSD$
26f4e2f6c9SAdrian Chadd  */
27f4e2f6c9SAdrian Chadd #ifndef	__IEEE80211_ALQ_H__
28f4e2f6c9SAdrian Chadd #define	__IEEE80211_ALQ_H__
29f4e2f6c9SAdrian Chadd 
30*2b668041SAdrian Chadd #define	IEEE80211_ALQ_MAX_PAYLOAD	1024
31f4e2f6c9SAdrian Chadd 
32f4e2f6c9SAdrian Chadd /*
33f4e2f6c9SAdrian Chadd  * timestamp
34f4e2f6c9SAdrian Chadd  * wlan interface
35f4e2f6c9SAdrian Chadd  * operation
36f4e2f6c9SAdrian Chadd  * sub-operation
37f4e2f6c9SAdrian Chadd  * rest of structure - operation specific
38f4e2f6c9SAdrian Chadd  */
39*2b668041SAdrian Chadd 
40*2b668041SAdrian Chadd #define	IEEE80211_ALQ_SRC_NET80211	0x0001
41*2b668041SAdrian Chadd /* Drivers define their own numbers above 0xff */
42*2b668041SAdrian Chadd 
43f4e2f6c9SAdrian Chadd struct ieee80211_alq_rec {
44*2b668041SAdrian Chadd 	uint64_t	r_timestamp;	/* XXX may wrap! */
45cf42b1ccSAdrian Chadd 	uint32_t	r_threadid;	/* current thread id */
46f4e2f6c9SAdrian Chadd 	uint16_t	r_wlan;		/* wlan interface number */
47*2b668041SAdrian Chadd 	uint16_t	r_src;		/* source - driver, net80211 */
48*2b668041SAdrian Chadd 	uint32_t	r_flags;	/* flags */
49*2b668041SAdrian Chadd 	uint32_t	r_op;		/* top-level operation id */
50*2b668041SAdrian Chadd 	uint32_t	r_len;		/* length of hdr + payload */
51*2b668041SAdrian Chadd 	/* Operation payload follows here */
52f4e2f6c9SAdrian Chadd };
53f4e2f6c9SAdrian Chadd 
54f4e2f6c9SAdrian Chadd /* General logging function */
55*2b668041SAdrian Chadd extern	int ieee80211_alq_log(struct ieee80211com *ic,
56*2b668041SAdrian Chadd 	    struct ieee80211vap *vap, uint32_t op, uint32_t flags,
57*2b668041SAdrian Chadd 	    uint16_t srcid, const uint8_t *src, size_t len);
58f4e2f6c9SAdrian Chadd 
59f4e2f6c9SAdrian Chadd #endif	/* __IEEE80211_ALQ_H__ */
60