Module Name:    src
Committed By:   pgoyette
Date:           Mon Jun 20 17:48:46 UTC 2011

Modified Files:
        src/sys/dev/ic: cac.c ciss.c mfi.c nslm7x.c

Log Message:
Initializes sensors states before registering.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/ic/cac.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ic/ciss.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/mfi.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/nslm7x.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/cac.c
diff -u src/sys/dev/ic/cac.c:1.51 src/sys/dev/ic/cac.c:1.52
--- src/sys/dev/ic/cac.c:1.51	Sat Nov 13 13:52:00 2010
+++ src/sys/dev/ic/cac.c	Mon Jun 20 17:48:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cac.c,v 1.51 2010/11/13 13:52:00 uebayasi Exp $	*/
+/*	$NetBSD: cac.c,v 1.52 2011/06/20 17:48:45 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2006, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.51 2010/11/13 13:52:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.52 2011/06/20 17:48:45 pgoyette Exp $");
 
 #include "bio.h"
 
@@ -683,6 +683,7 @@
 
 	for (i = 0; i < nsensors; i++) {
 		sc->sc_sensor[i].units = ENVSYS_DRIVE;
+		sc->sc_sensor[i].state = ENVSYS_SINVALID;
 		/* Enable monitoring for drive state changes */
 		sc->sc_sensor[i].flags |= ENVSYS_FMONSTCHANGED;
 		/* logical drives */

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.25 src/sys/dev/ic/ciss.c:1.26
--- src/sys/dev/ic/ciss.c:1.25	Mon May 16 17:21:37 2011
+++ src/sys/dev/ic/ciss.c	Mon Jun 20 17:48:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.25 2011/05/16 17:21:37 mhitch Exp $	*/
+/*	$NetBSD: ciss.c,v 1.26 2011/06/20 17:48:45 pgoyette Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.25 2011/05/16 17:21:37 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.26 2011/06/20 17:48:45 pgoyette Exp $");
 
 #include "bio.h"
 
@@ -1421,6 +1421,7 @@
 
 	for (i = 0; i < nsensors; i++) {
 		sc->sc_sensor[i].units = ENVSYS_DRIVE;
+		sc->sc_sensor[i].state = ENVSYS_SINVALID;
 		/* Enable monitoring for drive state changes */
 		sc->sc_sensor[i].flags |= ENVSYS_FMONSTCHANGED;
 		/* logical drives */
@@ -1436,7 +1437,8 @@
 	sc->sc_sme->sme_cookie = sc;
 	sc->sc_sme->sme_refresh = ciss_sensor_refresh;
 	if (sysmon_envsys_register(sc->sc_sme)) {
-		printf("%s: unable to register with sysmon\n", device_xname(&sc->sc_dev));
+		printf("%s: unable to register with sysmon\n",
+		    device_xname(&sc->sc_dev));
 		return(1);
 	}
 	return (0);

Index: src/sys/dev/ic/mfi.c
diff -u src/sys/dev/ic/mfi.c:1.34 src/sys/dev/ic/mfi.c:1.35
--- src/sys/dev/ic/mfi.c:1.34	Sun Mar 14 18:06:28 2010
+++ src/sys/dev/ic/mfi.c	Mon Jun 20 17:48:46 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.34 2010/03/14 18:06:28 pgoyette Exp $ */
+/* $NetBSD: mfi.c,v 1.35 2011/06/20 17:48:46 pgoyette Exp $ */
 /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom <[email protected]>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.34 2010/03/14 18:06:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.35 2011/06/20 17:48:46 pgoyette Exp $");
 
 #include "bio.h"
 
@@ -2021,6 +2021,7 @@
 
 	for (i = 0; i < nsensors; i++) {
 		sc->sc_sensor[i].units = ENVSYS_DRIVE;
+		sc->sc_sensor[i].state = ENVSYS_SINVALID;
 		/* Enable monitoring for drive state changes */
 		sc->sc_sensor[i].flags |= ENVSYS_FMONSTCHANGED;
 		/* logical drives */

Index: src/sys/dev/ic/nslm7x.c
diff -u src/sys/dev/ic/nslm7x.c:1.57 src/sys/dev/ic/nslm7x.c:1.58
--- src/sys/dev/ic/nslm7x.c:1.57	Sat Mar  5 22:27:21 2011
+++ src/sys/dev/ic/nslm7x.c	Mon Jun 20 17:48:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nslm7x.c,v 1.57 2011/03/05 22:27:21 jakllsch Exp $ */
+/*	$NetBSD: nslm7x.c,v 1.58 2011/06/20 17:48:46 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.57 2011/03/05 22:27:21 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.58 2011/06/20 17:48:46 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1667,6 +1667,7 @@
 	lmsc->sc_sme = sysmon_envsys_create();
 	/* Initialize sensors */
 	for (i = 0; i < lmsc->numsensors; i++) {
+		lmsc->sensors[i].state = ENVSYS_SINVALID;
 		if (sysmon_envsys_sensor_attach(lmsc->sc_sme,
 						&lmsc->sensors[i])) {
 			sysmon_envsys_destroy(lmsc->sc_sme);

Reply via email to