if_athioctl.h revision 123044
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 123044 2003-11-29 01:23:59Z 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 */ 73116743Ssam u_int32_t ast_rx_nombuf; /* rx setup failed 'cuz no mbuf */ 74116743Ssam u_int32_t ast_rx_busdma; /* rx setup failed for dma resrcs */ 75116743Ssam u_int32_t ast_rx_orn; /* rx failed 'cuz of desc overrun */ 76116743Ssam u_int32_t ast_rx_crcerr; /* rx failed 'cuz of bad CRC */ 77116743Ssam u_int32_t ast_rx_fifoerr; /* rx failed 'cuz of FIFO overrun */ 78116743Ssam u_int32_t ast_rx_badcrypt;/* rx failed 'cuz decryption */ 79116743Ssam u_int32_t ast_rx_phyerr; /* rx failed 'cuz of PHY err */ 80116743Ssam u_int32_t ast_rx_phy[32]; /* rx PHY error per-code counts */ 81119147Ssam u_int32_t ast_rx_tooshort;/* rx discarded 'cuz frame too short */ 82119147Ssam u_int32_t ast_rx_ctl; /* rx discarded 'cuz ctl frame */ 83116743Ssam u_int32_t ast_be_nombuf; /* beacon setup failed 'cuz no mbuf */ 84116743Ssam u_int32_t ast_per_cal; /* periodic calibration calls */ 85116743Ssam u_int32_t ast_per_calfail;/* periodic calibration failed */ 86116743Ssam u_int32_t ast_per_rfgain; /* periodic calibration rfgain reset */ 87116743Ssam u_int32_t ast_rate_calls; /* rate control checks */ 88116743Ssam u_int32_t ast_rate_raise; /* rate control raised xmit rate */ 89116743Ssam u_int32_t ast_rate_drop; /* rate control dropped xmit rate */ 90116743Ssam}; 91116743Ssam 92116743Ssam#define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) 93116743Ssam 94123044Ssamstruct ath_diag { 95123044Ssam char ad_name[IFNAMSIZ]; /* if name, e.g. "ath0" */ 96123044Ssam u_int ad_id; 97123044Ssam caddr_t ad_data; 98123044Ssam u_int ad_size; 99123044Ssam 100123044Ssam}; 101123044Ssam#define SIOCGATHDIAG _IOWR('i', 138, struct ath_diag) 102123044Ssam 103119783Ssam/* 104119783Ssam * Radio capture format. 105119783Ssam */ 106119783Ssam#define ATH_RX_RADIOTAP_PRESENT ( \ 107119783Ssam (1 << IEEE80211_RADIOTAP_FLAGS) | \ 108119783Ssam (1 << IEEE80211_RADIOTAP_RATE) | \ 109119783Ssam (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 110119783Ssam (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \ 111119783Ssam (1 << IEEE80211_RADIOTAP_ANTENNA) | \ 112119783Ssam 0) 113119783Ssam 114119783Ssamstruct ath_rx_radiotap_header { 115119783Ssam struct ieee80211_radiotap_header wr_ihdr; 116119783Ssam u_int8_t wr_flags; /* XXX for padding */ 117119783Ssam u_int8_t wr_rate; 118119783Ssam u_int16_t wr_chan_freq; 119119783Ssam u_int16_t wr_chan_flags; 120119783Ssam u_int8_t wr_antsignal; 121119783Ssam u_int8_t wr_antenna; 122119783Ssam}; 123119783Ssam 124119783Ssam#define ATH_TX_RADIOTAP_PRESENT ( \ 125119783Ssam (1 << IEEE80211_RADIOTAP_FLAGS) | \ 126119783Ssam (1 << IEEE80211_RADIOTAP_RATE) | \ 127119783Ssam (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 128119783Ssam 0) 129119783Ssam 130119783Ssamstruct ath_tx_radiotap_header { 131119783Ssam struct ieee80211_radiotap_header wt_ihdr; 132119783Ssam u_int8_t wt_flags; /* XXX for padding */ 133119783Ssam u_int8_t wt_rate; 134119783Ssam u_int16_t wt_chan_freq; 135119783Ssam u_int16_t wt_chan_flags; 136119783Ssam}; 137119783Ssam 138116743Ssam#endif /* _DEV_ATH_ATHIOCTL_H */ 139