source: rtems-libbsd/freebsd/sys/dev/rtwn/rtl8812a/r12a.h @ 0cbb715

55-freebsd-126-freebsd-12
Last change on this file since 0cbb715 was 0cbb715, checked in by Christian Mauderer <Christian.Mauderer@…>, on 11/22/16 at 09:41:47

rtwn: Import from FreeBSD.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*-
2 * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD$
27 */
28
29#ifndef RTL8812A_H
30#define RTL8812A_H
31
32/*
33 * Global definitions.
34 */
35#define R12A_PUBQ_NPAGES        219
36#define R12A_TXPKTBUF_COUNT     255
37#define R12A_TX_PAGE_COUNT      248
38
39#define R12A_TX_PAGE_SIZE       512
40#define R12A_RX_DMA_BUFFER_SIZE 0x3e80
41
42#define R12A_MAX_FW_SIZE        0x8000
43#define R12A_MACID_MAX          127
44#define R12A_CAM_ENTRY_COUNT    64
45
46#define R12A_INTR_MSG_LEN       60
47
48static const uint8_t r12a_chan_5ghz_0[] =
49        { 36, 40, 44, 48, 52, 56, 60, 64 };
50static const uint8_t r12a_chan_5ghz_1[] =
51        { 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144 };
52static const uint8_t r12a_chan_5ghz_2[] =
53        { 149, 153, 157, 161, 165, 169, 173, 177 };
54
55
56/*
57 * Function declarations.
58 */
59/* r12a_attach.c */
60void    r12a_vap_preattach(struct rtwn_softc *, struct ieee80211vap *);
61void    r12a_detach_private(struct rtwn_softc *);
62
63/* r12a_beacon.c */
64void    r12a_beacon_init(struct rtwn_softc *, void *, int);
65void    r12a_beacon_set_rate(void *, int);
66
67/* r12a_calib.c */
68void    r12a_save_bb_afe_vals(struct rtwn_softc *, uint32_t[],
69            const uint16_t[], int);
70void    r12a_restore_bb_afe_vals(struct rtwn_softc *, uint32_t[],
71            const uint16_t[], int);
72void    r12a_save_rf_vals(struct rtwn_softc *, uint32_t[],
73            const uint8_t[], int);
74void    r12a_restore_rf_vals(struct rtwn_softc *, uint32_t[],
75            const uint8_t[], int);
76void    r12a_lc_calib(struct rtwn_softc *);
77#ifndef RTWN_WITHOUT_UCODE
78int     r12a_iq_calib_fw_supported(struct rtwn_softc *);
79#endif
80void    r12a_iq_calib_sw(struct rtwn_softc *);
81void    r12a_iq_calib(struct rtwn_softc *);
82
83/* r12a_caps.c */
84int     r12a_ioctl_net(struct ieee80211com *, u_long, void *);
85
86/* r12a_chan.c */
87void    r12a_fix_spur(struct rtwn_softc *, struct ieee80211_channel *);
88void    r12a_set_chan(struct rtwn_softc *, struct ieee80211_channel *);
89void    r12a_set_band_2ghz(struct rtwn_softc *, uint32_t);
90void    r12a_set_band_5ghz(struct rtwn_softc *, uint32_t);
91
92/* r12a_fw.c */
93#ifndef RTWN_WITHOUT_UCODE
94void    r12a_fw_reset(struct rtwn_softc *, int);
95void    r12a_fw_download_enable(struct rtwn_softc *, int);
96void    r12a_set_media_status(struct rtwn_softc *, int);
97int     r12a_set_pwrmode(struct rtwn_softc *, struct ieee80211vap *,
98            int);
99void    r12a_iq_calib_fw(struct rtwn_softc *);
100#endif
101
102/* r12a_init.c */
103int     r12a_check_condition(struct rtwn_softc *, const uint8_t[]);
104int     r12a_set_page_size(struct rtwn_softc *);
105void    r12a_init_edca(struct rtwn_softc *);
106void    r12a_init_bb(struct rtwn_softc *);
107void    r12a_init_rf(struct rtwn_softc *);
108void    r12a_crystalcap_write(struct rtwn_softc *);
109int     r12a_power_on(struct rtwn_softc *);
110void    r12a_power_off(struct rtwn_softc *);
111void    r12a_init_intr(struct rtwn_softc *);
112void    r12a_init_antsel(struct rtwn_softc *);
113
114/* r12a_led.c */
115void    r12a_set_led(struct rtwn_softc *, int, int);
116
117/* r12a_rf.c */
118uint32_t        r12a_rf_read(struct rtwn_softc *, int, uint8_t);
119uint32_t        r12a_c_cut_rf_read(struct rtwn_softc *, int, uint8_t);
120void            r12a_rf_write(struct rtwn_softc *, int, uint8_t, uint32_t);
121
122/* r12a_rom.c */
123void    r12a_parse_rom_common(struct rtwn_softc *, uint8_t *);
124void    r12a_parse_rom(struct rtwn_softc *, uint8_t *);
125
126/* r12a_rx.c */
127void    r12a_ratectl_tx_complete(struct rtwn_softc *, uint8_t *, int);
128void    r12a_handle_c2h_report(struct rtwn_softc *, uint8_t *, int);
129int     r12a_check_frame_checksum(struct rtwn_softc *, struct mbuf *);
130uint8_t r12a_rx_radiotap_flags(const void *);
131
132/* r12a_tx.c */
133void    r12a_fill_tx_desc(struct rtwn_softc *, struct ieee80211_node *,
134            struct mbuf *, void *, uint8_t, int);
135void    r12a_fill_tx_desc_raw(struct rtwn_softc *, struct ieee80211_node *,
136            struct mbuf *, void *, const struct ieee80211_bpf_params *);
137void    r12a_fill_tx_desc_null(struct rtwn_softc *, void *, int, int, int);
138uint8_t r12a_tx_radiotap_flags(const void *);
139
140#endif  /* RTL8812A_H */
Note: See TracBrowser for help on using the repository browser.