summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcnst <cnst@openbsd.org>2007-10-18 19:21:52 +0000
committercnst <cnst@openbsd.org>2007-10-18 19:21:52 +0000
commitf52a143b063705bfd048038602cd3c5213585a3f (patch)
tree1b1b0baab4543d91acde031c73082f38d3f26009
parentsynch expat major number with xenocara, and then some. (diff)
downloadwireguard-openbsd-f52a143b063705bfd048038602cd3c5213585a3f.tar.xz
wireguard-openbsd-f52a143b063705bfd048038602cd3c5213585a3f.zip
ignore fans with >= 0x0fff readings. According to the iic_dump(), it appears
as if all the invalid fans have either 0x0f00 or 0x0000 readings, but with the in-the-field driver 0x0f00 appears as 0x0fff. At any rate, no real fans would have sensors detecting 0x0f00 (351 RPM), so no harm continuing to ignore it, t. tested by jon.steel@esentire.com discussed with kettenis@ deraadt@
-rw-r--r--sys/dev/i2c/w83793g.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/i2c/w83793g.c b/sys/dev/i2c/w83793g.c
index 288b1d3b089..f6f8179b99a 100644
--- a/sys/dev/i2c/w83793g.c
+++ b/sys/dev/i2c/w83793g.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: w83793g.c,v 1.3 2007/10/17 16:38:51 cnst Exp $ */
+/* $OpenBSD: w83793g.c,v 1.4 2007/10/18 19:21:52 cnst Exp $ */
/*
* Copyright (c) 2007 Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>
@@ -266,7 +266,7 @@ wbng_refresh_fans(struct wbng_softc *sc)
uint8_t l = wbng_readreg(sc, WB_FAN_START + i * 2 + 1);
uint16_t b = h << 8 | l;
- if (b == 0x0f00 || b == 0x0000) {
+ if (b >= 0x0fff || b == 0x0f00 || b == 0x0000) {
s[i].flags |= SENSOR_FINVALID;
s[i].value = 0;
} else {