if_athioctl.h revision 123044
1253028Sadrian/*-
2253028Sadrian * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
3253028Sadrian * All rights reserved.
4253028Sadrian *
5253028Sadrian * Redistribution and use in source and binary forms, with or without
6253028Sadrian * modification, are permitted provided that the following conditions
7253028Sadrian * are met:
8253028Sadrian * 1. Redistributions of source code must retain the above copyright
9253028Sadrian *    notice, this list of conditions and the following disclaimer,
10253028Sadrian *    without modification.
11253028Sadrian * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12253028Sadrian *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
13253028Sadrian *    redistribution must be conditioned upon including a substantially
14253028Sadrian *    similar Disclaimer requirement for further binary redistribution.
15253028Sadrian * 3. Neither the names of the above-listed copyright holders nor the names
16253028Sadrian *    of any contributors may be used to endorse or promote products derived
17253028Sadrian *    from this software without specific prior written permission.
18253028Sadrian *
19253028Sadrian * Alternatively, this software may be distributed under the terms of the
20253028Sadrian * GNU General Public License ("GPL") version 2 as published by the Free
21253028Sadrian * Software Foundation.
22253028Sadrian *
23253028Sadrian * NO WARRANTY
24253028Sadrian * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25253028Sadrian * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26253028Sadrian * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
27253028Sadrian * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
28253028Sadrian * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
29253028Sadrian * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30253028Sadrian * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31253028Sadrian * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32256175Sadrian * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33256175Sadrian * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34253028Sadrian * THE POSSIBILITY OF SUCH DAMAGES.
35253028Sadrian *
36253028Sadrian * $FreeBSD: head/sys/dev/ath/if_athioctl.h 123044 2003-11-29 01:23:59Z sam $
37253028Sadrian */
38253028Sadrian
39253028Sadrian/*
40253028Sadrian * Ioctl-related defintions for the Atheros Wireless LAN controller driver.
41256175Sadrian */
42256175Sadrian#ifndef _DEV_ATH_ATHIOCTL_H
43256175Sadrian#define _DEV_ATH_ATHIOCTL_H
44256175Sadrian
45256175Sadrianstruct ath_stats {
46256175Sadrian	u_int32_t	ast_watchdog;	/* device reset by watchdog */
47256175Sadrian	u_int32_t	ast_hardware;	/* fatal hardware error interrupts */
48256175Sadrian	u_int32_t	ast_bmiss;	/* beacon miss interrupts */
49256175Sadrian	u_int32_t	ast_rxorn;	/* rx overrun interrupts */
50256175Sadrian	u_int32_t	ast_rxeol;	/* rx eol interrupts */
51256175Sadrian	u_int32_t	ast_txurn;	/* tx underrun interrupts */
52256175Sadrian	u_int32_t	ast_intrcoal;	/* interrupts coalesced */
53256175Sadrian	u_int32_t	ast_tx_mgmt;	/* management frames transmitted */
54256175Sadrian	u_int32_t	ast_tx_discard;	/* frames discarded prior to assoc */
55256175Sadrian	u_int32_t	ast_tx_qstop;	/* output stopped 'cuz no buffer */
56256175Sadrian	u_int32_t	ast_tx_encap;	/* tx encapsulation failed */
57256175Sadrian	u_int32_t	ast_tx_nonode;	/* tx failed 'cuz no node */
58253028Sadrian	u_int32_t	ast_tx_nombuf;	/* tx failed 'cuz no mbuf */
59253028Sadrian	u_int32_t	ast_tx_nomcl;	/* tx failed 'cuz no cluster */
60253028Sadrian	u_int32_t	ast_tx_linear;	/* tx linearized to cluster */
61253028Sadrian	u_int32_t	ast_tx_nodata;	/* tx discarded empty frame */
62253028Sadrian	u_int32_t	ast_tx_busdma;	/* tx failed for dma resrcs */
63253028Sadrian	u_int32_t	ast_tx_xretries;/* tx failed 'cuz too many retries */
64253028Sadrian	u_int32_t	ast_tx_fifoerr;	/* tx failed 'cuz FIFO underrun */
65253028Sadrian	u_int32_t	ast_tx_filtered;/* tx failed 'cuz xmit filtered */
66253028Sadrian	u_int32_t	ast_tx_shortretry;/* tx on-chip retries (short) */
67256175Sadrian	u_int32_t	ast_tx_longretry;/* tx on-chip retries (long) */
68256175Sadrian	u_int32_t	ast_tx_badrate;	/* tx failed 'cuz bogus xmit rate */
69256175Sadrian	u_int32_t	ast_tx_noack;	/* tx frames with no ack marked */
70253028Sadrian	u_int32_t	ast_tx_rts;	/* tx frames with rts enabled */
71253028Sadrian	u_int32_t	ast_tx_cts;	/* tx frames with cts enabled */
72253028Sadrian	u_int32_t	ast_tx_shortpre;/* tx frames with short preamble */
73253028Sadrian	u_int32_t	ast_rx_nombuf;	/* rx setup failed 'cuz no mbuf */
74253028Sadrian	u_int32_t	ast_rx_busdma;	/* rx setup failed for dma resrcs */
75253028Sadrian	u_int32_t	ast_rx_orn;	/* rx failed 'cuz of desc overrun */
76253028Sadrian	u_int32_t	ast_rx_crcerr;	/* rx failed 'cuz of bad CRC */
77253028Sadrian	u_int32_t	ast_rx_fifoerr;	/* rx failed 'cuz of FIFO overrun */
78253028Sadrian	u_int32_t	ast_rx_badcrypt;/* rx failed 'cuz decryption */
79253028Sadrian	u_int32_t	ast_rx_phyerr;	/* rx failed 'cuz of PHY err */
80253028Sadrian	u_int32_t	ast_rx_phy[32];	/* rx PHY error per-code counts */
81253028Sadrian	u_int32_t	ast_rx_tooshort;/* rx discarded 'cuz frame too short */
82253028Sadrian	u_int32_t	ast_rx_ctl;	/* rx discarded 'cuz ctl frame */
83253028Sadrian	u_int32_t	ast_be_nombuf;	/* beacon setup failed 'cuz no mbuf */
84253028Sadrian	u_int32_t	ast_per_cal;	/* periodic calibration calls */
85253028Sadrian	u_int32_t	ast_per_calfail;/* periodic calibration failed */
86253028Sadrian	u_int32_t	ast_per_rfgain;	/* periodic calibration rfgain reset */
87253028Sadrian	u_int32_t	ast_rate_calls;	/* rate control checks */
88253028Sadrian	u_int32_t	ast_rate_raise;	/* rate control raised xmit rate */
89253028Sadrian	u_int32_t	ast_rate_drop;	/* rate control dropped xmit rate */
90253028Sadrian};
91253028Sadrian
92253028Sadrian#define	SIOCGATHSTATS	_IOWR('i', 137, struct ifreq)
93253028Sadrian
94253028Sadrianstruct ath_diag {
95253028Sadrian	char	ad_name[IFNAMSIZ];		/* if name, e.g. "ath0" */
96253028Sadrian	u_int	ad_id;
97253028Sadrian	caddr_t	ad_data;
98253028Sadrian	u_int	ad_size;
99253028Sadrian
100253028Sadrian};
101253028Sadrian#define	SIOCGATHDIAG	_IOWR('i', 138, struct ath_diag)
102253028Sadrian
103253028Sadrian/*
104253028Sadrian * Radio capture format.
105253028Sadrian */
106258780Seadler#define ATH_RX_RADIOTAP_PRESENT (		\
107256483Sadrian	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
108256483Sadrian	(1 << IEEE80211_RADIOTAP_RATE)		| \
109256483Sadrian	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
110256483Sadrian	(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)	| \
111256483Sadrian	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
112256483Sadrian	0)
113256483Sadrian
114256175Sadrianstruct ath_rx_radiotap_header {
115256175Sadrian	struct ieee80211_radiotap_header wr_ihdr;
116256483Sadrian	u_int8_t	wr_flags;		/* XXX for padding */
117256483Sadrian	u_int8_t	wr_rate;
118256483Sadrian	u_int16_t	wr_chan_freq;
119256483Sadrian	u_int16_t	wr_chan_flags;
120256483Sadrian	u_int8_t	wr_antsignal;
121256483Sadrian	u_int8_t	wr_antenna;
122256483Sadrian};
123256483Sadrian
124256175Sadrian#define ATH_TX_RADIOTAP_PRESENT (		\
125256175Sadrian	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
126253028Sadrian	(1 << IEEE80211_RADIOTAP_RATE)		| \
127256483Sadrian	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
128256175Sadrian	0)
129256175Sadrian
130256483Sadrianstruct ath_tx_radiotap_header {
131256483Sadrian	struct ieee80211_radiotap_header wt_ihdr;
132253028Sadrian	u_int8_t	wt_flags;		/* XXX for padding */
133253028Sadrian	u_int8_t	wt_rate;
134253028Sadrian	u_int16_t	wt_chan_freq;
135256483Sadrian	u_int16_t	wt_chan_flags;
136256483Sadrian};
137256483Sadrian
138253028Sadrian#endif /* _DEV_ATH_ATHIOCTL_H */
139253028Sadrian