diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2009-11-17 20:35:54 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2009-11-17 20:35:54 +0000 |
commit | 182f195a55b99607b943a7e771128a4097b59a5a (patch) | |
tree | 68071ffb0a1d237d697aef5316bdc8fac528e521 /sys/dev | |
parent | 4b2ced405d153ef15e28d22be0e6b2e3634aa53c (diff) |
nuke the temperature sensor.
it is totally useless since (contrary to the one in iwn(4)) it
is not in any known unit (can't be converted to degK or degC).
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_wpi.c | 54 | ||||
-rw-r--r-- | sys/dev/pci/if_wpivar.h | 4 |
2 files changed, 9 insertions, 49 deletions
diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index bc3d847eb4b..b9871efd4af 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.98 2009/11/03 18:55:23 damien Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.99 2009/11/17 20:35:51 damien Exp $ */ /*- * Copyright (c) 2006-2008 @@ -33,7 +33,6 @@ #include <sys/malloc.h> #include <sys/conf.h> #include <sys/device.h> -#include <sys/sensors.h> #include <machine/bus.h> #include <machine/endian.h> @@ -72,9 +71,6 @@ static const struct pci_matchid wpi_devices[] = { int wpi_match(struct device *, void *, void *); void wpi_attach(struct device *, struct device *, void *); -#ifndef SMALL_KERNEL -void wpi_sensor_attach(struct wpi_softc *); -#endif #if NBPFILTER > 0 void wpi_radiotap_attach(struct wpi_softc *); #endif @@ -125,7 +121,7 @@ int wpi_mrr_setup(struct wpi_softc *); void wpi_updateedca(struct ieee80211com *); void wpi_set_led(struct wpi_softc *, uint8_t, uint8_t, uint8_t); int wpi_set_timing(struct wpi_softc *, struct ieee80211_node *); -void wpi_power_calibration(struct wpi_softc *, int); +void wpi_power_calibration(struct wpi_softc *); int wpi_set_txpower(struct wpi_softc *, int); int wpi_get_power_index(struct wpi_softc *, struct wpi_power_group *, struct ieee80211_channel *, int); @@ -325,9 +321,6 @@ wpi_attach(struct device *parent, struct device *self, void *aux) sc->amrr.amrr_min_success_threshold = 1; sc->amrr.amrr_max_success_threshold = 15; -#ifndef SMALL_KERNEL - wpi_sensor_attach(sc); -#endif #if NBPFILTER > 0 wpi_radiotap_attach(sc); #endif @@ -344,25 +337,6 @@ fail2: while (--i >= 0) fail1: wpi_free_fwmem(sc); } -#ifndef SMALL_KERNEL -/* - * Attach the adapter on-board thermal sensor to the sensors framework. - */ -void -wpi_sensor_attach(struct wpi_softc *sc) -{ - strlcpy(sc->sensordev.xname, sc->sc_dev.dv_xname, - sizeof sc->sensordev.xname); - strlcpy(sc->sensor.desc, "temperature 0 - 285", - sizeof sc->sensor.desc); - sc->sensor.type = SENSOR_INTEGER; /* not in muK! */ - /* Temperature is not valid unless interface is up. */ - sc->sensor.flags = SENSOR_FINVALID; - sensor_attach(&sc->sensordev, &sc->sensor); - sensordev_install(&sc->sensordev); -} -#endif - #if NBPFILTER > 0 /* * Attach the interface to 802.11 radiotap. @@ -408,12 +382,6 @@ wpi_detach(struct device *self, int flags) bus_space_unmap(sc->sc_st, sc->sc_sh, sc->sc_sz); -#ifndef SMALL_KERNEL - /* Detach the thermal sensor. */ - sensor_detach(&sc->sensordev, &sc->sensor); - sensordev_deinstall(&sc->sensordev); -#endif - ieee80211_ifdetach(ifp); if_detach(ifp); @@ -1108,7 +1076,7 @@ wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; - int temp, s; + int s; s = splnet(); /* Automatic rate control triggered every 500ms. */ @@ -1118,13 +1086,10 @@ wpi_calib_timeout(void *arg) else ieee80211_iterate_nodes(ic, wpi_iter_func, sc); } - /* Update sensor. */ - temp = (int)WPI_READ(sc, WPI_UCODE_GP2); - sc->sensor.value = temp + 260; /* Force automatic TX power calibration every 60 secs. */ if (++sc->calib_cnt >= 120) { - wpi_power_calibration(sc, temp); + wpi_power_calibration(sc); sc->calib_cnt = 0; } splx(s); @@ -2251,8 +2216,11 @@ wpi_set_timing(struct wpi_softc *sc, struct ieee80211_node *ni) * based on temperature variation. */ void -wpi_power_calibration(struct wpi_softc *sc, int temp) +wpi_power_calibration(struct wpi_softc *sc) { + int temp; + + temp = (int)WPI_READ(sc, WPI_UCODE_GP2); /* Sanity-check temperature. */ if (temp < -260 || temp > 25) { /* This can't be correct, ignore. */ @@ -2862,8 +2830,6 @@ wpi_post_alive(struct wpi_softc *sc) return ETIMEDOUT; } DPRINTF(("temperature %d\n", sc->temp)); - sc->sensor.value = sc->temp + 260; - sc->sensor.flags &= ~SENSOR_FINVALID; return 0; } @@ -3361,8 +3327,4 @@ wpi_stop(struct ifnet *ifp, int disable) /* Power OFF hardware. */ wpi_hw_stop(sc); - - /* Temperature sensor is no longer valid. */ - sc->sensor.value = 0; - sc->sensor.flags |= SENSOR_FINVALID; } diff --git a/sys/dev/pci/if_wpivar.h b/sys/dev/pci/if_wpivar.h index 29f8cc78194..960198346b5 100644 --- a/sys/dev/pci/if_wpivar.h +++ b/sys/dev/pci/if_wpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpivar.h,v 1.19 2009/05/12 19:10:57 damien Exp $ */ +/* $OpenBSD: if_wpivar.h,v 1.20 2009/11/17 20:35:53 damien Exp $ */ /*- * Copyright (c) 2006-2008 @@ -162,8 +162,6 @@ struct wpi_softc { bus_size_t sc_sz; int sc_cap_off; /* PCIe Capabilities. */ - struct ksensordev sensordev; - struct ksensor sensor; struct timeout calib_to; int calib_cnt; |