1193240Ssam/*-
2193240Ssam * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3193240Ssam * Copyright (c) 2007-2009 Marvell Semiconductor, Inc.
4193240Ssam * All rights reserved.
5193240Ssam *
6193240Ssam * Redistribution and use in source and binary forms, with or without
7193240Ssam * modification, are permitted provided that the following conditions
8193240Ssam * are met:
9193240Ssam * 1. Redistributions of source code must retain the above copyright
10193240Ssam *    notice, this list of conditions and the following disclaimer,
11193240Ssam *    without modification.
12193240Ssam * 2. Redistributions in binary form must reproduce at minimum a disclaimer
13193240Ssam *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
14193240Ssam *    redistribution must be conditioned upon including a substantially
15193240Ssam *    similar Disclaimer requirement for further binary redistribution.
16193240Ssam *
17193240Ssam * NO WARRANTY
18193240Ssam * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19193240Ssam * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20193240Ssam * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
21193240Ssam * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22193240Ssam * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
23193240Ssam * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24193240Ssam * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25193240Ssam * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26193240Ssam * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27193240Ssam * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28193240Ssam * THE POSSIBILITY OF SUCH DAMAGES.
29193240Ssam *
30193240Ssam * $FreeBSD$
31193240Ssam */
32193240Ssam
33193240Ssam/*
34193240Ssam * Ioctl-related defintions for the Marvel Wireless LAN controller driver.
35193240Ssam */
36193240Ssam#ifndef _DEV_MWL_MVIOCTL_H
37193240Ssam#define _DEV_MWL_MVIOCTL_H
38193240Ssam
39193240Ssamstruct mwl_stats {
40193240Ssam	struct mwl_hal_hwstats hw_stats;	/* XXX tied to h/w defs */
41193240Ssam	uint32_t	mst_failure;	/* generic hardware failure */
42193240Ssam	uint32_t	mst_rx_badtkipicv;
43193240Ssam	uint32_t	mst_tx_discard;
44193240Ssam	uint32_t	mst_tx_qstop;
45193240Ssam	uint32_t	mst_tx_encap;
46193240Ssam	uint32_t	mst_tx_mgmt;
47193240Ssam	uint32_t	mst_rx_nombuf;
48193240Ssam	uint32_t	mst_rx_busdma;
49193240Ssam	uint32_t	mst_rx_tooshort;
50193240Ssam	uint32_t	mst_tx_busdma;
51193240Ssam	uint32_t	mst_tx_linear;
52193240Ssam	uint32_t	mst_tx_nombuf;
53193240Ssam	uint32_t	mst_tx_nodata;
54193240Ssam	uint32_t	mst_tx_shortpre;
55193240Ssam	uint32_t	mst_tx_retries;
56193240Ssam	uint32_t	mst_tx_mretries;
57193240Ssam	uint32_t	mst_tx_linkerror;
58193240Ssam	uint32_t	mst_tx_xretries;
59193240Ssam	uint32_t	mst_tx_aging;
60193240Ssam 	uint32_t	mst_tx_qdrop;
61193240Ssam	uint32_t	mst_ff_txerr;
62193240Ssam	uint32_t	mst_watchdog;
63193240Ssam	uint32_t	mst_tx_packets;
64193240Ssam	uint32_t	mst_rx_packets;
65193240Ssam	int8_t		mst_rx_rssi;
66193240Ssam	int8_t		mst_rx_noise;
67193240Ssam	uint8_t		mst_tx_rate;
68193240Ssam	uint32_t	mst_ant_tx[4];
69193240Ssam	uint32_t	mst_ant_rx[4];
70193240Ssam	uint32_t	mst_tx_tso;
71193240Ssam	uint32_t	mst_tso_badeth;
72193240Ssam	uint32_t	mst_tso_nohdr;
73193240Ssam	uint32_t	mst_tso_badsplit;
74193240Ssam	uint32_t	mst_rx_crypto;
75193240Ssam	uint32_t	mst_rx_tkipmic;
76193240Ssam	uint32_t	mst_rx_nodmabuf;
77193240Ssam	uint32_t	mst_tx_noheadroom;
78193240Ssam	uint32_t	mst_tx_badframetype;
79193240Ssam	uint32_t	mst_ampdu_nostream;
80193240Ssam	uint32_t	mst_ampdu_reject;
81193240Ssam	uint32_t	mst_addba_nostream;
82193240Ssam	uint32_t	mst_bacreate_failed;
83193240Ssam	uint32_t	mst_bawatchdog;
84193240Ssam	uint32_t	mst_radardetect;
85193240Ssam	uint32_t	mst_rx_dmabufmissing;
86193240Ssam	uint32_t	mst_bawatchdog_notfound;
87193240Ssam	uint32_t	mst_bawatchdog_empty;
88193240Ssam	uint32_t	mst_bawatchdog_failed;
89193240Ssam	uint32_t	mst_rxbuf_failed;
90193240Ssam	uint32_t	mst_pad[31];
91193240Ssam};
92193240Ssam
93193240Ssam#define	SIOCGMVSTATS	_IOWR('i', 137, struct ifreq)
94193240Ssam
95193240Ssam/*
96193240Ssam * Radio capture format.
97193240Ssam */
98193240Ssam#define MWL_RX_RADIOTAP_PRESENT (		\
99193240Ssam	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
100193240Ssam	(1 << IEEE80211_RADIOTAP_RATE)		| \
101193240Ssam	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
102193240Ssam	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
103193240Ssam	(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL)	| \
104193240Ssam	(1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)	| \
105193240Ssam	0)
106193240Ssam
107193240Ssamstruct mwl_rx_radiotap_header {
108193240Ssam	struct ieee80211_radiotap_header wr_ihdr;
109193240Ssam	u_int8_t	wr_flags;
110193240Ssam	u_int8_t	wr_rate;
111193240Ssam	u_int16_t	wr_chan_freq;
112193240Ssam	u_int16_t	wr_chan_flags;
113193240Ssam	int8_t		wr_antsignal;
114193240Ssam	int8_t		wr_antnoise;
115193240Ssam	u_int8_t	wr_antenna;
116193240Ssam};
117193240Ssam
118193240Ssam#define MWL_TX_RADIOTAP_PRESENT (		\
119193240Ssam	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
120193240Ssam	(1 << IEEE80211_RADIOTAP_RATE)		| \
121193240Ssam	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
122193240Ssam	(1 << IEEE80211_RADIOTAP_DBM_TX_POWER)	| \
123193240Ssam	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
124193240Ssam	0)
125193240Ssam
126193240Ssamstruct mwl_tx_radiotap_header {
127193240Ssam	struct ieee80211_radiotap_header wt_ihdr;
128193240Ssam	u_int8_t	wt_flags;
129193240Ssam	u_int8_t	wt_rate;
130193240Ssam	u_int16_t	wt_chan_freq;
131193240Ssam	u_int16_t	wt_chan_flags;
132193240Ssam	u_int8_t	wt_txpower;
133193240Ssam	u_int8_t	wt_antenna;
134193240Ssam};
135193240Ssam
136193240Ssam#endif /* _DEV_MWL_MVIOCTL_H */
137