xref: /freebsd/sys/dev/rtwn/rtl8188e/r88e.h (revision d6b92ffa)
1 /*-
2  * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
3  * Copyright (c) 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 RTL8188E_H
22 #define RTL8188E_H
23 
24 /*
25  * Global definitions.
26  */
27 #define R88E_PUBQ_NPAGES	142
28 #define R88E_TXPKTBUF_COUNT	177
29 #define R88E_TX_PAGE_COUNT	169
30 
31 #define R88E_MACID_MAX		63
32 #define R88E_RX_DMA_BUFFER_SIZE	0x2400
33 
34 #define R88E_INTR_MSG_LEN	60
35 
36 #define R88E_CALIB_THRESHOLD	4
37 
38 
39 /*
40  * Function declarations.
41  */
42 /* r88e_beacon.c */
43 void	r88e_beacon_enable(struct rtwn_softc *, int, int);
44 
45 /* r88e_calib.c */
46 void	r88e_iq_calib(struct rtwn_softc *);
47 void	r88e_temp_measure(struct rtwn_softc *);
48 uint8_t	r88e_temp_read(struct rtwn_softc *);
49 
50 /* r88e_chan.c */
51 void	r88e_get_txpower(struct rtwn_softc *, int,
52 	    struct ieee80211_channel *, uint16_t[]);
53 void	r88e_set_bw20(struct rtwn_softc *, uint8_t);
54 void	r88e_set_gain(struct rtwn_softc *, uint8_t);
55 
56 /* r88e_fw.c */
57 #ifndef RTWN_WITHOUT_UCODE
58 int	r88e_fw_cmd(struct rtwn_softc *, uint8_t, const void *, int);
59 void	r88e_fw_reset(struct rtwn_softc *, int);
60 void	r88e_fw_download_enable(struct rtwn_softc *, int);
61 #endif
62 void	r88e_macid_enable_link(struct rtwn_softc *, int, int);
63 void	r88e_set_media_status(struct rtwn_softc *, int);
64 #ifndef RTWN_WITHOUT_UCODE
65 int	r88e_set_rsvd_page(struct rtwn_softc *, int, int, int);
66 int	r88e_set_pwrmode(struct rtwn_softc *, struct ieee80211vap *, int);
67 #endif
68 
69 /* r88e_init.c */
70 void	r88e_init_bb(struct rtwn_softc *);
71 void	r88e_init_rf(struct rtwn_softc *);
72 int	r88e_power_on(struct rtwn_softc *);
73 
74 /* r88e_led.c */
75 void	r88e_set_led(struct rtwn_softc *, int, int);
76 
77 /* r88e_rf.c */
78 void	r88e_rf_write(struct rtwn_softc *, int, uint8_t, uint32_t);
79 
80 /* r88e_rom.c */
81 void	r88e_parse_rom(struct rtwn_softc *, uint8_t *);
82 
83 /* r88e_rx.c */
84 void	r88e_ratectl_tx_complete(struct rtwn_softc *, uint8_t *, int);
85 void	r88e_handle_c2h_report(struct rtwn_softc *, uint8_t *, int);
86 int8_t	r88e_get_rssi_cck(struct rtwn_softc *, void *);
87 int8_t	r88e_get_rssi_ofdm(struct rtwn_softc *, void *);
88 void	r88e_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *,
89 	    const void *, const void *);
90 
91 /* r88e_tx.c */
92 void	r88e_tx_enable_ampdu(void *, int);
93 void	r88e_tx_setup_hwseq(void *);
94 void	r88e_tx_setup_macid(void *, int);
95 
96 #endif	/* RTL8188E_H */
97