xref: /freebsd/sys/net80211/ieee80211_alq.h (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
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  * $FreeBSD$
28f4e2f6c9SAdrian Chadd  */
29f4e2f6c9SAdrian Chadd #ifndef	__IEEE80211_ALQ_H__
30f4e2f6c9SAdrian Chadd #define	__IEEE80211_ALQ_H__
31f4e2f6c9SAdrian Chadd 
322b668041SAdrian Chadd #define	IEEE80211_ALQ_MAX_PAYLOAD	1024
33f4e2f6c9SAdrian Chadd 
34f4e2f6c9SAdrian Chadd /*
35f4e2f6c9SAdrian Chadd  * timestamp
36f4e2f6c9SAdrian Chadd  * wlan interface
37f4e2f6c9SAdrian Chadd  * operation
38f4e2f6c9SAdrian Chadd  * sub-operation
39f4e2f6c9SAdrian Chadd  * rest of structure - operation specific
40f4e2f6c9SAdrian Chadd  */
412b668041SAdrian Chadd 
422b668041SAdrian Chadd #define	IEEE80211_ALQ_SRC_NET80211	0x0001
432b668041SAdrian Chadd /* Drivers define their own numbers above 0xff */
442b668041SAdrian Chadd 
45f4e2f6c9SAdrian Chadd struct ieee80211_alq_rec {
462b668041SAdrian Chadd 	uint64_t	r_timestamp;	/* XXX may wrap! */
47cf42b1ccSAdrian Chadd 	uint32_t	r_threadid;	/* current thread id */
48f4e2f6c9SAdrian Chadd 	uint16_t	r_wlan;		/* wlan interface number */
492b668041SAdrian Chadd 	uint16_t	r_src;		/* source - driver, net80211 */
502b668041SAdrian Chadd 	uint32_t	r_flags;	/* flags */
512b668041SAdrian Chadd 	uint32_t	r_op;		/* top-level operation id */
522b668041SAdrian Chadd 	uint32_t	r_len;		/* length of hdr + payload */
532b668041SAdrian Chadd 	/* Operation payload follows here */
54f4e2f6c9SAdrian Chadd };
55f4e2f6c9SAdrian Chadd 
56f4e2f6c9SAdrian Chadd /* General logging function */
572b668041SAdrian Chadd extern	int ieee80211_alq_log(struct ieee80211com *ic,
582b668041SAdrian Chadd 	    struct ieee80211vap *vap, uint32_t op, uint32_t flags,
592b668041SAdrian Chadd 	    uint16_t srcid, const uint8_t *src, size_t len);
60f4e2f6c9SAdrian Chadd 
61f4e2f6c9SAdrian Chadd #endif	/* __IEEE80211_ALQ_H__ */
62