From 57e6b23a48ec5b54e2d6d393a1566508f7aba91e Mon Sep 17 00:00:00 2001 From: pgoyette Date: Mon, 20 Jun 2011 17:48:45 +0000 Subject: [PATCH] Initializes sensors states before registering. --- sys/dev/ic/cac.c | 5 +++-- sys/dev/ic/ciss.c | 8 +++++--- sys/dev/ic/mfi.c | 5 +++-- sys/dev/ic/nslm7x.c | 5 +++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 49b6605702e6..9c5b70c4aceb 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -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 -__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 @@ cac_create_sensors(struct cac_softc *sc) 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 */ diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 19c19634b9c4..cf167ec0009f 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -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 -__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 @@ ciss_create_sensors(struct ciss_softc *sc) 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 @@ ciss_create_sensors(struct ciss_softc *sc) 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); diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index ff61a5398812..db28f31f14cc 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -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 @@ -17,7 +17,7 @@ */ #include -__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 @@ mfi_create_sensors(struct mfi_softc *sc) 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 */ diff --git a/sys/dev/ic/nslm7x.c b/sys/dev/ic/nslm7x.c index c9fd784cc4d1..c0375f6ee364 100644 --- a/sys/dev/ic/nslm7x.c +++ b/sys/dev/ic/nslm7x.c @@ -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 -__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 #include @@ -1667,6 +1667,7 @@ lm_attach(struct lm_softc *lmsc) 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);