1*7453645fSAndriy Voskoboinyk /*- 2*7453645fSAndriy Voskoboinyk * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> 3*7453645fSAndriy Voskoboinyk * Copyright (c) 2015-2016 Andriy Voskoboinyk <avos@FreeBSD.org> 4*7453645fSAndriy Voskoboinyk * 5*7453645fSAndriy Voskoboinyk * Permission to use, copy, modify, and distribute this software for any 6*7453645fSAndriy Voskoboinyk * purpose with or without fee is hereby granted, provided that the above 7*7453645fSAndriy Voskoboinyk * copyright notice and this permission notice appear in all copies. 8*7453645fSAndriy Voskoboinyk * 9*7453645fSAndriy Voskoboinyk * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10*7453645fSAndriy Voskoboinyk * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11*7453645fSAndriy Voskoboinyk * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12*7453645fSAndriy Voskoboinyk * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13*7453645fSAndriy Voskoboinyk * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14*7453645fSAndriy Voskoboinyk * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15*7453645fSAndriy Voskoboinyk * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16*7453645fSAndriy Voskoboinyk * 17*7453645fSAndriy Voskoboinyk * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $ 18*7453645fSAndriy Voskoboinyk */ 19*7453645fSAndriy Voskoboinyk 20*7453645fSAndriy Voskoboinyk #ifndef R88E_RX_DESC_H 21*7453645fSAndriy Voskoboinyk #define R88E_RX_DESC_H 22*7453645fSAndriy Voskoboinyk 23*7453645fSAndriy Voskoboinyk #include <dev/rtwn/rtl8192c/r92c_rx_desc.h> 24*7453645fSAndriy Voskoboinyk 25*7453645fSAndriy Voskoboinyk /* Rx MAC descriptor defines (chip-specific). */ 26*7453645fSAndriy Voskoboinyk /* Rx dword 3 */ 27*7453645fSAndriy Voskoboinyk #define R88E_RXDW3_RPT_M 0x0000c000 28*7453645fSAndriy Voskoboinyk #define R88E_RXDW3_RPT_S 14 29*7453645fSAndriy Voskoboinyk #define R88E_RXDW3_RPT_RX 0 30*7453645fSAndriy Voskoboinyk #define R88E_RXDW3_RPT_TX1 1 31*7453645fSAndriy Voskoboinyk #define R88E_RXDW3_RPT_TX2 2 32*7453645fSAndriy Voskoboinyk #define R88E_RXDW3_RPT_HIS 3 33*7453645fSAndriy Voskoboinyk 34*7453645fSAndriy Voskoboinyk /* Rx PHY descriptor. */ 35*7453645fSAndriy Voskoboinyk struct r88e_rx_phystat { 36*7453645fSAndriy Voskoboinyk uint8_t path_agc[2]; 37*7453645fSAndriy Voskoboinyk uint8_t chan; 38*7453645fSAndriy Voskoboinyk uint8_t reserved1; 39*7453645fSAndriy Voskoboinyk uint8_t sig_qual; 40*7453645fSAndriy Voskoboinyk uint8_t agc_rpt; 41*7453645fSAndriy Voskoboinyk uint8_t rpt_b; 42*7453645fSAndriy Voskoboinyk uint8_t reserved2; 43*7453645fSAndriy Voskoboinyk uint8_t noise_power; 44*7453645fSAndriy Voskoboinyk uint8_t path_cfotail[2]; 45*7453645fSAndriy Voskoboinyk uint8_t pcts_mask[2]; 46*7453645fSAndriy Voskoboinyk uint8_t stream_rxevm[2]; 47*7453645fSAndriy Voskoboinyk uint8_t path_rxsnr[2]; 48*7453645fSAndriy Voskoboinyk uint8_t noise_power_db_lsb; 49*7453645fSAndriy Voskoboinyk uint8_t reserved3[3]; 50*7453645fSAndriy Voskoboinyk uint8_t stream_csi[2]; 51*7453645fSAndriy Voskoboinyk uint8_t stream_target_csi[2]; 52*7453645fSAndriy Voskoboinyk uint8_t sig_evm; 53*7453645fSAndriy Voskoboinyk } __packed; 54*7453645fSAndriy Voskoboinyk 55*7453645fSAndriy Voskoboinyk /* Tx report (type 1). */ 56*7453645fSAndriy Voskoboinyk struct r88e_tx_rpt_ccx { 57*7453645fSAndriy Voskoboinyk uint8_t rptb0; 58*7453645fSAndriy Voskoboinyk #define R88E_RPTB6_PKT_NUM_M 0x0e 59*7453645fSAndriy Voskoboinyk #define R88E_RPTB6_PKT_NUM_S 1 60*7453645fSAndriy Voskoboinyk #define R88E_RPTB0_INT_CCX 0x80 61*7453645fSAndriy Voskoboinyk 62*7453645fSAndriy Voskoboinyk uint8_t rptb1; 63*7453645fSAndriy Voskoboinyk #define R88E_RPTB1_MACID_M 0x3f 64*7453645fSAndriy Voskoboinyk #define R88E_RPTB1_MACID_S 0 65*7453645fSAndriy Voskoboinyk #define R88E_RPTB1_PKT_OK 0x40 66*7453645fSAndriy Voskoboinyk #define R88E_RPTB1_BMC 0x80 67*7453645fSAndriy Voskoboinyk 68*7453645fSAndriy Voskoboinyk uint8_t rptb2; 69*7453645fSAndriy Voskoboinyk #define R88E_RPTB2_RETRY_CNT_M 0x3f 70*7453645fSAndriy Voskoboinyk #define R88E_RPTB2_RETRY_CNT_S 0 71*7453645fSAndriy Voskoboinyk #define R88E_RPTB2_LIFE_EXPIRE 0x40 72*7453645fSAndriy Voskoboinyk #define R88E_RPTB2_RETRY_OVER 0x80 73*7453645fSAndriy Voskoboinyk 74*7453645fSAndriy Voskoboinyk uint8_t queue_time_low; 75*7453645fSAndriy Voskoboinyk uint8_t queue_time_high; 76*7453645fSAndriy Voskoboinyk uint8_t final_rate; 77*7453645fSAndriy Voskoboinyk uint8_t rptb6; 78*7453645fSAndriy Voskoboinyk #define R88E_RPTB6_QSEL_M 0xf0 79*7453645fSAndriy Voskoboinyk #define R88E_RPTB6_QSEL_S 4 80*7453645fSAndriy Voskoboinyk 81*7453645fSAndriy Voskoboinyk uint8_t rptb7; 82*7453645fSAndriy Voskoboinyk } __packed; 83*7453645fSAndriy Voskoboinyk 84*7453645fSAndriy Voskoboinyk /* Interrupt message format. */ 85*7453645fSAndriy Voskoboinyk /* XXX recheck */ 86*7453645fSAndriy Voskoboinyk struct r88e_intr_msg { 87*7453645fSAndriy Voskoboinyk uint8_t c2h_id; 88*7453645fSAndriy Voskoboinyk uint8_t c2h_seq; 89*7453645fSAndriy Voskoboinyk uint8_t c2h_evt; 90*7453645fSAndriy Voskoboinyk uint8_t reserved1[13]; 91*7453645fSAndriy Voskoboinyk uint8_t cpwm1; 92*7453645fSAndriy Voskoboinyk uint8_t reserved2[3]; 93*7453645fSAndriy Voskoboinyk uint8_t cpwm2; 94*7453645fSAndriy Voskoboinyk uint8_t reserved3[27]; 95*7453645fSAndriy Voskoboinyk uint32_t hisr; 96*7453645fSAndriy Voskoboinyk uint32_t hisr_ex; 97*7453645fSAndriy Voskoboinyk }; 98*7453645fSAndriy Voskoboinyk 99*7453645fSAndriy Voskoboinyk #endif /* R88E_RX_DESC_H */ 100