Ooops - {get,set}_limits() need to be sensor-specific. Pass an extra
argument to them to identify the individual sensor being processed.
This commit is contained in:
parent
a44a031cb3
commit
45f4717820
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: sysmon_envsys.9,v 1.26 2009/06/13 18:21:55 pgoyette Exp $
|
||||
.\" $NetBSD: sysmon_envsys.9,v 1.27 2009/06/14 19:43:12 pgoyette Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
@ -104,8 +104,10 @@ struct sysmon_envsys {
|
|||
uint64_t sme_events_timeout;
|
||||
void *sme_cookie;
|
||||
void (*sme_refresh)(struct sysmon_envsys *, envsys_data_t *);
|
||||
void (*sme_set_limits)(struct sysmon_envsys *, sysmon_envsys_lim_t *);
|
||||
void (*sme_get_limits)(struct sysmon_envsys *, sysmon_envsys_lim_t *);
|
||||
void (*sme_set_limits)(struct sysmon_envsys *, envsys_data_t *,
|
||||
sysmon_envsys_lim_t *);
|
||||
void (*sme_get_limits)(struct sysmon_envsys *, envsys_data_t *,
|
||||
sysmon_envsys_lim_t *);
|
||||
};
|
||||
.Ed
|
||||
.Pp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sysmon_envsys_events.c,v 1.67 2009/06/13 16:08:25 pgoyette Exp $ */
|
||||
/* $NetBSD: sysmon_envsys_events.c,v 1.68 2009/06/14 19:43:12 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.67 2009/06/13 16:08:25 pgoyette Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.68 2009/06/14 19:43:12 pgoyette Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -331,7 +331,7 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata,
|
|||
if (sme->sme_set_limits) {
|
||||
see->see_lims.sel_flags = see->see_edata->upropset &
|
||||
PROP_LIMITS;
|
||||
(*sme->sme_set_limits)(sme, &(see->see_lims));
|
||||
(*sme->sme_set_limits)(sme, edata, &(see->see_lims));
|
||||
}
|
||||
|
||||
out:
|
||||
|
@ -483,6 +483,7 @@ do { \
|
|||
if (sed_t->sed_edata->flags & ENVSYS_FMONLIMITS) {
|
||||
if (sed_t->sed_sme->sme_get_limits)
|
||||
(*sed_t->sed_sme->sme_get_limits)(sed_t->sed_sme,
|
||||
sed_t->sed_edata,
|
||||
&lims);
|
||||
else
|
||||
sed_t->sed_edata->flags &= ~ENVSYS_FMONLIMITS;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sysmonvar.h,v 1.28 2009/06/13 16:08:25 pgoyette Exp $ */
|
||||
/* $NetBSD: sysmonvar.h,v 1.29 2009/06/14 19:43:12 pgoyette Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 Zembu Labs, Inc.
|
||||
|
@ -89,8 +89,10 @@ struct sysmon_envsys {
|
|||
* Function callbacks to exchange limit/threshold values
|
||||
* with device
|
||||
*/
|
||||
void (*sme_set_limits)(struct sysmon_envsys *, sysmon_envsys_lim_t *);
|
||||
void (*sme_get_limits)(struct sysmon_envsys *, sysmon_envsys_lim_t *);
|
||||
void (*sme_set_limits)(struct sysmon_envsys *, envsys_data_t *,
|
||||
sysmon_envsys_lim_t *);
|
||||
void (*sme_get_limits)(struct sysmon_envsys *, envsys_data_t *,
|
||||
sysmon_envsys_lim_t *);
|
||||
|
||||
struct workqueue *sme_wq; /* the workqueue for the events */
|
||||
struct callout sme_callout; /* for the events */
|
||||
|
|
Loading…
Reference in New Issue