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 | |
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).
-rw-r--r-- | share/man/man4/wpi.4 | 8 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 54 | ||||
-rw-r--r-- | sys/dev/pci/if_wpivar.h | 4 |
3 files changed, 11 insertions, 55 deletions
diff --git a/share/man/man4/wpi.4 b/share/man/man4/wpi.4 index ff5f68ddc6c..2965d652a3d 100644 --- a/share/man/man4/wpi.4 +++ b/share/man/man4/wpi.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: wpi.4,v 1.25 2009/09/02 07:00:24 jmc Exp $ +.\" $OpenBSD: wpi.4,v 1.26 2009/11/17 20:35:53 damien Exp $ .\" .\" Copyright (c) 2006, 2007 .\" Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: September 2 2009 $ +.Dd $Mdocdate: November 17 2009 $ .Os .Dt WPI 4 .Sh NAME @@ -73,10 +73,6 @@ The driver offloads both encryption and decryption of unicast data frames to the hardware for the CCMP cipher. .Pp -The device has one temperature sensor. -Its value is in the range from 0 (coolest) to 285 (warmest). -Sensor data is updated every 500 milliseconds. -.Pp The .Nm driver can be configured at runtime with 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; |