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