if_urtwnreg.h revision 1.12 1 /* $NetBSD: if_urtwnreg.h,v 1.12 2018/06/29 04:02:10 thorpej Exp $ */
2 /* $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $ */
3
4 /*-
5 * Copyright (c) 2010 Damien Bergamini <damien.bergamini (at) free.fr>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 #ifndef _DEV_USB_URTWNREG_H_
21 #define _DEV_USB_URTWNREG_H_
22
23 #define URTWN_NOISE_FLOOR -95
24
25 /* Maximum number of output pipes is 3. */
26 #define R92C_MAX_EPOUT 3
27 #define R92C_MAX_EPIN 3
28
29 #define R92C_PUBQ_NPAGES 231
30 #define R92C_TXPKTBUF_COUNT 256
31 #define R92C_TX_PAGE_COUNT 248
32 #define R92C_TX_PAGE_BOUNDARY (R92C_TX_PAGE_COUNT + 1)
33 #define R88E_TXPKTBUF_COUNT 177
34 #define R88E_TX_PAGE_COUNT 169
35 #define R88E_TX_PAGE_BOUNDARY (R88E_TX_PAGE_COUNT + 1)
36 #define R92E_TXPKTBUF_COUNT 256
37 #define R92E_TX_PAGE_COUNT 243
38 #define R92E_TX_PAGE_BOUNDARY (R92E_TX_PAGE_COUNT + 1)
39 #define R92C_TXDESC_SUMSIZE 32
40
41 /* USB Requests. */
42 #define R92C_REQ_REGS 0x05
43
44 #define R92E_RF_T_METER 0x042
45 #define R92E_STBC_SETTING 0x04c4
46 #define R92E_SYS_CFG1_8192E 0x00f0
47 #define R92E_LDO_SWR_CTRL 0x007C
48 #define R92E_AUTO_LLT 0x224
49 #define R92E_AUTO_LLT_EN __BIT(16)
50 #define R92E_RSV_MIO_EN 0x0100
51 #define R92E_LEDSON 0x60
52
53 /* Bits for SYS_CFG1_8192E. */
54 #define R92E_SPSLDO_SEL __BIT(24)
55
56 /* Values for R92C_CMD_USB_SUSPEND. */
57 #define USB_RESUME 0
58 #define USB_SLEEP 1
59
60 /* Values for IQ calibration. */
61 #define R92C_IQK_TRXPATHENA 0x5600
62 #define R92C_IQK_TRMUXPAR 0x00e4
63 #define R92C_IQK_RFIFACESW1 0x8200
64 #define R92C_IQK_LSSI_PARAM 0x00010000
65 #define R92C_IQK_LSSI_RESTORE 0x00032ed3
66 #define R92C_IQK_CONFIG_ANT 0x00080000
67 #define R92C_TX_IQK_SETTING 0x01007c00
68 #define R92C_RX_IQK_SETTING 0x01004800
69 #define R92C_FPGA0_IQK_SETTING 0x80800000
70
71 #endif /* _DEV_USB_URTWNREG_H_ */
72