160b9567dSKevin Lo /*- 260b9567dSKevin Lo * Copyright (c) 2017 Kevin Lo <kevlo@FreeBSD.org> 360b9567dSKevin Lo * All rights reserved. 460b9567dSKevin Lo * 560b9567dSKevin Lo * Redistribution and use in source and binary forms, with or without 660b9567dSKevin Lo * modification, are permitted provided that the following conditions 760b9567dSKevin Lo * are met: 860b9567dSKevin Lo * 1. Redistributions of source code must retain the above copyright 960b9567dSKevin Lo * notice, this list of conditions and the following disclaimer. 1060b9567dSKevin Lo * 2. Redistributions in binary form must reproduce the above copyright 1160b9567dSKevin Lo * notice, this list of conditions and the following disclaimer in the 1260b9567dSKevin Lo * documentation and/or other materials provided with the distribution. 1360b9567dSKevin Lo * 1460b9567dSKevin Lo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1560b9567dSKevin Lo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1660b9567dSKevin Lo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1760b9567dSKevin Lo * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1860b9567dSKevin Lo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1960b9567dSKevin Lo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2060b9567dSKevin Lo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2160b9567dSKevin Lo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2260b9567dSKevin Lo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2360b9567dSKevin Lo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2460b9567dSKevin Lo * SUCH DAMAGE. 2560b9567dSKevin Lo */ 2660b9567dSKevin Lo 2760b9567dSKevin Lo #ifndef RTL8192E_H 2860b9567dSKevin Lo #define RTL8192E_H 2960b9567dSKevin Lo 3060b9567dSKevin Lo /* 3160b9567dSKevin Lo * Global definitions. 3260b9567dSKevin Lo */ 3360b9567dSKevin Lo #define R92E_PUBQ_NPAGES 222 3460b9567dSKevin Lo #define R92E_TX_PAGE_COUNT 243 3560b9567dSKevin Lo 3660b9567dSKevin Lo #define R92E_TX_PAGE_SIZE 256 3760b9567dSKevin Lo #define R92E_RX_DMA_BUFFER_SIZE 0x3d00 3860b9567dSKevin Lo 3960b9567dSKevin Lo #define R92E_MAX_FW_SIZE 0x8000 4060b9567dSKevin Lo 4160b9567dSKevin Lo /* 4260b9567dSKevin Lo * Function declarations. 4360b9567dSKevin Lo */ 4460b9567dSKevin Lo /* r92e_attach.c */ 4560b9567dSKevin Lo void r92e_detach_private(struct rtwn_softc *); 4660b9567dSKevin Lo 4760b9567dSKevin Lo /* r92e_chan.c */ 4860b9567dSKevin Lo void r92e_set_chan(struct rtwn_softc *, struct ieee80211_channel *); 49*0ea7f8caSAdrian Chadd int r92e_set_tx_power(struct rtwn_softc *sc, struct ieee80211vap *vap); 5060b9567dSKevin Lo 5160b9567dSKevin Lo /* r92e_fw.c */ 5260b9567dSKevin Lo #ifndef RTWN_WITHOUT_UCODE 5360b9567dSKevin Lo void r92e_fw_reset(struct rtwn_softc *, int); 5460b9567dSKevin Lo void r92e_set_media_status(struct rtwn_softc *, int); 5560b9567dSKevin Lo int r92e_set_pwrmode(struct rtwn_softc *, struct ieee80211vap *, int); 5660b9567dSKevin Lo #endif 5760b9567dSKevin Lo 5860b9567dSKevin Lo /* r92e_init.c */ 5960b9567dSKevin Lo int r92e_llt_init(struct rtwn_softc *); 6060b9567dSKevin Lo void r92e_init_bb(struct rtwn_softc *); 6160b9567dSKevin Lo void r92e_init_rf(struct rtwn_softc *); 6260b9567dSKevin Lo int r92e_power_on(struct rtwn_softc *); 6360b9567dSKevin Lo void r92e_power_off(struct rtwn_softc *); 6460b9567dSKevin Lo 6560b9567dSKevin Lo /* r92e_led.c */ 6660b9567dSKevin Lo void r92e_set_led(struct rtwn_softc *, int, int); 6760b9567dSKevin Lo 6860b9567dSKevin Lo /* r92e_rf.c */ 6960b9567dSKevin Lo uint32_t r92e_rf_read(struct rtwn_softc *, int, uint8_t); 7060b9567dSKevin Lo void r92e_rf_write(struct rtwn_softc *, int, uint8_t, uint32_t); 7160b9567dSKevin Lo 7260b9567dSKevin Lo /* r92e_rom.c */ 7360b9567dSKevin Lo void r92e_parse_rom_common(struct rtwn_softc *, uint8_t *); 7460b9567dSKevin Lo void r92e_parse_rom(struct rtwn_softc *, uint8_t *); 7560b9567dSKevin Lo 7660b9567dSKevin Lo /* r92e_rx.c */ 7760b9567dSKevin Lo void r92e_handle_c2h_report(struct rtwn_softc *, uint8_t *, int); 7860b9567dSKevin Lo int8_t r92e_get_rssi_cck(struct rtwn_softc *, void *); 7960b9567dSKevin Lo 8060b9567dSKevin Lo #endif /* RTL8192E_H */ 81