1cf4c5a53SSam Leffler /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3718cf2ccSPedro F. Giffuni * 4cf4c5a53SSam Leffler * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting 5cf4c5a53SSam Leffler * Copyright (c) 2007-2009 Marvell Semiconductor, Inc. 6cf4c5a53SSam Leffler * All rights reserved. 7cf4c5a53SSam Leffler * 8cf4c5a53SSam Leffler * Redistribution and use in source and binary forms, with or without 9cf4c5a53SSam Leffler * modification, are permitted provided that the following conditions 10cf4c5a53SSam Leffler * are met: 11cf4c5a53SSam Leffler * 1. Redistributions of source code must retain the above copyright 12cf4c5a53SSam Leffler * notice, this list of conditions and the following disclaimer, 13cf4c5a53SSam Leffler * without modification. 14cf4c5a53SSam Leffler * 2. Redistributions in binary form must reproduce at minimum a disclaimer 15cf4c5a53SSam Leffler * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 16cf4c5a53SSam Leffler * redistribution must be conditioned upon including a substantially 17cf4c5a53SSam Leffler * similar Disclaimer requirement for further binary redistribution. 18cf4c5a53SSam Leffler * 19cf4c5a53SSam Leffler * NO WARRANTY 20cf4c5a53SSam Leffler * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21cf4c5a53SSam Leffler * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22cf4c5a53SSam Leffler * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 23cf4c5a53SSam Leffler * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24cf4c5a53SSam Leffler * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 25cf4c5a53SSam Leffler * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26cf4c5a53SSam Leffler * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27cf4c5a53SSam Leffler * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 28cf4c5a53SSam Leffler * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29cf4c5a53SSam Leffler * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30cf4c5a53SSam Leffler * THE POSSIBILITY OF SUCH DAMAGES. 31cf4c5a53SSam Leffler */ 32cf4c5a53SSam Leffler 33cf4c5a53SSam Leffler /* 34cf4c5a53SSam Leffler * Ioctl-related defintions for the Marvel Wireless LAN controller driver. 35cf4c5a53SSam Leffler */ 36cf4c5a53SSam Leffler #ifndef _DEV_MWL_MVIOCTL_H 37cf4c5a53SSam Leffler #define _DEV_MWL_MVIOCTL_H 38cf4c5a53SSam Leffler 39cf4c5a53SSam Leffler struct mwl_stats { 40cf4c5a53SSam Leffler struct mwl_hal_hwstats hw_stats; /* XXX tied to h/w defs */ 41cf4c5a53SSam Leffler uint32_t mst_failure; /* generic hardware failure */ 42cf4c5a53SSam Leffler uint32_t mst_rx_badtkipicv; 43cf4c5a53SSam Leffler uint32_t mst_tx_discard; 44cf4c5a53SSam Leffler uint32_t mst_tx_qstop; 45cf4c5a53SSam Leffler uint32_t mst_tx_encap; 46cf4c5a53SSam Leffler uint32_t mst_tx_mgmt; 47cf4c5a53SSam Leffler uint32_t mst_rx_nombuf; 48cf4c5a53SSam Leffler uint32_t mst_rx_busdma; 49cf4c5a53SSam Leffler uint32_t mst_rx_tooshort; 50cf4c5a53SSam Leffler uint32_t mst_tx_busdma; 51cf4c5a53SSam Leffler uint32_t mst_tx_linear; 52cf4c5a53SSam Leffler uint32_t mst_tx_nombuf; 53cf4c5a53SSam Leffler uint32_t mst_tx_nodata; 54cf4c5a53SSam Leffler uint32_t mst_tx_shortpre; 55cf4c5a53SSam Leffler uint32_t mst_tx_retries; 56cf4c5a53SSam Leffler uint32_t mst_tx_mretries; 57cf4c5a53SSam Leffler uint32_t mst_tx_linkerror; 58cf4c5a53SSam Leffler uint32_t mst_tx_xretries; 59cf4c5a53SSam Leffler uint32_t mst_tx_aging; 60cf4c5a53SSam Leffler uint32_t mst_tx_qdrop; 61cf4c5a53SSam Leffler uint32_t mst_ff_txerr; 62cf4c5a53SSam Leffler uint32_t mst_watchdog; 63cf4c5a53SSam Leffler uint32_t mst_tx_packets; 64cf4c5a53SSam Leffler uint32_t mst_rx_packets; 65cf4c5a53SSam Leffler int8_t mst_rx_rssi; 66cf4c5a53SSam Leffler int8_t mst_rx_noise; 67cf4c5a53SSam Leffler uint8_t mst_tx_rate; 68cf4c5a53SSam Leffler uint32_t mst_ant_tx[4]; 69cf4c5a53SSam Leffler uint32_t mst_ant_rx[4]; 70cf4c5a53SSam Leffler uint32_t mst_tx_tso; 71cf4c5a53SSam Leffler uint32_t mst_tso_badeth; 72cf4c5a53SSam Leffler uint32_t mst_tso_nohdr; 73cf4c5a53SSam Leffler uint32_t mst_tso_badsplit; 74cf4c5a53SSam Leffler uint32_t mst_rx_crypto; 75cf4c5a53SSam Leffler uint32_t mst_rx_tkipmic; 76cf4c5a53SSam Leffler uint32_t mst_rx_nodmabuf; 77cf4c5a53SSam Leffler uint32_t mst_tx_noheadroom; 78cf4c5a53SSam Leffler uint32_t mst_tx_badframetype; 79cf4c5a53SSam Leffler uint32_t mst_ampdu_nostream; 80cf4c5a53SSam Leffler uint32_t mst_ampdu_reject; 81cf4c5a53SSam Leffler uint32_t mst_addba_nostream; 82cf4c5a53SSam Leffler uint32_t mst_bacreate_failed; 83cf4c5a53SSam Leffler uint32_t mst_bawatchdog; 84cf4c5a53SSam Leffler uint32_t mst_radardetect; 85cf4c5a53SSam Leffler uint32_t mst_rx_dmabufmissing; 86cf4c5a53SSam Leffler uint32_t mst_bawatchdog_notfound; 87cf4c5a53SSam Leffler uint32_t mst_bawatchdog_empty; 88cf4c5a53SSam Leffler uint32_t mst_bawatchdog_failed; 89cf4c5a53SSam Leffler uint32_t mst_rxbuf_failed; 90cf4c5a53SSam Leffler uint32_t mst_pad[31]; 91cf4c5a53SSam Leffler }; 92cf4c5a53SSam Leffler 93cf4c5a53SSam Leffler #define SIOCGMVSTATS _IOWR('i', 137, struct ifreq) 94cf4c5a53SSam Leffler 95cf4c5a53SSam Leffler /* 96cf4c5a53SSam Leffler * Radio capture format. 97cf4c5a53SSam Leffler */ 98cf4c5a53SSam Leffler #define MWL_RX_RADIOTAP_PRESENT ( \ 99cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_FLAGS) | \ 100cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_RATE) | \ 101cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 102cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_ANTENNA) | \ 103cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ 104cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ 105cf4c5a53SSam Leffler 0) 106cf4c5a53SSam Leffler 107cf4c5a53SSam Leffler struct mwl_rx_radiotap_header { 108cf4c5a53SSam Leffler struct ieee80211_radiotap_header wr_ihdr; 109cf4c5a53SSam Leffler u_int8_t wr_flags; 110cf4c5a53SSam Leffler u_int8_t wr_rate; 111cf4c5a53SSam Leffler u_int16_t wr_chan_freq; 112cf4c5a53SSam Leffler u_int16_t wr_chan_flags; 113cf4c5a53SSam Leffler int8_t wr_antsignal; 114cf4c5a53SSam Leffler int8_t wr_antnoise; 115cf4c5a53SSam Leffler u_int8_t wr_antenna; 116786ac703SAndriy Voskoboinyk } __packed __aligned(8); 117cf4c5a53SSam Leffler 118cf4c5a53SSam Leffler #define MWL_TX_RADIOTAP_PRESENT ( \ 119cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_FLAGS) | \ 120cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_RATE) | \ 121cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 122cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \ 123cf4c5a53SSam Leffler (1 << IEEE80211_RADIOTAP_ANTENNA) | \ 124cf4c5a53SSam Leffler 0) 125cf4c5a53SSam Leffler 126cf4c5a53SSam Leffler struct mwl_tx_radiotap_header { 127cf4c5a53SSam Leffler struct ieee80211_radiotap_header wt_ihdr; 128cf4c5a53SSam Leffler u_int8_t wt_flags; 129cf4c5a53SSam Leffler u_int8_t wt_rate; 130cf4c5a53SSam Leffler u_int16_t wt_chan_freq; 131cf4c5a53SSam Leffler u_int16_t wt_chan_flags; 132cf4c5a53SSam Leffler u_int8_t wt_txpower; 133cf4c5a53SSam Leffler u_int8_t wt_antenna; 134786ac703SAndriy Voskoboinyk } __packed; 135cf4c5a53SSam Leffler 136cf4c5a53SSam Leffler #endif /* _DEV_MWL_MVIOCTL_H */ 137