Module Name:    src
Committed By:   pgoyette
Date:           Sat Jan  2 19:02:40 UTC 2010

Modified Files:
        src/sys/dev/sysmon: sysmon_envsys_events.c

Log Message:
Flags for existence of limit values need to be propagated to the
event data.  Otherwise, they're not processed.

XXX This needs to be rethought.  While fixing it this way makes things
XXX "work", we really shouldn't need to replicate these flags.  The
XXX limits and their flags should be kept as part of the sensor data,
XXX and not part of the event-monitor data.  I'll work on this in the
XXX near future.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/sysmon/sysmon_envsys_events.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/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.73 src/sys/dev/sysmon/sysmon_envsys_events.c:1.74
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.73	Fri Jan  1 15:41:25 2010
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Sat Jan  2 19:02:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.73 2010/01/01 15:41:25 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.74 2010/01/02 19:02:39 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.73 2010/01/01 15:41:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.74 2010/01/02 19:02:39 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -209,6 +209,7 @@
 		if (error && error != EEXIST)
 			goto out;
 		see->see_edata->upropset |= PROP_CRITMAX;
+		see->see_lims.sel_flags |= PROP_CRITMAX;
 	}
 
 	if (lims->sel_flags & PROP_WARNMAX) {
@@ -229,6 +230,7 @@
 		if (error && error != EEXIST)
 			goto out;
 		see->see_edata->upropset |= PROP_WARNMAX;
+		see->see_lims.sel_flags |= PROP_WARNMAX;
 	}
 
 	if (lims->sel_flags & PROP_WARNMIN) {
@@ -249,6 +251,7 @@
 		if (error && error != EEXIST)
 			goto out;
 		see->see_edata->upropset |= PROP_WARNMIN;
+		see->see_lims.sel_flags |= PROP_WARNMIN;
 	}
 
 	if (lims->sel_flags & PROP_CRITMIN) {
@@ -269,6 +272,7 @@
 		if (error && error != EEXIST)
 			goto out;
 		see->see_edata->upropset |= PROP_CRITMIN;
+		see->see_lims.sel_flags |= PROP_CRITMIN;
 	}
 
 	if (lims->sel_flags & PROP_BATTWARN) {
@@ -289,6 +293,7 @@
 		if (error && error != EEXIST)
 			goto out;
 		see->see_edata->upropset |= PROP_BATTWARN;
+		see->see_lims.sel_flags |= PROP_BATTWARN;
 	}
 
 	if (lims->sel_flags & PROP_BATTCAP) {
@@ -309,8 +314,12 @@
 		if (error && error != EEXIST)
 			goto out;
 		see->see_edata->upropset |= PROP_BATTCAP;
+		see->see_lims.sel_flags |= PROP_BATTCAP;
 	}
 
+	if (lims->sel_flags & PROP_DRIVER_LIMITS)
+		see->see_lims.sel_flags |= PROP_DRIVER_LIMITS;
+
 	DPRINTF(("%s: (%s) event registered (sensor=%s snum=%d type=%d "
 	    "critmin=%" PRIu32 " warnmin=%" PRIu32 " warnmax=%" PRIu32
 	    " critmax=%" PRIu32 " props 0x%04x)\n", __func__,
@@ -482,7 +491,7 @@
 
 	/*
 	 * If driver provides a method to retrieve its internal limit
-	 * values, call it and use thoe returned values as initial
+	 * values, call it and use those returned values as initial
 	 * limits for event monitoring.
 	 */
 	lims.sel_flags = 0;
@@ -503,8 +512,8 @@
 	 * If driver doesn't provide a way to "absorb" user-specified
 	 * limit values, we must monitor all limits ourselves
 	 */
-	else if (sed_t->sed_sme->sme_get_limits == NULL)
-		lims.sel_flags |= PROP_DRIVER_LIMITS;
+	else if (sed_t->sed_sme->sme_set_limits == NULL)
+		lims.sel_flags &= ~PROP_DRIVER_LIMITS;
 
 	/* Register the events that were specified */
 

Reply via email to