Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sysmon Since nothing actually records or maintains a...



details:   https://anonhg.NetBSD.org/src/rev/43960e73835d
branches:  trunk
changeset: 765737:43960e73835d
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Jun 04 13:24:33 2011 +0000

description:
Since nothing actually records or maintains an average sensor value,
remove value_avg from the prop_dict.  We can't completely remove it
because there's one driver that uses this field for its own private
purposes, so for now we just rename the member.

diffstat:

 sys/dev/sysmon/sysmon_envsys.c |  27 +++++----------------------
 sys/dev/sysmon/sysmonvar.h     |   6 +++---
 2 files changed, 8 insertions(+), 25 deletions(-)

diffs (103 lines):

diff -r 8ddd7946ba27 -r 43960e73835d sys/dev/sysmon/sysmon_envsys.c
--- a/sys/dev/sysmon/sysmon_envsys.c    Sat Jun 04 11:12:28 2011 +0000
+++ b/sys/dev/sysmon/sysmon_envsys.c    Sat Jun 04 13:24:33 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmon_envsys.c,v 1.112 2010/12/30 03:59:59 pgoyette Exp $     */
+/*     $NetBSD: sysmon_envsys.c,v 1.113 2011/06/04 13:24:33 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.112 2010/12/30 03:59:59 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.113 2011/06/04 13:24:33 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -372,8 +372,8 @@
                        tred->max.data_s = edata->value_max;
                        tred->min.data_us = edata->value_min;
                        tred->min.data_s = edata->value_min;
-                       tred->avg.data_us = edata->value_avg;
-                       tred->avg.data_s = edata->value_avg;
+                       tred->avg.data_us = 0;
+                       tred->avg.data_s = 0;
                        if (edata->units == ENVSYS_BATTERY_CHARGE)
                                tred->units = ENVSYS_INDICATOR;
                        else
@@ -1421,8 +1421,6 @@
                 *      <integer>800</integer>
                 *      <key>max-value</integer>
                 *      <integer>3000</integer>
-                *      <key>avg-value</integer>
-                *      <integer>1400</integer>
                 *      ...
                 */
                if (edata->units == ENVSYS_SFANRPM)
@@ -1450,13 +1448,6 @@
                                               edata->value_max))
                        goto out;
                }
-
-               if (edata->flags & ENVSYS_FVALID_AVG) {
-                       if (sme_sensor_upint32(dict,
-                                              "avg-value",
-                                              edata->value_avg))
-                       goto out;
-               }
        }
 
        /*
@@ -1689,7 +1680,7 @@
                }
 
                /*
-                * update sensor's {avg,max,min}-value.
+                * update sensor's {max,min}-value.
                 */
                if (edata->flags & ENVSYS_FVALID_MAX) {
                        error = sme_sensor_upint32(dict,
@@ -1707,14 +1698,6 @@
                                break;
                }
 
-               if (edata->flags & ENVSYS_FVALID_AVG) {
-                       error = sme_sensor_upint32(dict,
-                                                  "avg-value",
-                                                  edata->value_avg);
-                       if (error)
-                               break;
-               }
-
                /* 
                 * update 'rpms' only for ENVSYS_SFANRPM sensors.
                 */
diff -r 8ddd7946ba27 -r 43960e73835d sys/dev/sysmon/sysmonvar.h
--- a/sys/dev/sysmon/sysmonvar.h        Sat Jun 04 11:12:28 2011 +0000
+++ b/sys/dev/sysmon/sysmonvar.h        Sat Jun 04 13:24:33 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmonvar.h,v 1.40 2011/01/04 01:51:06 matt Exp $      */
+/*     $NetBSD: sysmonvar.h,v 1.41 2011/06/04 13:24:33 pgoyette Exp $  */
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -83,7 +83,7 @@
        int32_t         value_cur;      /* current value */
        int32_t         value_max;      /* max value */
        int32_t         value_min;      /* min value */
-       int32_t         value_avg;      /* avg value */
+       int32_t         private;        /* private data for drivers */
        sysmon_envsys_lim_t limits;     /* thresholds for monitoring */
        int             upropset;       /* userland property set? */
        char            desc[ENVSYS_DESCLEN];   /* sensor description */
@@ -95,7 +95,7 @@
 #define ENVSYS_FPERCENT        0x00000001      /* sensor wants a percentage */
 #define ENVSYS_FVALID_MAX      0x00000002      /* max value is ok */
 #define ENVSYS_FVALID_MIN      0x00000004      /* min value is ok */
-#define ENVSYS_FVALID_AVG      0x00000008      /* avg value is ok */
+#define ENVSYS_F_OBSOLETE      0x00000008
 #define ENVSYS_FCHANGERFACT    0x00000010      /* sensor can change rfact */
 
 /* monitoring flags */



Home | Main Index | Thread Index | Old Index