2014-11-23 13:00:20 +03:00
|
|
|
/* $NetBSD: sysmon_envsysvar.h,v 1.47 2014/11/23 10:00:20 ozaki-r Exp $ */
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
|
|
|
|
/*-
|
2008-04-01 16:25:30 +04:00
|
|
|
* Copyright (c) 2007, 2008 Juan Romero Pardines.
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
2007-10-07 08:11:15 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DEV_SYSMON_ENVSYSVAR_H_
|
|
|
|
#define _DEV_SYSMON_ENVSYSVAR_H_
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/conf.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/mutex.h>
|
|
|
|
#include <sys/workqueue.h>
|
2007-07-20 18:10:22 +04:00
|
|
|
#include <sys/condvar.h>
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
|
|
|
|
#include <dev/sysmon/sysmonvar.h>
|
|
|
|
#include <prop/proplib.h>
|
|
|
|
|
2012-09-06 16:59:00 +04:00
|
|
|
#ifdef _KERNEL_OPT
|
2012-09-06 16:10:28 +04:00
|
|
|
#include "opt_envsys.h"
|
2012-09-06 16:59:00 +04:00
|
|
|
#endif
|
2012-09-06 16:10:28 +04:00
|
|
|
|
2010-12-15 20:17:16 +03:00
|
|
|
enum sme_descr_type {
|
2007-09-04 20:54:02 +04:00
|
|
|
SME_DESC_UNITS = 1,
|
|
|
|
SME_DESC_STATES,
|
|
|
|
SME_DESC_DRIVE_STATES,
|
2012-08-28 01:42:04 +04:00
|
|
|
SME_DESC_BATTERY_CAPACITY,
|
|
|
|
SME_DESC_INDICATOR
|
2007-09-04 20:54:02 +04:00
|
|
|
};
|
|
|
|
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
#ifdef ENVSYS_DEBUG
|
|
|
|
#define DPRINTF(x) printf x
|
|
|
|
#else
|
|
|
|
#define DPRINTF(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENVSYS_OBJECTS_DEBUG
|
|
|
|
#define DPRINTFOBJ(x) printf x
|
|
|
|
#else
|
|
|
|
#define DPRINTFOBJ(x)
|
|
|
|
#endif
|
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* Default timeout value for the callouts if no specified.
|
|
|
|
*/
|
|
|
|
#define SME_EVENTS_DEFTIMEOUT 30
|
|
|
|
|
|
|
|
/*
|
|
|
|
* struct used by a sysmon envsys event.
|
|
|
|
*/
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
typedef struct sme_event {
|
2008-04-01 16:25:30 +04:00
|
|
|
struct work see_wk;
|
2007-07-19 04:28:47 +04:00
|
|
|
LIST_ENTRY(sme_event) see_list;
|
2007-11-16 11:00:11 +03:00
|
|
|
struct sysmon_envsys *see_sme; /* device associated */
|
|
|
|
struct penvsys_state see_pes; /* our power envsys */
|
|
|
|
envsys_data_t *see_edata; /* our sensor data */
|
|
|
|
int see_type; /* type of the event */
|
2012-08-28 01:42:04 +04:00
|
|
|
int see_evstate; /* state of prev event */
|
|
|
|
int see_evvalue; /* value of prev event */
|
2007-07-19 00:31:41 +04:00
|
|
|
int see_flags; /* see above */
|
2008-08-22 15:27:50 +04:00
|
|
|
#define SEE_EVENT_WORKING 0x0001 /* This event is busy */
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
} sme_event_t;
|
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* struct by a sysmon envsys event set by a driver.
|
|
|
|
*/
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
typedef struct sme_event_drv {
|
2007-11-16 11:00:11 +03:00
|
|
|
struct sysmon_envsys *sed_sme;
|
|
|
|
prop_dictionary_t sed_sdict;
|
|
|
|
envsys_data_t *sed_edata;
|
|
|
|
int sed_powertype;
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
} sme_event_drv_t;
|
|
|
|
|
2010-12-15 20:17:16 +03:00
|
|
|
struct sme_descr_entry {
|
2007-09-04 20:54:02 +04:00
|
|
|
int type;
|
|
|
|
int crittype;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* common stuff.
|
|
|
|
*/
|
2008-04-01 16:25:30 +04:00
|
|
|
extern kmutex_t sme_global_mtx; /* for the sme linked list and dict */
|
2010-04-01 16:16:14 +04:00
|
|
|
extern prop_dictionary_t sme_propd; /* the global sensor dictionary */
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* linked list for the sysmon envsys devices.
|
|
|
|
*/
|
2012-02-18 05:08:00 +04:00
|
|
|
LIST_HEAD(sysmon_envsys_lh, sysmon_envsys);
|
|
|
|
extern struct sysmon_envsys_lh sysmon_envsys_list;
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* functions to handle sysmon envsys devices.
|
|
|
|
*/
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
int sme_update_dictionary(struct sysmon_envsys *);
|
2011-06-08 22:22:24 +04:00
|
|
|
int sme_update_sensor_dictionary(prop_object_t, envsys_data_t *, bool);
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
int sme_userset_dictionary(struct sysmon_envsys *,
|
|
|
|
prop_dictionary_t, prop_array_t);
|
2007-10-07 08:11:15 +04:00
|
|
|
prop_dictionary_t sme_sensor_dictionary_get(prop_array_t, const char *);
|
2007-11-04 02:05:21 +03:00
|
|
|
struct sysmon_envsys *sysmon_envsys_find(const char *);
|
2008-04-01 16:25:30 +04:00
|
|
|
void sysmon_envsys_acquire(struct sysmon_envsys *, bool);
|
|
|
|
void sysmon_envsys_release(struct sysmon_envsys *, bool);
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* functions to handle sysmon envsys events.
|
|
|
|
*/
|
|
|
|
int sme_event_register(prop_dictionary_t, envsys_data_t *,
|
2009-06-13 20:08:25 +04:00
|
|
|
struct sysmon_envsys *, sysmon_envsys_lim_t *,
|
2010-02-15 02:06:01 +03:00
|
|
|
uint32_t, int, int);
|
2007-11-16 11:00:11 +03:00
|
|
|
int sme_event_unregister(struct sysmon_envsys *, const char *, int);
|
2012-07-15 21:41:39 +04:00
|
|
|
int sme_event_unregister_sensor(struct sysmon_envsys *, envsys_data_t *);
|
2007-11-16 11:00:11 +03:00
|
|
|
void sme_event_unregister_all(struct sysmon_envsys *);
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
void sme_event_drvadd(void *);
|
2007-11-16 11:00:11 +03:00
|
|
|
int sme_events_init(struct sysmon_envsys *);
|
|
|
|
void sme_events_destroy(struct sysmon_envsys *);
|
2014-11-23 13:00:20 +03:00
|
|
|
void sme_events_halt_callout(struct sysmon_envsys *);
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
void sme_events_check(void *);
|
2010-03-19 04:16:44 +03:00
|
|
|
void sme_events_worker(struct work *, void *);
|
|
|
|
void sme_deliver_event(sme_event_t *);
|
2010-04-10 23:01:00 +04:00
|
|
|
int sme_update_limits(struct sysmon_envsys *, envsys_data_t *);
|
2010-12-30 06:59:59 +03:00
|
|
|
void sme_schedule_callout(struct sysmon_envsys *);
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
/*
|
|
|
|
* common functions to create/update objects in a dictionary.
|
|
|
|
*/
|
2007-07-21 16:11:27 +04:00
|
|
|
int sme_sensor_upbool(prop_dictionary_t, const char *, bool);
|
|
|
|
int sme_sensor_upint32(prop_dictionary_t, const char *, int32_t);
|
|
|
|
int sme_sensor_upuint32(prop_dictionary_t, const char *, uint32_t);
|
|
|
|
int sme_sensor_upstring(prop_dictionary_t, const char *, const char *);
|
2007-07-20 18:10:22 +04:00
|
|
|
|
2010-12-15 20:17:16 +03:00
|
|
|
const struct sme_descr_entry *sme_find_table_entry(enum sme_descr_type, int);
|
2011-06-19 07:09:43 +04:00
|
|
|
const struct sme_descr_entry * sme_find_table_desc(enum sme_descr_type,
|
|
|
|
const char *);
|
2007-09-04 20:54:02 +04:00
|
|
|
|
Imported envsys 2, a brief description of the new features:
(Part 1: API)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:36:39 +04:00
|
|
|
#endif /* _DEV_SYSMON_ENVSYSVAR_H_ */
|