xref: /freebsd/sys/dev/mwl/if_mwlioctl.h (revision 786ac7035f938bf3764ec6d5ee2f0e50b5d959b6)
1cf4c5a53SSam Leffler /*-
2718cf2ccSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3718cf2ccSPedro F. Giffuni  *
4cf4c5a53SSam Leffler  * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
5cf4c5a53SSam Leffler  * Copyright (c) 2007-2009 Marvell Semiconductor, Inc.
6cf4c5a53SSam Leffler  * All rights reserved.
7cf4c5a53SSam Leffler  *
8cf4c5a53SSam Leffler  * Redistribution and use in source and binary forms, with or without
9cf4c5a53SSam Leffler  * modification, are permitted provided that the following conditions
10cf4c5a53SSam Leffler  * are met:
11cf4c5a53SSam Leffler  * 1. Redistributions of source code must retain the above copyright
12cf4c5a53SSam Leffler  *    notice, this list of conditions and the following disclaimer,
13cf4c5a53SSam Leffler  *    without modification.
14cf4c5a53SSam Leffler  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15cf4c5a53SSam Leffler  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
16cf4c5a53SSam Leffler  *    redistribution must be conditioned upon including a substantially
17cf4c5a53SSam Leffler  *    similar Disclaimer requirement for further binary redistribution.
18cf4c5a53SSam Leffler  *
19cf4c5a53SSam Leffler  * NO WARRANTY
20cf4c5a53SSam Leffler  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21cf4c5a53SSam Leffler  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22cf4c5a53SSam Leffler  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
23cf4c5a53SSam Leffler  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
24cf4c5a53SSam Leffler  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
25cf4c5a53SSam Leffler  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26cf4c5a53SSam Leffler  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27cf4c5a53SSam Leffler  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
28cf4c5a53SSam Leffler  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29cf4c5a53SSam Leffler  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30cf4c5a53SSam Leffler  * THE POSSIBILITY OF SUCH DAMAGES.
31cf4c5a53SSam Leffler  *
32cf4c5a53SSam Leffler  * $FreeBSD$
33cf4c5a53SSam Leffler  */
34cf4c5a53SSam Leffler 
35cf4c5a53SSam Leffler /*
36cf4c5a53SSam Leffler  * Ioctl-related defintions for the Marvel Wireless LAN controller driver.
37cf4c5a53SSam Leffler  */
38cf4c5a53SSam Leffler #ifndef _DEV_MWL_MVIOCTL_H
39cf4c5a53SSam Leffler #define _DEV_MWL_MVIOCTL_H
40cf4c5a53SSam Leffler 
41cf4c5a53SSam Leffler struct mwl_stats {
42cf4c5a53SSam Leffler 	struct mwl_hal_hwstats hw_stats;	/* XXX tied to h/w defs */
43cf4c5a53SSam Leffler 	uint32_t	mst_failure;	/* generic hardware failure */
44cf4c5a53SSam Leffler 	uint32_t	mst_rx_badtkipicv;
45cf4c5a53SSam Leffler 	uint32_t	mst_tx_discard;
46cf4c5a53SSam Leffler 	uint32_t	mst_tx_qstop;
47cf4c5a53SSam Leffler 	uint32_t	mst_tx_encap;
48cf4c5a53SSam Leffler 	uint32_t	mst_tx_mgmt;
49cf4c5a53SSam Leffler 	uint32_t	mst_rx_nombuf;
50cf4c5a53SSam Leffler 	uint32_t	mst_rx_busdma;
51cf4c5a53SSam Leffler 	uint32_t	mst_rx_tooshort;
52cf4c5a53SSam Leffler 	uint32_t	mst_tx_busdma;
53cf4c5a53SSam Leffler 	uint32_t	mst_tx_linear;
54cf4c5a53SSam Leffler 	uint32_t	mst_tx_nombuf;
55cf4c5a53SSam Leffler 	uint32_t	mst_tx_nodata;
56cf4c5a53SSam Leffler 	uint32_t	mst_tx_shortpre;
57cf4c5a53SSam Leffler 	uint32_t	mst_tx_retries;
58cf4c5a53SSam Leffler 	uint32_t	mst_tx_mretries;
59cf4c5a53SSam Leffler 	uint32_t	mst_tx_linkerror;
60cf4c5a53SSam Leffler 	uint32_t	mst_tx_xretries;
61cf4c5a53SSam Leffler 	uint32_t	mst_tx_aging;
62cf4c5a53SSam Leffler  	uint32_t	mst_tx_qdrop;
63cf4c5a53SSam Leffler 	uint32_t	mst_ff_txerr;
64cf4c5a53SSam Leffler 	uint32_t	mst_watchdog;
65cf4c5a53SSam Leffler 	uint32_t	mst_tx_packets;
66cf4c5a53SSam Leffler 	uint32_t	mst_rx_packets;
67cf4c5a53SSam Leffler 	int8_t		mst_rx_rssi;
68cf4c5a53SSam Leffler 	int8_t		mst_rx_noise;
69cf4c5a53SSam Leffler 	uint8_t		mst_tx_rate;
70cf4c5a53SSam Leffler 	uint32_t	mst_ant_tx[4];
71cf4c5a53SSam Leffler 	uint32_t	mst_ant_rx[4];
72cf4c5a53SSam Leffler 	uint32_t	mst_tx_tso;
73cf4c5a53SSam Leffler 	uint32_t	mst_tso_badeth;
74cf4c5a53SSam Leffler 	uint32_t	mst_tso_nohdr;
75cf4c5a53SSam Leffler 	uint32_t	mst_tso_badsplit;
76cf4c5a53SSam Leffler 	uint32_t	mst_rx_crypto;
77cf4c5a53SSam Leffler 	uint32_t	mst_rx_tkipmic;
78cf4c5a53SSam Leffler 	uint32_t	mst_rx_nodmabuf;
79cf4c5a53SSam Leffler 	uint32_t	mst_tx_noheadroom;
80cf4c5a53SSam Leffler 	uint32_t	mst_tx_badframetype;
81cf4c5a53SSam Leffler 	uint32_t	mst_ampdu_nostream;
82cf4c5a53SSam Leffler 	uint32_t	mst_ampdu_reject;
83cf4c5a53SSam Leffler 	uint32_t	mst_addba_nostream;
84cf4c5a53SSam Leffler 	uint32_t	mst_bacreate_failed;
85cf4c5a53SSam Leffler 	uint32_t	mst_bawatchdog;
86cf4c5a53SSam Leffler 	uint32_t	mst_radardetect;
87cf4c5a53SSam Leffler 	uint32_t	mst_rx_dmabufmissing;
88cf4c5a53SSam Leffler 	uint32_t	mst_bawatchdog_notfound;
89cf4c5a53SSam Leffler 	uint32_t	mst_bawatchdog_empty;
90cf4c5a53SSam Leffler 	uint32_t	mst_bawatchdog_failed;
91cf4c5a53SSam Leffler 	uint32_t	mst_rxbuf_failed;
92cf4c5a53SSam Leffler 	uint32_t	mst_pad[31];
93cf4c5a53SSam Leffler };
94cf4c5a53SSam Leffler 
95cf4c5a53SSam Leffler #define	SIOCGMVSTATS	_IOWR('i', 137, struct ifreq)
96cf4c5a53SSam Leffler 
97cf4c5a53SSam Leffler /*
98cf4c5a53SSam Leffler  * Radio capture format.
99cf4c5a53SSam Leffler  */
100cf4c5a53SSam Leffler #define MWL_RX_RADIOTAP_PRESENT (		\
101cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
102cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_RATE)		| \
103cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
104cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
105cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL)	| \
106cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)	| \
107cf4c5a53SSam Leffler 	0)
108cf4c5a53SSam Leffler 
109cf4c5a53SSam Leffler struct mwl_rx_radiotap_header {
110cf4c5a53SSam Leffler 	struct ieee80211_radiotap_header wr_ihdr;
111cf4c5a53SSam Leffler 	u_int8_t	wr_flags;
112cf4c5a53SSam Leffler 	u_int8_t	wr_rate;
113cf4c5a53SSam Leffler 	u_int16_t	wr_chan_freq;
114cf4c5a53SSam Leffler 	u_int16_t	wr_chan_flags;
115cf4c5a53SSam Leffler 	int8_t		wr_antsignal;
116cf4c5a53SSam Leffler 	int8_t		wr_antnoise;
117cf4c5a53SSam Leffler 	u_int8_t	wr_antenna;
118*786ac703SAndriy Voskoboinyk } __packed __aligned(8);
119cf4c5a53SSam Leffler 
120cf4c5a53SSam Leffler #define MWL_TX_RADIOTAP_PRESENT (		\
121cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
122cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_RATE)		| \
123cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
124cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_DBM_TX_POWER)	| \
125cf4c5a53SSam Leffler 	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
126cf4c5a53SSam Leffler 	0)
127cf4c5a53SSam Leffler 
128cf4c5a53SSam Leffler struct mwl_tx_radiotap_header {
129cf4c5a53SSam Leffler 	struct ieee80211_radiotap_header wt_ihdr;
130cf4c5a53SSam Leffler 	u_int8_t	wt_flags;
131cf4c5a53SSam Leffler 	u_int8_t	wt_rate;
132cf4c5a53SSam Leffler 	u_int16_t	wt_chan_freq;
133cf4c5a53SSam Leffler 	u_int16_t	wt_chan_flags;
134cf4c5a53SSam Leffler 	u_int8_t	wt_txpower;
135cf4c5a53SSam Leffler 	u_int8_t	wt_antenna;
136*786ac703SAndriy Voskoboinyk } __packed;
137cf4c5a53SSam Leffler 
138cf4c5a53SSam Leffler #endif /* _DEV_MWL_MVIOCTL_H */
139