xref: /freebsd/sys/net80211/ieee80211_alq.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f4e2f6c9SAdrian Chadd /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3fe267a55SPedro F. Giffuni  *
4f4e2f6c9SAdrian Chadd  * Copyright (c) 2011 Adrian Chadd, Xenion Lty Ltd
5f4e2f6c9SAdrian Chadd  * All rights reserved.
6f4e2f6c9SAdrian Chadd  *
7f4e2f6c9SAdrian Chadd  * Redistribution and use in source and binary forms, with or without
8f4e2f6c9SAdrian Chadd  * modification, are permitted provided that the following conditions
9f4e2f6c9SAdrian Chadd  * are met:
10f4e2f6c9SAdrian Chadd  * 1. Redistributions of source code must retain the above copyright
11f4e2f6c9SAdrian Chadd  *    notice, this list of conditions and the following disclaimer.
12f4e2f6c9SAdrian Chadd  * 2. Redistributions in binary form must reproduce the above copyright
13f4e2f6c9SAdrian Chadd  *    notice, this list of conditions and the following disclaimer in the
14f4e2f6c9SAdrian Chadd  *    documentation and/or other materials provided with the distribution.
15f4e2f6c9SAdrian Chadd  *
16f4e2f6c9SAdrian Chadd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17f4e2f6c9SAdrian Chadd  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18f4e2f6c9SAdrian Chadd  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19f4e2f6c9SAdrian Chadd  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20f4e2f6c9SAdrian Chadd  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21f4e2f6c9SAdrian Chadd  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22f4e2f6c9SAdrian Chadd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23f4e2f6c9SAdrian Chadd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24f4e2f6c9SAdrian Chadd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25f4e2f6c9SAdrian Chadd  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26f4e2f6c9SAdrian Chadd  */
27f4e2f6c9SAdrian Chadd #ifndef	__IEEE80211_ALQ_H__
28f4e2f6c9SAdrian Chadd #define	__IEEE80211_ALQ_H__
29f4e2f6c9SAdrian Chadd 
302b668041SAdrian 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  */
392b668041SAdrian Chadd 
402b668041SAdrian Chadd #define	IEEE80211_ALQ_SRC_NET80211	0x0001
412b668041SAdrian Chadd /* Drivers define their own numbers above 0xff */
422b668041SAdrian Chadd 
43f4e2f6c9SAdrian Chadd struct ieee80211_alq_rec {
442b668041SAdrian 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 */
472b668041SAdrian Chadd 	uint16_t	r_src;		/* source - driver, net80211 */
482b668041SAdrian Chadd 	uint32_t	r_flags;	/* flags */
492b668041SAdrian Chadd 	uint32_t	r_op;		/* top-level operation id */
502b668041SAdrian Chadd 	uint32_t	r_len;		/* length of hdr + payload */
512b668041SAdrian Chadd 	/* Operation payload follows here */
52f4e2f6c9SAdrian Chadd };
53f4e2f6c9SAdrian Chadd 
54f4e2f6c9SAdrian Chadd /* General logging function */
552b668041SAdrian Chadd extern	int ieee80211_alq_log(struct ieee80211com *ic,
562b668041SAdrian Chadd 	    struct ieee80211vap *vap, uint32_t op, uint32_t flags,
572b668041SAdrian Chadd 	    uint16_t srcid, const uint8_t *src, size_t len);
58f4e2f6c9SAdrian Chadd 
59f4e2f6c9SAdrian Chadd #endif	/* __IEEE80211_ALQ_H__ */
60