From 322e4dbc57d62bf672dad5f4c12382f9c69a7e71 Mon Sep 17 00:00:00 2001 From: "Constantine A. Murenin" Date: Thu, 18 Oct 2007 19:21:53 +0000 Subject: 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@ --- sys/dev/i2c/w83793g.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') 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 @@ -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 { -- cgit v1.2.3