if_athioctl.h revision 119783
1169691Skan/*-
2132720Skan * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
397403Sobrien * All rights reserved.
4169691Skan *
5169691Skan * Redistribution and use in source and binary forms, with or without
697403Sobrien * modification, are permitted provided that the following conditions
797403Sobrien * are met:
897403Sobrien * 1. Redistributions of source code must retain the above copyright
997403Sobrien *    notice, this list of conditions and the following disclaimer,
1097403Sobrien *    without modification.
1197403Sobrien * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1297403Sobrien *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
1397403Sobrien *    redistribution must be conditioned upon including a substantially
1497403Sobrien *    similar Disclaimer requirement for further binary redistribution.
15132720Skan * 3. Neither the names of the above-listed copyright holders nor the names
1697403Sobrien *    of any contributors may be used to endorse or promote products derived
1797403Sobrien *    from this software without specific prior written permission.
1897403Sobrien *
1997403Sobrien * Alternatively, this software may be distributed under the terms of the
2097403Sobrien * GNU General Public License ("GPL") version 2 as published by the Free
2197403Sobrien * Software Foundation.
2297403Sobrien *
23132720Skan * NO WARRANTY
2497403Sobrien * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25132720Skan * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26132720Skan * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
27132720Skan * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
28132720Skan * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
29132720Skan * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3097403Sobrien * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3197403Sobrien * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
3297403Sobrien * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3397403Sobrien * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
3497403Sobrien * THE POSSIBILITY OF SUCH DAMAGES.
3597403Sobrien *
3697403Sobrien * $FreeBSD: head/sys/dev/ath/if_athioctl.h 119783 2003-09-05 22:22:49Z sam $
3797403Sobrien */
3897403Sobrien
39169691Skan/*
40169691Skan * Ioctl-related defintions for the Atheros Wireless LAN controller driver.
41169691Skan */
42169691Skan#ifndef _DEV_ATH_ATHIOCTL_H
43169691Skan#define _DEV_ATH_ATHIOCTL_H
44169691Skan
45169691Skanstruct ath_stats {
46169691Skan	u_int32_t	ast_watchdog;	/* device reset by watchdog */
47169691Skan	u_int32_t	ast_hardware;	/* fatal hardware error interrupts */
48169691Skan	u_int32_t	ast_bmiss;	/* beacon miss interrupts */
49169691Skan	u_int32_t	ast_rxorn;	/* rx overrun interrupts */
50169691Skan	u_int32_t	ast_rxeol;	/* rx eol interrupts */
51169691Skan	u_int32_t	ast_txurn;	/* tx underrun interrupts */
52169691Skan	u_int32_t	ast_intrcoal;	/* interrupts coalesced */
53169691Skan	u_int32_t	ast_tx_mgmt;	/* management frames transmitted */
54169691Skan	u_int32_t	ast_tx_discard;	/* frames discarded prior to assoc */
55169691Skan	u_int32_t	ast_tx_qstop;	/* output stopped 'cuz no buffer */
56169691Skan	u_int32_t	ast_tx_encap;	/* tx encapsulation failed */
57169691Skan	u_int32_t	ast_tx_nonode;	/* tx failed 'cuz no node */
58169691Skan	u_int32_t	ast_tx_nombuf;	/* tx failed 'cuz no mbuf */
59169691Skan	u_int32_t	ast_tx_nomcl;	/* tx failed 'cuz no cluster */
60169691Skan	u_int32_t	ast_tx_linear;	/* tx linearized to cluster */
61169691Skan	u_int32_t	ast_tx_nodata;	/* tx discarded empty frame */
62169691Skan	u_int32_t	ast_tx_busdma;	/* tx failed for dma resrcs */
63169691Skan	u_int32_t	ast_tx_xretries;/* tx failed 'cuz too many retries */
64169691Skan	u_int32_t	ast_tx_fifoerr;	/* tx failed 'cuz FIFO underrun */
65169691Skan	u_int32_t	ast_tx_filtered;/* tx failed 'cuz xmit filtered */
66169691Skan	u_int32_t	ast_tx_shortretry;/* tx on-chip retries (short) */
67169691Skan	u_int32_t	ast_tx_longretry;/* tx on-chip retries (long) */
68169691Skan	u_int32_t	ast_tx_badrate;	/* tx failed 'cuz bogus xmit rate */
69169691Skan	u_int32_t	ast_tx_noack;	/* tx frames with no ack marked */
70169691Skan	u_int32_t	ast_tx_rts;	/* tx frames with rts enabled */
71169691Skan	u_int32_t	ast_tx_cts;	/* tx frames with cts enabled */
72169691Skan	u_int32_t	ast_tx_shortpre;/* tx frames with short preamble */
73169691Skan	u_int32_t	ast_rx_nombuf;	/* rx setup failed 'cuz no mbuf */
74169691Skan	u_int32_t	ast_rx_busdma;	/* rx setup failed for dma resrcs */
75169691Skan	u_int32_t	ast_rx_orn;	/* rx failed 'cuz of desc overrun */
76169691Skan	u_int32_t	ast_rx_crcerr;	/* rx failed 'cuz of bad CRC */
77169691Skan	u_int32_t	ast_rx_fifoerr;	/* rx failed 'cuz of FIFO overrun */
78169691Skan	u_int32_t	ast_rx_badcrypt;/* rx failed 'cuz decryption */
79169691Skan	u_int32_t	ast_rx_phyerr;	/* rx failed 'cuz of PHY err */
80169691Skan	u_int32_t	ast_rx_phy[32];	/* rx PHY error per-code counts */
81169691Skan	u_int32_t	ast_rx_tooshort;/* rx discarded 'cuz frame too short */
82169691Skan	u_int32_t	ast_rx_ctl;	/* rx discarded 'cuz ctl frame */
83169691Skan	u_int32_t	ast_be_nombuf;	/* beacon setup failed 'cuz no mbuf */
84169691Skan	u_int32_t	ast_per_cal;	/* periodic calibration calls */
85169691Skan	u_int32_t	ast_per_calfail;/* periodic calibration failed */
86169691Skan	u_int32_t	ast_per_rfgain;	/* periodic calibration rfgain reset */
87169691Skan	u_int32_t	ast_rate_calls;	/* rate control checks */
88169691Skan	u_int32_t	ast_rate_raise;	/* rate control raised xmit rate */
89169691Skan	u_int32_t	ast_rate_drop;	/* rate control dropped xmit rate */
90169691Skan};
91169691Skan
92169691Skan#define	SIOCGATHSTATS	_IOWR('i', 137, struct ifreq)
93169691Skan
94169691Skan/*
95169691Skan * Radio capture format.
96169691Skan */
97169691Skan#define ATH_RX_RADIOTAP_PRESENT (		\
98169691Skan	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
99169691Skan	(1 << IEEE80211_RADIOTAP_RATE)		| \
100169691Skan	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
101169691Skan	(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)	| \
102169691Skan	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
103169691Skan	0)
104169691Skan
105169691Skanstruct ath_rx_radiotap_header {
106169691Skan	struct ieee80211_radiotap_header wr_ihdr;
107169691Skan	u_int8_t	wr_flags;		/* XXX for padding */
108169691Skan	u_int8_t	wr_rate;
109132720Skan	u_int16_t	wr_chan_freq;
110169691Skan	u_int16_t	wr_chan_flags;
111132720Skan	u_int8_t	wr_antsignal;
112132720Skan	u_int8_t	wr_antenna;
113132720Skan};
114132720Skan
11597403Sobrien#define ATH_TX_RADIOTAP_PRESENT (		\
11697403Sobrien	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
117132720Skan	(1 << IEEE80211_RADIOTAP_RATE)		| \
118132720Skan	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
119132720Skan	0)
120132720Skan
121132720Skanstruct ath_tx_radiotap_header {
12297403Sobrien	struct ieee80211_radiotap_header wt_ihdr;
123117397Skan	u_int8_t	wt_flags;		/* XXX for padding */
12497403Sobrien	u_int8_t	wt_rate;
12597403Sobrien	u_int16_t	wt_chan_freq;
126117397Skan	u_int16_t	wt_chan_flags;
127117397Skan};
128117397Skan
129132720Skan#endif /* _DEV_ATH_ATHIOCTL_H */
130117397Skan