#ifndef _DEV_ATH_ATHIOCTL_H
#define _DEV_ATH_ATHIOCTL_H
struct ath_tx_aggr_stats {
u_int32_t aggr_pkts[64];
u_int32_t aggr_single_pkt;
u_int32_t aggr_nonbaw_pkt;
u_int32_t aggr_aggr_pkt;
u_int32_t aggr_baw_closed_single_pkt;
u_int32_t aggr_low_hwq_single_pkt;
u_int32_t aggr_sched_nopkt;
u_int32_t aggr_rts_aggr_limited;
};
#define ATH_IOCTL_INTR_NUM_SYNC_INTR 32
struct ath_intr_stats {
u_int32_t sync_intr[ATH_IOCTL_INTR_NUM_SYNC_INTR];
};
#define ATH_IOCTL_STATS_NUM_RX_PHYERR 64
#define ATH_IOCTL_STATS_NUM_TX_ANTENNA 8
#define ATH_IOCTL_STATS_NUM_RX_ANTENNA 8
struct ath_stats {
u_int32_t ast_watchdog;
u_int32_t ast_hardware;
u_int32_t ast_bmiss;
u_int32_t ast_bmiss_phantom;
u_int32_t ast_bstuck;
u_int32_t ast_rxorn;
u_int32_t ast_rxeol;
u_int32_t ast_txurn;
u_int32_t ast_mib;
u_int32_t ast_intrcoal;
u_int32_t ast_tx_packets;
u_int32_t ast_tx_mgmt;
u_int32_t ast_tx_discard;
u_int32_t ast_tx_qstop;
u_int32_t ast_tx_encap;
u_int32_t ast_tx_nonode;
u_int32_t ast_tx_nombuf;
u_int32_t ast_tx_nomcl;
u_int32_t ast_tx_linear;
u_int32_t ast_tx_nodata;
u_int32_t ast_tx_busdma;
u_int32_t ast_tx_xretries;
u_int32_t ast_tx_fifoerr;
u_int32_t ast_tx_filtered;
u_int32_t ast_tx_shortretry;
u_int32_t ast_tx_longretry;
u_int32_t ast_tx_badrate;
u_int32_t ast_tx_noack;
u_int32_t ast_tx_rts;
u_int32_t ast_tx_cts;
u_int32_t ast_tx_shortpre;
u_int32_t ast_tx_altrate;
u_int32_t ast_tx_protect;
u_int32_t ast_tx_ctsburst;
u_int32_t ast_tx_ctsext;
u_int32_t ast_rx_nombuf;
u_int32_t ast_rx_busdma;
u_int32_t ast_rx_orn;
u_int32_t ast_rx_crcerr;
u_int32_t ast_rx_fifoerr;
u_int32_t ast_rx_badcrypt;
u_int32_t ast_rx_badmic;
u_int32_t ast_rx_phyerr;
u_int32_t ast_rx_phy[ATH_IOCTL_STATS_NUM_RX_PHYERR];
u_int32_t ast_rx_tooshort;
u_int32_t ast_rx_toobig;
u_int32_t ast_rx_packets;
u_int32_t ast_rx_mgt;
u_int32_t ast_rx_ctl;
int8_t ast_tx_rssi;
int8_t ast_rx_rssi;
u_int8_t ast_tx_rate;
u_int32_t ast_be_xmit;
u_int32_t ast_be_nombuf;
u_int32_t ast_per_cal;
u_int32_t ast_per_calfail;
u_int32_t ast_per_rfgain;
u_int32_t ast_rate_calls;
u_int32_t ast_rate_raise;
u_int32_t ast_rate_drop;
u_int32_t ast_ant_defswitch;
u_int32_t ast_ant_txswitch;
u_int32_t ast_ant_rx[ATH_IOCTL_STATS_NUM_RX_ANTENNA];
u_int32_t ast_ant_tx[ATH_IOCTL_STATS_NUM_TX_ANTENNA];
u_int32_t ast_cabq_xmit;
u_int32_t ast_cabq_busy;
u_int32_t ast_tx_raw;
u_int32_t ast_ff_txok;
u_int32_t ast_ff_txerr;
u_int32_t ast_ff_rx;
u_int32_t ast_ff_flush;
u_int32_t ast_tx_qfull;
int8_t ast_rx_noise;
u_int32_t ast_tx_nobuf;
u_int32_t ast_tdma_update;
u_int32_t ast_tdma_timers;
u_int32_t ast_tdma_tsf;
u_int16_t ast_tdma_tsfadjp;
u_int16_t ast_tdma_tsfadjm;
u_int32_t ast_tdma_ack;
u_int32_t ast_tx_raw_fail;
u_int32_t ast_tx_nofrag;
u_int32_t ast_be_missed;
u_int32_t ast_ani_cal;
u_int32_t ast_rx_agg;
u_int32_t ast_rx_halfgi;
u_int32_t ast_rx_2040;
u_int32_t ast_rx_pre_crc_err;
u_int32_t ast_rx_post_crc_err;
u_int32_t ast_rx_decrypt_busy_err;
u_int32_t ast_rx_hi_rx_chain;
u_int32_t ast_tx_htprotect;
u_int32_t ast_rx_hitqueueend;
u_int32_t ast_tx_timeout;
u_int32_t ast_tx_cst;
u_int32_t ast_tx_xtxop;
u_int32_t ast_tx_timerexpired;
u_int32_t ast_tx_desccfgerr;
u_int32_t ast_tx_swretries;
u_int32_t ast_tx_swretrymax;
u_int32_t ast_tx_data_underrun;
u_int32_t ast_tx_delim_underrun;
u_int32_t ast_tx_aggr_failall;
u_int32_t ast_tx_getnobuf;
u_int32_t ast_tx_getbusybuf;
u_int32_t ast_tx_intr;
u_int32_t ast_rx_intr;
u_int32_t ast_tx_aggr_ok;
u_int32_t ast_tx_aggr_fail;
u_int32_t ast_tx_mcastq_overflow;
u_int32_t ast_rx_keymiss;
u_int32_t ast_tx_swfiltered;
u_int32_t ast_tx_node_psq_overflow;
u_int32_t ast_rx_stbc;
u_int32_t ast_tx_nodeq_overflow;
u_int32_t ast_tx_ldpc;
u_int32_t ast_tx_stbc;
u_int32_t ast_tsfoor;
u_int32_t ast_pad[10];
};
#define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)
#define SIOCZATHSTATS _IOWR('i', 139, struct ifreq)
#define SIOCGATHAGSTATS _IOWR('i', 141, struct ifreq)
struct ath_diag {
char ad_name[IFNAMSIZ];
u_int16_t ad_id;
#define ATH_DIAG_DYN 0x8000
#define ATH_DIAG_IN 0x4000
#define ATH_DIAG_OUT 0x0000
#define ATH_DIAG_ID 0x0fff
u_int16_t ad_in_size;
caddr_t ad_in_data;
caddr_t ad_out_data;
u_int ad_out_size;
};
#define SIOCGATHDIAG _IOWR('i', 138, struct ath_diag)
#define SIOCGATHPHYERR _IOWR('i', 140, struct ath_diag)
struct ath_rateioctl_tlv {
uint16_t tlv_id;
uint16_t tlv_len;
};
#define ATH_RATE_TLV_MACADDR 0xaab0
#define ATH_RATE_TLV_RATETABLE_NENTRIES 64
struct ath_rateioctl_rt {
uint16_t nentries;
uint16_t pad[1];
uint8_t ratecode[ATH_RATE_TLV_RATETABLE_NENTRIES];
};
#define ATH_RATE_TLV_RATETABLE 0xaab1
#define ATH_RATE_TLV_SAMPLENODE 0xaab2
struct ath_rateioctl {
char if_name[IFNAMSIZ];
union {
uint8_t macaddr[IEEE80211_ADDR_LEN];
uint64_t pad;
} is_u;
uint32_t len;
caddr_t buf;
};
#define SIOCGATHNODERATESTATS _IOWR('i', 149, struct ath_rateioctl)
#define SIOCGATHRATESTATS _IOWR('i', 150, struct ath_rateioctl)
#define ATH_RX_RADIOTAP_PRESENT_BASE ( \
(1 << IEEE80211_RADIOTAP_TSFT) | \
(1 << IEEE80211_RADIOTAP_FLAGS) | \
(1 << IEEE80211_RADIOTAP_RATE) | \
(1 << IEEE80211_RADIOTAP_ANTENNA) | \
(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
(1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \
(1 << IEEE80211_RADIOTAP_XCHANNEL) | \
0)
#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT
#define ATH_RX_RADIOTAP_PRESENT \
(ATH_RX_RADIOTAP_PRESENT_BASE | \
(1 << IEEE80211_RADIOTAP_VENDOREXT) | \
(1 << IEEE80211_RADIOTAP_EXT) | \
0)
#else
#define ATH_RX_RADIOTAP_PRESENT ATH_RX_RADIOTAP_PRESENT_BASE
#endif
#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT
#define ATH_RADIOTAP_VENDOR_HEADER 8
#define ATH_RADIOTAP_MAX_CHAINS 4
#define ATH_RADIOTAP_MAX_EVM 5
struct ath_radiotap_vendor_hdr {
uint8_t vh_version;
uint8_t vh_rx_chainmask;
uint32_t evm[ATH_RADIOTAP_MAX_EVM];
uint8_t rssi_ctl[ATH_RADIOTAP_MAX_CHAINS];
uint8_t rssi_ext[ATH_RADIOTAP_MAX_CHAINS];
uint8_t vh_phyerr_code;
uint8_t vh_rs_status;
uint8_t vh_rssi;
uint8_t vh_flags;
#define ATH_VENDOR_PKT_RX 0x01
#define ATH_VENDOR_PKT_TX 0x02
#define ATH_VENDOR_PKT_RXPHYERR 0x04
#define ATH_VENDOR_PKT_ISAGGR 0x08
#define ATH_VENDOR_PKT_MOREAGGR 0x10
uint8_t vh_rx_hwrate;
uint8_t vh_rs_flags;
uint8_t vh_pad[2];
} __packed;
#endif
struct ath_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT
uint32_t wr_ext_bitmap;
uint32_t wr_pad1;
#endif
u_int64_t wr_tsf;
u_int8_t wr_flags;
u_int8_t wr_rate;
int8_t wr_antsignal;
int8_t wr_antnoise;
u_int8_t wr_antenna;
u_int8_t wr_pad[3];
u_int32_t wr_chan_flags;
u_int16_t wr_chan_freq;
u_int8_t wr_chan_ieee;
int8_t wr_chan_maxpow;
#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT
struct ieee80211_radiotap_vendor_header wr_vh;
struct ath_radiotap_vendor_hdr wr_v;
#endif
} __packed __aligned(8);
#define ATH_TX_RADIOTAP_PRESENT ( \
(1 << IEEE80211_RADIOTAP_FLAGS) | \
(1 << IEEE80211_RADIOTAP_RATE) | \
(1 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \
(1 << IEEE80211_RADIOTAP_ANTENNA) | \
(1 << IEEE80211_RADIOTAP_XCHANNEL) | \
0)
struct ath_tx_radiotap_header {
struct ieee80211_radiotap_header wt_ihdr;
u_int8_t wt_flags;
u_int8_t wt_rate;
u_int8_t wt_txpower;
u_int8_t wt_antenna;
u_int32_t wt_chan_flags;
u_int16_t wt_chan_freq;
u_int8_t wt_chan_ieee;
int8_t wt_chan_maxpow;
} __packed;
#define DFS_SET_THRESH 2
#define DFS_GET_THRESH 3
#define DFS_RADARDETECTS 6
#define DFS_PARAM_FIRPWR 1
#define DFS_PARAM_RRSSI 2
#define DFS_PARAM_HEIGHT 3
#define DFS_PARAM_PRSSI 4
#define DFS_PARAM_INBAND 5
#define DFS_PARAM_NOL 6
#define DFS_PARAM_RELSTEP_EN 7
#define DFS_PARAM_RELSTEP 8
#define DFS_PARAM_RELPWR_EN 9
#define DFS_PARAM_RELPWR 10
#define DFS_PARAM_MAXLEN 11
#define DFS_PARAM_USEFIR128 12
#define DFS_PARAM_BLOCKRADAR 13
#define DFS_PARAM_MAXRSSI_EN 14
#define DFS_PARAM_ENABLE 32
#define DFS_PARAM_EN_EXTCH 33
#define SPECTRAL_PARAM_FFT_PERIOD 1
#define SPECTRAL_PARAM_SS_PERIOD 2
#define SPECTRAL_PARAM_SS_COUNT 3
#define SPECTRAL_PARAM_SS_SHORT_RPT 4
#define SPECTRAL_PARAM_ENABLED 5
#define SPECTRAL_PARAM_ACTIVE 6
#define SPECTRAL_PARAM_SS_SPECTRAL_PRI 7
#define SIOCGATHSPECTRAL _IOWR('i', 151, struct ath_diag)
#define SPECTRAL_CONTROL_ENABLE 2
#define SPECTRAL_CONTROL_DISABLE 3
#define SPECTRAL_CONTROL_START 4
#define SPECTRAL_CONTROL_STOP 5
#define SPECTRAL_CONTROL_GET_PARAMS 6
#define SPECTRAL_CONTROL_SET_PARAMS 7
#define SPECTRAL_CONTROL_ENABLE_AT_RESET 8
#define SPECTRAL_CONTROL_DISABLE_AT_RESET 9
#define SIOCGATHBTCOEX _IOWR('i', 152, struct ath_diag)
#endif