if_athioctl.h revision 127779
1116743Ssam/*-
2116743Ssam * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
3116743Ssam * All rights reserved.
4116743Ssam *
5116743Ssam * Redistribution and use in source and binary forms, with or without
6116743Ssam * modification, are permitted provided that the following conditions
7116743Ssam * are met:
8116743Ssam * 1. Redistributions of source code must retain the above copyright
9116743Ssam *    notice, this list of conditions and the following disclaimer,
10116743Ssam *    without modification.
11116743Ssam * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12116743Ssam *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
13116743Ssam *    redistribution must be conditioned upon including a substantially
14116743Ssam *    similar Disclaimer requirement for further binary redistribution.
15116743Ssam * 3. Neither the names of the above-listed copyright holders nor the names
16116743Ssam *    of any contributors may be used to endorse or promote products derived
17116743Ssam *    from this software without specific prior written permission.
18116743Ssam *
19116743Ssam * Alternatively, this software may be distributed under the terms of the
20116743Ssam * GNU General Public License ("GPL") version 2 as published by the Free
21116743Ssam * Software Foundation.
22116743Ssam *
23116743Ssam * NO WARRANTY
24116743Ssam * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25116743Ssam * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26116743Ssam * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
27116743Ssam * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
28116743Ssam * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
29116743Ssam * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30116743Ssam * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31116743Ssam * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32116743Ssam * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33116743Ssam * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34116743Ssam * THE POSSIBILITY OF SUCH DAMAGES.
35116743Ssam *
36116743Ssam * $FreeBSD: head/sys/dev/ath/if_athioctl.h 127779 2004-04-02 23:55:45Z sam $
37116743Ssam */
38116743Ssam
39116743Ssam/*
40116743Ssam * Ioctl-related defintions for the Atheros Wireless LAN controller driver.
41116743Ssam */
42116743Ssam#ifndef _DEV_ATH_ATHIOCTL_H
43116743Ssam#define _DEV_ATH_ATHIOCTL_H
44116743Ssam
45116743Ssamstruct ath_stats {
46116743Ssam	u_int32_t	ast_watchdog;	/* device reset by watchdog */
47116743Ssam	u_int32_t	ast_hardware;	/* fatal hardware error interrupts */
48116743Ssam	u_int32_t	ast_bmiss;	/* beacon miss interrupts */
49116743Ssam	u_int32_t	ast_rxorn;	/* rx overrun interrupts */
50116743Ssam	u_int32_t	ast_rxeol;	/* rx eol interrupts */
51116743Ssam	u_int32_t	ast_txurn;	/* tx underrun interrupts */
52116743Ssam	u_int32_t	ast_intrcoal;	/* interrupts coalesced */
53116743Ssam	u_int32_t	ast_tx_mgmt;	/* management frames transmitted */
54116743Ssam	u_int32_t	ast_tx_discard;	/* frames discarded prior to assoc */
55116743Ssam	u_int32_t	ast_tx_qstop;	/* output stopped 'cuz no buffer */
56116743Ssam	u_int32_t	ast_tx_encap;	/* tx encapsulation failed */
57116743Ssam	u_int32_t	ast_tx_nonode;	/* tx failed 'cuz no node */
58116743Ssam	u_int32_t	ast_tx_nombuf;	/* tx failed 'cuz no mbuf */
59116743Ssam	u_int32_t	ast_tx_nomcl;	/* tx failed 'cuz no cluster */
60116743Ssam	u_int32_t	ast_tx_linear;	/* tx linearized to cluster */
61116743Ssam	u_int32_t	ast_tx_nodata;	/* tx discarded empty frame */
62116743Ssam	u_int32_t	ast_tx_busdma;	/* tx failed for dma resrcs */
63116743Ssam	u_int32_t	ast_tx_xretries;/* tx failed 'cuz too many retries */
64116743Ssam	u_int32_t	ast_tx_fifoerr;	/* tx failed 'cuz FIFO underrun */
65116743Ssam	u_int32_t	ast_tx_filtered;/* tx failed 'cuz xmit filtered */
66116743Ssam	u_int32_t	ast_tx_shortretry;/* tx on-chip retries (short) */
67116743Ssam	u_int32_t	ast_tx_longretry;/* tx on-chip retries (long) */
68116743Ssam	u_int32_t	ast_tx_badrate;	/* tx failed 'cuz bogus xmit rate */
69116743Ssam	u_int32_t	ast_tx_noack;	/* tx frames with no ack marked */
70116743Ssam	u_int32_t	ast_tx_rts;	/* tx frames with rts enabled */
71116743Ssam	u_int32_t	ast_tx_cts;	/* tx frames with cts enabled */
72116743Ssam	u_int32_t	ast_tx_shortpre;/* tx frames with short preamble */
73127779Ssam	u_int32_t	ast_tx_altrate;	/* tx frames with alternate rate */
74127779Ssam	u_int32_t	ast_tx_protect;	/* tx frames with protection */
75116743Ssam	u_int32_t	ast_rx_nombuf;	/* rx setup failed 'cuz no mbuf */
76116743Ssam	u_int32_t	ast_rx_busdma;	/* rx setup failed for dma resrcs */
77116743Ssam	u_int32_t	ast_rx_orn;	/* rx failed 'cuz of desc overrun */
78116743Ssam	u_int32_t	ast_rx_crcerr;	/* rx failed 'cuz of bad CRC */
79116743Ssam	u_int32_t	ast_rx_fifoerr;	/* rx failed 'cuz of FIFO overrun */
80116743Ssam	u_int32_t	ast_rx_badcrypt;/* rx failed 'cuz decryption */
81116743Ssam	u_int32_t	ast_rx_phyerr;	/* rx failed 'cuz of PHY err */
82116743Ssam	u_int32_t	ast_rx_phy[32];	/* rx PHY error per-code counts */
83119147Ssam	u_int32_t	ast_rx_tooshort;/* rx discarded 'cuz frame too short */
84127779Ssam	u_int32_t	ast_rx_toobig;	/* rx discarded 'cuz frame too large */
85119147Ssam	u_int32_t	ast_rx_ctl;	/* rx discarded 'cuz ctl frame */
86116743Ssam	u_int32_t	ast_be_nombuf;	/* beacon setup failed 'cuz no mbuf */
87116743Ssam	u_int32_t	ast_per_cal;	/* periodic calibration calls */
88116743Ssam	u_int32_t	ast_per_calfail;/* periodic calibration failed */
89116743Ssam	u_int32_t	ast_per_rfgain;	/* periodic calibration rfgain reset */
90116743Ssam	u_int32_t	ast_rate_calls;	/* rate control checks */
91116743Ssam	u_int32_t	ast_rate_raise;	/* rate control raised xmit rate */
92116743Ssam	u_int32_t	ast_rate_drop;	/* rate control dropped xmit rate */
93116743Ssam};
94116743Ssam
95116743Ssam#define	SIOCGATHSTATS	_IOWR('i', 137, struct ifreq)
96116743Ssam
97123044Ssamstruct ath_diag {
98123044Ssam	char	ad_name[IFNAMSIZ];		/* if name, e.g. "ath0" */
99123044Ssam	u_int	ad_id;
100123044Ssam	caddr_t	ad_data;
101123044Ssam	u_int	ad_size;
102123044Ssam
103123044Ssam};
104123044Ssam#define	SIOCGATHDIAG	_IOWR('i', 138, struct ath_diag)
105123044Ssam
106119783Ssam/*
107119783Ssam * Radio capture format.
108119783Ssam */
109119783Ssam#define ATH_RX_RADIOTAP_PRESENT (		\
110119783Ssam	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
111119783Ssam	(1 << IEEE80211_RADIOTAP_RATE)		| \
112119783Ssam	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
113123928Ssam	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
114119783Ssam	(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)	| \
115119783Ssam	0)
116119783Ssam
117119783Ssamstruct ath_rx_radiotap_header {
118119783Ssam	struct ieee80211_radiotap_header wr_ihdr;
119119783Ssam	u_int8_t	wr_flags;		/* XXX for padding */
120119783Ssam	u_int8_t	wr_rate;
121119783Ssam	u_int16_t	wr_chan_freq;
122119783Ssam	u_int16_t	wr_chan_flags;
123123928Ssam	u_int8_t	wr_antenna;
124119783Ssam	u_int8_t	wr_antsignal;
125119783Ssam};
126119783Ssam
127119783Ssam#define ATH_TX_RADIOTAP_PRESENT (		\
128119783Ssam	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
129119783Ssam	(1 << IEEE80211_RADIOTAP_RATE)		| \
130119783Ssam	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
131123928Ssam	(1 << IEEE80211_RADIOTAP_DBM_TX_POWER)	| \
132123928Ssam	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
133119783Ssam	0)
134119783Ssam
135119783Ssamstruct ath_tx_radiotap_header {
136119783Ssam	struct ieee80211_radiotap_header wt_ihdr;
137119783Ssam	u_int8_t	wt_flags;		/* XXX for padding */
138119783Ssam	u_int8_t	wt_rate;
139119783Ssam	u_int16_t	wt_chan_freq;
140119783Ssam	u_int16_t	wt_chan_flags;
141123928Ssam	u_int8_t	wt_txpower;
142123928Ssam	u_int8_t	wt_antenna;
143119783Ssam};
144119783Ssam
145116743Ssam#endif /* _DEV_ATH_ATHIOCTL_H */
146