Lines Matching refs:sc
53 rtwn_temp_calib(struct rtwn_softc *sc)
57 RTWN_ASSERT_LOCKED(sc);
59 if (!(sc->sc_flags & RTWN_TEMP_MEASURED)) {
61 RTWN_DPRINTF(sc, RTWN_DEBUG_TEMP,
63 rtwn_temp_measure(sc);
64 sc->sc_flags |= RTWN_TEMP_MEASURED;
67 sc->sc_flags &= ~RTWN_TEMP_MEASURED;
70 temp = rtwn_temp_read(sc);
72 RTWN_DPRINTF(sc, RTWN_DEBUG_TEMP,
77 RTWN_DPRINTF(sc, RTWN_DEBUG_TEMP,
79 sc->thcal_temp, temp);
85 if (sc->thcal_temp == 0xff) {
87 rtwn_lc_calib(sc);
89 sc->thcal_temp = temp;
90 } else if (abs(temp - sc->thcal_temp) > sc->temp_delta) {
91 RTWN_DPRINTF(sc, RTWN_DEBUG_TEMP,
93 __func__, sc->thcal_temp, temp);
95 rtwn_lc_calib(sc);
96 rtwn_iq_calib(sc);
99 sc->thcal_temp = temp;
104 rtwn_calib_cb(struct rtwn_softc *sc, union sec_param *data)
107 rtwn_temp_calib(sc);
110 if (sc->sc_ratectl == RTWN_RATECTL_FW) {
112 rtwn_set_rssi(sc);
116 if (sc->vaps_running > sc->monvaps_running)
117 callout_reset(&sc->sc_calib_to, 2*hz, rtwn_calib_to, sc);
123 struct rtwn_softc *sc = arg;
126 rtwn_cmd_sleepable(sc, NULL, 0, rtwn_calib_cb);