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