summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-28 20:36:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-28 20:36:00 +0000
commit1603fd8147def67d24a6094904918972b5b83f28 (patch)
tree3d2db693c11ea6e79734257f2eef50e999ed788d /sys
parent2fda7f6e48644b59da5a2c20518f0a61c10f9f7a (diff)
if many regs in a "xeontemp" appear the same, it is not one
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/i2c_scan.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index 85f8d78b9c3..e3276dbd6b0 100644
--- a/sys/dev/i2c/i2c_scan.c
+++ b/sys/dev/i2c/i2c_scan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c_scan.c,v 1.29 2005/12/28 01:02:58 deraadt Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.30 2005/12/28 20:35:59 deraadt Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -160,15 +160,18 @@ xeonprobe(u_int8_t addr)
if (addr == 0x18 || addr == 0x1a || addr == 0x29 ||
addr == 0x2b || addr == 0x4c || addr == 0x4e) {
u_int8_t reg, val;
- int zero = 0;
+ int zero = 0, copy = 0;
+ val = probe(0x00);
for (reg = 0x00; reg < 0x09; reg++) {
if (probe(reg) == 0xff)
return (NULL);
- if (probe(reg) == 0)
+ if (probe(reg) == 0x00)
zero++;
+ if (val == probe(reg))
+ copy++;
}
- if (zero > 8)
+ if (zero > 6 || copy > 6)
return (NULL);
val = probe(0x09);
for (reg = 0x0a; reg < 0xfe; reg++) {