13c7e78d3SWeongyo Jeong /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3718cf2ccSPedro F. Giffuni * 43c7e78d3SWeongyo Jeong * Copyright (c) 2007 Marvell Semiconductor, Inc. 53c7e78d3SWeongyo Jeong * Copyright (c) 2007 Sam Leffler, Errno Consulting 63c7e78d3SWeongyo Jeong * Copyright (c) 2008 Weongyo Jeong <weongyo@freebsd.org> 73c7e78d3SWeongyo Jeong * All rights reserved. 83c7e78d3SWeongyo Jeong * 93c7e78d3SWeongyo Jeong * Redistribution and use in source and binary forms, with or without 103c7e78d3SWeongyo Jeong * modification, are permitted provided that the following conditions 113c7e78d3SWeongyo Jeong * are met: 123c7e78d3SWeongyo Jeong * 1. Redistributions of source code must retain the above copyright 133c7e78d3SWeongyo Jeong * notice, this list of conditions and the following disclaimer, 143c7e78d3SWeongyo Jeong * without modification. 153c7e78d3SWeongyo Jeong * 2. Redistributions in binary form must reproduce at minimum a disclaimer 163c7e78d3SWeongyo Jeong * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 173c7e78d3SWeongyo Jeong * redistribution must be conditioned upon including a substantially 183c7e78d3SWeongyo Jeong * similar Disclaimer requirement for further binary redistribution. 193c7e78d3SWeongyo Jeong * 203c7e78d3SWeongyo Jeong * NO WARRANTY 213c7e78d3SWeongyo Jeong * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 223c7e78d3SWeongyo Jeong * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 233c7e78d3SWeongyo Jeong * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 243c7e78d3SWeongyo Jeong * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 253c7e78d3SWeongyo Jeong * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 263c7e78d3SWeongyo Jeong * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 273c7e78d3SWeongyo Jeong * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 283c7e78d3SWeongyo Jeong * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 293c7e78d3SWeongyo Jeong * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 303c7e78d3SWeongyo Jeong * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 313c7e78d3SWeongyo Jeong * THE POSSIBILITY OF SUCH DAMAGES. 323c7e78d3SWeongyo Jeong */ 333c7e78d3SWeongyo Jeong 343c7e78d3SWeongyo Jeong /* 353c7e78d3SWeongyo Jeong * Ioctl-related defintions for the Marvel Wireless LAN controller driver. 363c7e78d3SWeongyo Jeong */ 373c7e78d3SWeongyo Jeong #ifndef _DEV_MALO_MVIOCTL_H 383c7e78d3SWeongyo Jeong #define _DEV_MALO_MVIOCTL_H 393c7e78d3SWeongyo Jeong 403c7e78d3SWeongyo Jeong struct malo_stats { 413c7e78d3SWeongyo Jeong struct malo_hal_hwstats hw_stats; /* XXX tied to h/w defs */ 423c7e78d3SWeongyo Jeong uint32_t mst_failure; /* generic hardware failure */ 433c7e78d3SWeongyo Jeong uint32_t mst_rx_badtkipicv; 443c7e78d3SWeongyo Jeong uint32_t mst_tx_discard; 453c7e78d3SWeongyo Jeong uint32_t mst_tx_qstop; 463c7e78d3SWeongyo Jeong uint32_t mst_tx_encap; 473c7e78d3SWeongyo Jeong uint32_t mst_tx_mgmt; 483c7e78d3SWeongyo Jeong uint32_t mst_rx_nombuf; 493c7e78d3SWeongyo Jeong uint32_t mst_rx_busdma; 503c7e78d3SWeongyo Jeong uint32_t mst_rx_tooshort; 513c7e78d3SWeongyo Jeong uint32_t mst_tx_busdma; 523c7e78d3SWeongyo Jeong uint32_t mst_tx_linear; 533c7e78d3SWeongyo Jeong uint32_t mst_tx_nombuf; 543c7e78d3SWeongyo Jeong uint32_t mst_tx_nodata; 553c7e78d3SWeongyo Jeong uint32_t mst_tx_shortpre; 563c7e78d3SWeongyo Jeong uint32_t mst_tx_retries; 573c7e78d3SWeongyo Jeong uint32_t mst_tx_mretries; 583c7e78d3SWeongyo Jeong uint32_t mst_tx_linkerror; 593c7e78d3SWeongyo Jeong uint32_t mst_tx_xretries; 603c7e78d3SWeongyo Jeong uint32_t mst_tx_aging; 613c7e78d3SWeongyo Jeong uint32_t mst_watchdog; 623c7e78d3SWeongyo Jeong uint32_t mst_tx_packets; 633c7e78d3SWeongyo Jeong uint32_t mst_rx_packets; 643c7e78d3SWeongyo Jeong int8_t mst_rx_rssi; 653c7e78d3SWeongyo Jeong int8_t mst_rx_noise; 663c7e78d3SWeongyo Jeong uint8_t mst_tx_rate; 673c7e78d3SWeongyo Jeong uint32_t mst_ant_tx[4]; 683c7e78d3SWeongyo Jeong uint32_t mst_ant_rx[4]; 693c7e78d3SWeongyo Jeong }; 703c7e78d3SWeongyo Jeong 713c7e78d3SWeongyo Jeong #define SIOCGMVSTATS _IOWR('i', 137, struct ifreq) 723c7e78d3SWeongyo Jeong 733c7e78d3SWeongyo Jeong /* 743c7e78d3SWeongyo Jeong * Radio capture format. 753c7e78d3SWeongyo Jeong */ 763c7e78d3SWeongyo Jeong #define MALO_RX_RADIOTAP_PRESENT ( \ 773c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_FLAGS) | \ 783c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_RATE) | \ 793c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 803c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_ANTENNA) | \ 813c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ 823c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ 833c7e78d3SWeongyo Jeong 0) 843c7e78d3SWeongyo Jeong 853c7e78d3SWeongyo Jeong struct malo_rx_radiotap_header { 863c7e78d3SWeongyo Jeong struct ieee80211_radiotap_header wr_ihdr; 873c7e78d3SWeongyo Jeong u_int8_t wr_flags; 883c7e78d3SWeongyo Jeong u_int8_t wr_rate; 893c7e78d3SWeongyo Jeong u_int16_t wr_chan_freq; 903c7e78d3SWeongyo Jeong u_int16_t wr_chan_flags; 913c7e78d3SWeongyo Jeong int8_t wr_antsignal; 923c7e78d3SWeongyo Jeong int8_t wr_antnoise; 933c7e78d3SWeongyo Jeong u_int8_t wr_antenna; 94786ac703SAndriy Voskoboinyk } __packed __aligned(8); 953c7e78d3SWeongyo Jeong 963c7e78d3SWeongyo Jeong #define MALO_TX_RADIOTAP_PRESENT ( \ 973c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_FLAGS) | \ 983c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_RATE) | \ 993c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 1003c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \ 1013c7e78d3SWeongyo Jeong (1 << IEEE80211_RADIOTAP_ANTENNA) | \ 1023c7e78d3SWeongyo Jeong 0) 1033c7e78d3SWeongyo Jeong 1043c7e78d3SWeongyo Jeong struct malo_tx_radiotap_header { 1053c7e78d3SWeongyo Jeong struct ieee80211_radiotap_header wt_ihdr; 1063c7e78d3SWeongyo Jeong u_int8_t wt_flags; 1073c7e78d3SWeongyo Jeong u_int8_t wt_rate; 1083c7e78d3SWeongyo Jeong u_int16_t wt_chan_freq; 1093c7e78d3SWeongyo Jeong u_int16_t wt_chan_flags; 1103c7e78d3SWeongyo Jeong u_int8_t wt_txpower; 1113c7e78d3SWeongyo Jeong u_int8_t wt_antenna; 112786ac703SAndriy Voskoboinyk } __packed; 1133c7e78d3SWeongyo Jeong 1143c7e78d3SWeongyo Jeong #endif /* _DEV_MALO_MVIOCTL_H */ 115