xref: /freebsd/sys/dev/rtwn/rtl8188e/r88e_reg.h (revision d6b92ffa)
1 /*-
2  * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
3  * Copyright (c) 2015-2016 Andriy Voskoboinyk <avos@FreeBSD.org>
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  *
17  * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $
18  * $FreeBSD$
19  */
20 
21 #ifndef R88E_REG_H
22 #define R88E_REG_H
23 
24 #include <dev/rtwn/rtl8192c/r92c_reg.h>
25 
26 /*
27  * MAC registers.
28  */
29 /* System Configuration. */
30 #define R88E_BB_PAD_CTRL		0x064
31 #define R88E_HIMR			0x0b0
32 #define R88E_HISR			0x0b4
33 #define R88E_HIMRE			0x0b8
34 #define R88E_HISRE			0x0bc
35 /* MAC General Configuration. */
36 #define R88E_32K_CTRL			0x194
37 #define R88E_HMEBOX_EXT(idx)		(0x1f0 + (idx) * 4)
38 /* Protocol Configuration. */
39 #define R88E_TXPKTBUF_BCNQ1_BDNY	0x457
40 #define R88E_MACID_NO_LINK		0x484
41 #define R88E_TX_RPT_CTRL		0x4ec
42 #define R88E_TX_RPT_MACID_MAX		0x4ed
43 #define R88E_TX_RPT_TIME		0x4f0
44 #define R88E_SCH_TXCMD			0x5f8
45 
46 
47 /* Bits for R88E_HIMR. */
48 #define R88E_HIMR_CPWM			0x00000100
49 #define R88E_HIMR_CPWM2			0x00000200
50 #define R88E_HIMR_TBDER			0x04000000
51 #define R88E_HIMR_PSTIMEOUT		0x20000000
52 
53 /* Bits for R88E_HIMRE.*/
54 #define R88E_HIMRE_RXFOVW		0x00000100
55 #define R88E_HIMRE_TXFOVW		0x00000200
56 #define R88E_HIMRE_RXERR		0x00000400
57 #define R88E_HIMRE_TXERR		0x00000800
58 
59 /* Bits for R88E_TX_RPT_CTRL. */
60 #define R88E_TX_RPT1_ENA		0x01
61 #define R88E_TX_RPT2_ENA		0x02
62 
63 /* Bits for R92C_MBID_NUM. */
64 #define R88E_MBID_TXBCN_RPT(id)		(0x08 << (id))
65 
66 /* Bits for R92C_SECCFG. */
67 #define R88E_SECCFG_CHK_KEYID	0x0100
68 
69 
70 /*
71  * Baseband registers.
72  */
73 /* Bits for R92C_LSSI_PARAM(i). */
74 #define R88E_LSSI_PARAM_ADDR_M	0x0ff00000
75 #define R88E_LSSI_PARAM_ADDR_S	20
76 
77 
78 /*
79  * RF (6052) registers.
80  */
81 #define R88E_RF_T_METER		0x42
82 
83 /* Bits for R92C_RF_CHNLBW. */
84 #define R88E_RF_CHNLBW_BW20	0x00c00
85 
86 /* Bits for R88E_RF_T_METER. */
87 #define R88E_RF_T_METER_VAL_M	0x0fc00
88 #define R88E_RF_T_METER_VAL_S	10
89 #define R88E_RF_T_METER_START	0x30000
90 
91 #endif	/* R88E_REG_H */
92