2 * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #include <sys/cdefs.h>
18 __FBSDID("$FreeBSD$");
22 #include <sys/param.h>
24 #include <sys/mutex.h>
26 #include <sys/kernel.h>
27 #include <sys/socket.h>
28 #include <sys/systm.h>
29 #include <sys/malloc.h>
30 #include <sys/queue.h>
31 #include <sys/taskqueue.h>
33 #include <sys/endian.h>
34 #include <sys/linker.h>
37 #include <net/ethernet.h>
38 #include <net/if_media.h>
40 #include <net80211/ieee80211_var.h>
41 #include <net80211/ieee80211_radiotap.h>
43 #include <dev/rtwn/if_rtwnreg.h>
44 #include <dev/rtwn/if_rtwnvar.h>
46 #include <dev/rtwn/rtl8188e/r88e.h>
47 #include <dev/rtwn/rtl8188e/r88e_reg.h>
51 r88e_iq_calib(struct rtwn_softc *sc)
57 r88e_temp_measure(struct rtwn_softc *sc)
59 rtwn_rf_write(sc, 0, R88E_RF_T_METER, R88E_RF_T_METER_START);
63 r88e_temp_read(struct rtwn_softc *sc)
65 return (MS(rtwn_rf_read(sc, 0, R88E_RF_T_METER),
66 R88E_RF_T_METER_VAL));