From 4e1c0f753ce3e2ea267883b4c06b64f63f0120d0 Mon Sep 17 00:00:00 2001 From: pgoyette Date: Sat, 2 Jan 2010 19:02:39 +0000 Subject: 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. --- sys/dev/sysmon/sysmon_envsys_events.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/sysmon/sysmon_envsys_events.c b/sys/dev/sysmon/sysmon_envsys_events.c index 6e47aafe129..93dde474a3d 100644 --- a/sys/dev/sysmon/sysmon_envsys_events.c +++ b/sys/dev/sysmon/sysmon_envsys_events.c @@ -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 -__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 #include @@ -209,6 +209,7 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, 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 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, 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 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, 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 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, 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 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, 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 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, 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 @@ do { \ /* * 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 @@ do { \ * 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 */ -- cgit