Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sysmon Restrict limit monitoring for Indicator senso...



details:   https://anonhg.NetBSD.org/src/rev/3fd04c2f9d1c
branches:  trunk
changeset: 765874:3fd04c2f9d1c
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Jun 08 16:14:57 2011 +0000

description:
Restrict limit monitoring for Indicator sensors as well as for
Battery-charge sensors.

diffstat:

 sys/dev/sysmon/sysmon_envsys_events.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 85a52480a049 -r 3fd04c2f9d1c sys/dev/sysmon/sysmon_envsys_events.c
--- a/sys/dev/sysmon/sysmon_envsys_events.c     Wed Jun 08 16:11:25 2011 +0000
+++ b/sys/dev/sysmon/sysmon_envsys_events.c     Wed Jun 08 16:14:57 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.97 2010/12/30 03:59:59 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.98 2011/06/08 16:14:57 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.97 2010/12/30 03:59:59 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.98 2011/06/08 16:14:57 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -101,7 +101,8 @@
        /*
         * Some validation first for limit-checking events
         *
-        * 1. Limits are not permitted if the units is ENVSYS_INDICATOR.
+        * 1. Limits are not permitted if the units is ENVSYS_INDICATOR
+        *    or ENVSYS_BATTERY_CHARGE.
         *
         * 2. Capacity limits are permitted only if the sensor has the
         *    ENVSYS_FPERCENT flag set and value_max is set.
@@ -117,8 +118,10 @@
                " edata-flags 0x%04x\n", __func__, edata->units, props,
                edata->upropset, edata->value_max, edata->flags));
 
-       if (props && edata->units == ENVSYS_INDICATOR)
-               return ENOTSUP;
+       if (props)
+               if (edata->units == ENVSYS_INDICATOR ||
+                   edata->units == ENVSYS_BATTERY_CHARGE)
+                       return ENOTSUP;
 
        if ((props & PROP_CAP_LIMITS) &&
            ((edata->value_max == 0) ||



Home | Main Index | Thread Index | Old Index