summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-03-22 16:55:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-03-22 16:55:32 +0000
commitbfcfcc95f91a9ef756b3184426381561b7f4dc23 (patch)
tree86156fd65b4c74f4b929cb5bcd06ed881f46f591
parentd0617786c492a05d286defedc41f1cac5a22411d (diff)
split userland & kernel struct sensor/sensordev so that the addition
of new fields in the future is less disruptive. This is done similar to how struct proc is handled for ps(1). ok jmc (man page changes) tested fkr simon, and more suggestions from millert
-rw-r--r--share/man/man9/sensor_attach.918
-rw-r--r--sys/arch/i386/i386/esm.c20
-rw-r--r--sys/arch/macppc/dev/asms.c6
-rw-r--r--sys/arch/macppc/dev/smu.c8
-rw-r--r--sys/arch/sparc64/dev/pcf8591_ofw.c6
-rw-r--r--sys/dev/acpi/acpidev.h14
-rw-r--r--sys/dev/acpi/acpitz.c6
-rw-r--r--sys/dev/i2c/ad741x.c6
-rw-r--r--sys/dev/i2c/adm1021.c6
-rw-r--r--sys/dev/i2c/adm1024.c8
-rw-r--r--sys/dev/i2c/adm1025.c6
-rw-r--r--sys/dev/i2c/adm1026.c8
-rw-r--r--sys/dev/i2c/adm1030.c6
-rw-r--r--sys/dev/i2c/adm1031.c6
-rw-r--r--sys/dev/i2c/adt7460.c6
-rw-r--r--sys/dev/i2c/asb100.c8
-rw-r--r--sys/dev/i2c/ds1631.c6
-rw-r--r--sys/dev/i2c/fcu.c6
-rw-r--r--sys/dev/i2c/fintek.c6
-rw-r--r--sys/dev/i2c/gl518sm.c6
-rw-r--r--sys/dev/i2c/lm75.c6
-rw-r--r--sys/dev/i2c/lm87.c6
-rw-r--r--sys/dev/i2c/maxim6690.c6
-rw-r--r--sys/dev/i2c/pca9554.c6
-rw-r--r--sys/dev/i2c/tsl2560.c6
-rw-r--r--sys/dev/i2c/w83l784r.c18
-rw-r--r--sys/dev/ic/ami.c6
-rw-r--r--sys/dev/ic/amivar.h6
-rw-r--r--sys/dev/ic/ciss.c6
-rw-r--r--sys/dev/ic/cissvar.h6
-rw-r--r--sys/dev/ic/lm78.c22
-rw-r--r--sys/dev/ic/lm78var.h6
-rw-r--r--sys/dev/ic/mfi.c6
-rw-r--r--sys/dev/ic/mfivar.h6
-rw-r--r--sys/dev/ipmi.c4
-rw-r--r--sys/dev/ipmivar.h4
-rw-r--r--sys/dev/isa/aps.c6
-rw-r--r--sys/dev/isa/it.c14
-rw-r--r--sys/dev/isa/itvar.h6
-rw-r--r--sys/dev/isa/nsclpcsio_isa.c6
-rw-r--r--sys/dev/isa/viasio.c6
-rw-r--r--sys/dev/onewire/owid.c6
-rw-r--r--sys/dev/onewire/owsbm.c12
-rw-r--r--sys/dev/onewire/owtemp.c6
-rw-r--r--sys/dev/pci/arc.c10
-rw-r--r--sys/dev/pci/mbg.c8
-rw-r--r--sys/dev/pci/viaenv.c6
-rw-r--r--sys/dev/usb/udcf.c8
-rw-r--r--sys/kern/kern_sensors.c36
-rw-r--r--sys/kern/kern_sysctl.c50
-rw-r--r--sys/kern/tty_nmea.c6
-rw-r--r--sys/scsi/safte.c6
-rw-r--r--sys/scsi/ses.c6
-rw-r--r--sys/sys/sensors.h54
54 files changed, 283 insertions, 251 deletions
diff --git a/share/man/man9/sensor_attach.9 b/share/man/man9/sensor_attach.9
index aaec0a1dbb5..78863ee85b9 100644
--- a/share/man/man9/sensor_attach.9
+++ b/share/man/man9/sensor_attach.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sensor_attach.9,v 1.3 2006/12/28 11:36:14 jmc Exp $
+.\" $OpenBSD: sensor_attach.9,v 1.4 2007/03/22 16:55:31 deraadt Exp $
.\"
.\" Copyright (c) 2006 Michael Knudsen <mk@openbsd.org>
.\" Copyright (c) 2006 Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>
@@ -40,17 +40,17 @@
.Sh SYNOPSIS
.Fd #include <sys/sensors.h>
.Ft void
-.Fn "sensordev_install" "struct sensordev *sensdev"
+.Fn "sensordev_install" "struct ksensordev *sensdev"
.Ft void
-.Fn "sensordev_deinstall" "struct sensordev *sensdev"
-.Ft struct sensordev
+.Fn "sensordev_deinstall" "struct ksensordev *sensdev"
+.Ft struct ksensordev
.Fn "*sensordev_get" "int devnum"
.Pp
.Ft void
-.Fn "sensor_attach" "struct sensordev *sensdev" "struct sensor *sens"
+.Fn "sensor_attach" "struct ksensordev *sensdev" "struct ksensor *sens"
.Ft void
-.Fn "sensor_detach" "struct sensordev *sensdev" "struct sensor *sens"
-.Ft struct sensor
+.Fn "sensor_detach" "struct ksensordev *sensdev" "struct ksensor *sens"
+.Ft struct ksensor
.Fn "*sensor_find" "int devnum" "enum sensor_type stype" "int numt"
.Pp
.Ft int
@@ -90,7 +90,7 @@ takes ordinal number
.Pa devnum
specifying a sensor device and
returns a pointer to the corresponding
-.Vt struct sensordev ,
+.Vt struct ksensordev ,
or
.Dv NULL
if no such sensor device exists.
@@ -103,7 +103,7 @@ specifying a sensor device, sensor type
and ordinal number of sensor of such type
.Pa numt ,
and returns a pointer to the corresponding
-.Vt struct sensor ,
+.Vt struct ksensor ,
or
.Dv NULL
if no such sensor exists.
diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c
index c1108297604..3e5eec3cf5c 100644
--- a/sys/arch/i386/i386/esm.c
+++ b/sys/arch/i386/i386/esm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esm.c,v 1.45 2007/01/10 15:41:27 dlg Exp $ */
+/* $OpenBSD: esm.c,v 1.46 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -104,7 +104,7 @@ struct esm_sensor {
u_int16_t th_hi_crit;
} es_thresholds;
- struct sensor *es_sensor;
+ struct ksensor *es_sensor;
TAILQ_ENTRY(esm_sensor) es_entry;
};
@@ -115,7 +115,7 @@ struct esm_softc {
TAILQ_HEAD(, esm_sensor) sc_sensors;
struct esm_sensor *sc_nextsensor;
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
int sc_retries;
volatile int sc_step;
struct timeout sc_timeout;
@@ -822,7 +822,7 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,
struct esm_smb_resp resp;
struct esm_smb_resp_val *val = &resp.resp_val;
struct esm_sensor *es;
- struct sensor *s;
+ struct ksensor *s;
int nsensors, i, j;
const char *psulabels[] = {
"AC", "SW", "OK", "ON", "FFAN", "OTMP"
@@ -873,13 +873,13 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,
* go through these hoops to deal with it.
*/
nsensors = 4;
- s = malloc(sizeof(struct sensor) * nsensors, M_DEVBUF,
+ s = malloc(sizeof(struct ksensor) * nsensors, M_DEVBUF,
M_NOWAIT);
if (s == NULL) {
free(es, M_DEVBUF);
return;
}
- memset(s, 0, sizeof(struct sensor) * nsensors);
+ memset(s, 0, sizeof(struct ksensor) * nsensors);
for (j = 0; j < nsensors; j++) {
snprintf(s[j].desc, sizeof(s[j].desc), "%s %d",
@@ -892,13 +892,13 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,
* this expands it out to 6 separate indicators
*/
nsensors = 6;
- s = malloc(sizeof(struct sensor) * nsensors, M_DEVBUF,
+ s = malloc(sizeof(struct ksensor) * nsensors, M_DEVBUF,
M_NOWAIT);
if (s == NULL) {
free(es, M_DEVBUF);
return;
}
- memset(s, 0, sizeof(struct sensor) * nsensors);
+ memset(s, 0, sizeof(struct ksensor) * nsensors);
for (j = 0; j < nsensors; j++) {
snprintf(s[j].desc, sizeof(s[j].desc), "%s %s",
@@ -919,12 +919,12 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,
default:
nsensors = 1;
- s = malloc(sizeof(struct sensor), M_DEVBUF, M_NOWAIT);
+ s = malloc(sizeof(struct ksensor), M_DEVBUF, M_NOWAIT);
if (s == NULL) {
free(es, M_DEVBUF);
return;
}
- memset(s, 0, sizeof(struct sensor));
+ memset(s, 0, sizeof(struct ksensor));
strlcpy(s->desc, sensor_map[i].name, sizeof(s->desc));
break;
diff --git a/sys/arch/macppc/dev/asms.c b/sys/arch/macppc/dev/asms.c
index 5c71f5219ec..9937a890483 100644
--- a/sys/arch/macppc/dev/asms.c
+++ b/sys/arch/macppc/dev/asms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asms.c,v 1.4 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: asms.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
*
@@ -61,8 +61,8 @@ struct asms_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[ASMS_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ASMS_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int asms_match(struct device *, void *, void *);
diff --git a/sys/arch/macppc/dev/smu.c b/sys/arch/macppc/dev/smu.c
index bea7c2e0f29..87c6a481be2 100644
--- a/sys/arch/macppc/dev/smu.c
+++ b/sys/arch/macppc/dev/smu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smu.c,v 1.16 2007/03/14 22:49:00 kettenis Exp $ */
+/* $OpenBSD: smu.c,v 1.17 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -43,14 +43,14 @@ struct smu_fan {
u_int16_t min_rpm;
u_int16_t max_rpm;
u_int16_t unmanaged_rpm;
- struct sensor sensor;
+ struct ksensor sensor;
};
#define SMU_MAXSENSORS 3
struct smu_sensor {
u_int8_t reg;
- struct sensor sensor;
+ struct ksensor sensor;
};
struct smu_softc {
@@ -75,7 +75,7 @@ struct smu_softc {
struct smu_sensor sc_sensors[SMU_MAXSENSORS];
int sc_num_sensors;
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
u_int16_t sc_cpu_diode_scale;
int16_t sc_cpu_diode_offset;
diff --git a/sys/arch/sparc64/dev/pcf8591_ofw.c b/sys/arch/sparc64/dev/pcf8591_ofw.c
index 2b8b661b13d..9c637732dc9 100644
--- a/sys/arch/sparc64/dev/pcf8591_ofw.c
+++ b/sys/arch/sparc64/dev/pcf8591_ofw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcf8591_ofw.c,v 1.2 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: pcf8591_ofw.c,v 1.3 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Damien Miller <djm@openbsd.org>
@@ -28,7 +28,7 @@
struct pcfadc_channel {
u_int chan_num;
- struct sensor chan_sensor;
+ struct ksensor chan_sensor;
};
struct pcfadc_softc {
@@ -38,7 +38,7 @@ struct pcfadc_softc {
u_char sc_xlate[256];
u_int sc_nchan;
struct pcfadc_channel sc_channels[PCF8591_CHANNELS];
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
};
int pcfadc_match(struct device *, void *, void *);
diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h
index 285f3a808ee..0193bf8c03c 100644
--- a/sys/dev/acpi/acpidev.h
+++ b/sys/dev/acpi/acpidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidev.h,v 1.20 2007/01/27 19:37:57 marco Exp $ */
+/* $OpenBSD: acpidev.h,v 1.21 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
@@ -264,8 +264,8 @@ struct acpiac_softc {
int sc_ac_stat;
- struct sensor sc_sens[1];
- struct sensordev sc_sensdev;
+ struct ksensor sc_sens[1];
+ struct ksensordev sc_sensdev;
};
struct acpibat_softc {
@@ -281,8 +281,8 @@ struct acpibat_softc {
struct acpibat_bst sc_bst;
volatile int sc_bat_present;
- struct sensor sc_sens[8];
- struct sensordev sc_sensdev;
+ struct ksensor sc_sens[8];
+ struct ksensordev sc_sensdev;
};
struct acpidock_softc {
@@ -294,8 +294,8 @@ struct acpidock_softc {
struct acpi_softc *sc_acpi;
struct aml_node *sc_devnode;
- struct sensor sc_sens[1];
- struct sensordev sc_sensdev;
+ struct ksensor sc_sens[1];
+ struct ksensordev sc_sensdev;
int sc_docked;
int sc_sta;
diff --git a/sys/dev/acpi/acpitz.c b/sys/dev/acpi/acpitz.c
index cb27442c078..dc99e45827f 100644
--- a/sys/dev/acpi/acpitz.c
+++ b/sys/dev/acpi/acpitz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpitz.c,v 1.15 2007/02/14 01:31:12 deanna Exp $ */
+/* $OpenBSD: acpitz.c,v 1.16 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
@@ -51,8 +51,8 @@ struct acpitz_softc {
int sc_tc1;
int sc_tc2;
int sc_lasttmp;
- struct sensor sc_sens;
- struct sensordev sc_sensdev;
+ struct ksensor sc_sens;
+ struct ksensordev sc_sensdev;
};
int acpitz_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/ad741x.c b/sys/dev/i2c/ad741x.c
index b78642772aa..4c3e2d47529 100644
--- a/sys/dev/i2c/ad741x.c
+++ b/sys/dev/i2c/ad741x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ad741x.c,v 1.9 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: ad741x.c,v 1.10 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -48,8 +48,8 @@ struct adc_softc {
int sc_chip;
u_int8_t sc_config;
- struct sensor sc_sensor[ADC_MAX_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADC_MAX_SENSORS];
+ struct ksensordev sc_sensordev;
};
int adc_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/adm1021.c b/sys/dev/i2c/adm1021.c
index d2658649877..b8f44afe0d9 100644
--- a/sys/dev/i2c/adm1021.c
+++ b/sys/dev/i2c/adm1021.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1021.c,v 1.25 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: adm1021.c,v 1.26 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -45,8 +45,8 @@ struct admtemp_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[ADMTEMP_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADMTEMP_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_noexternal;
};
diff --git a/sys/dev/i2c/adm1024.c b/sys/dev/i2c/adm1024.c
index 0709f7af6f6..630cc3cdec6 100644
--- a/sys/dev/i2c/adm1024.c
+++ b/sys/dev/i2c/adm1024.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1024.c,v 1.12 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: adm1024.c,v 1.13 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -61,8 +61,8 @@ struct admlc_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[ADMLC_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADMLC_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_fan1mul;
int sc_fan2mul;
};
@@ -184,7 +184,7 @@ admlc_attach(struct device *parent, struct device *self, void *aux)
}
static void
-fanval(struct sensor *sens, int mul, u_int8_t data)
+fanval(struct ksensor *sens, int mul, u_int8_t data)
{
int tmp = data * mul;
diff --git a/sys/dev/i2c/adm1025.c b/sys/dev/i2c/adm1025.c
index 5a59ebb2367..911c8398203 100644
--- a/sys/dev/i2c/adm1025.c
+++ b/sys/dev/i2c/adm1025.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1025.c,v 1.23 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: adm1025.c,v 1.24 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -61,8 +61,8 @@ struct admtm_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[ADMTM_NUM_SENSORS + SMSC_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADMTM_NUM_SENSORS + SMSC_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_nsensors;
int sc_model;
};
diff --git a/sys/dev/i2c/adm1026.c b/sys/dev/i2c/adm1026.c
index dc63020ab6f..26cea62b63e 100644
--- a/sys/dev/i2c/adm1026.c
+++ b/sys/dev/i2c/adm1026.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1026.c,v 1.8 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: adm1026.c,v 1.9 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -78,8 +78,8 @@ struct admcts_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[ADMCTS_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADMCTS_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_fanmul[8];
};
@@ -226,7 +226,7 @@ admcts_attach(struct device *parent, struct device *self, void *aux)
}
static void
-fanval(struct sensor *sens, int mul, u_int8_t data)
+fanval(struct ksensor *sens, int mul, u_int8_t data)
{
int tmp = data * mul;
diff --git a/sys/dev/i2c/adm1030.c b/sys/dev/i2c/adm1030.c
index 8d09cf010af..3e8f9ee7aca 100644
--- a/sys/dev/i2c/adm1030.c
+++ b/sys/dev/i2c/adm1030.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1030.c,v 1.6 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: adm1030.c,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -42,8 +42,8 @@ struct admtmp_softc {
i2c_addr_t sc_addr;
int sc_fanmul;
- struct sensor sc_sensor[ADMTMP_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADMTMP_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int admtmp_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/adm1031.c b/sys/dev/i2c/adm1031.c
index 6b8149e2739..cdbc443e71d 100644
--- a/sys/dev/i2c/adm1031.c
+++ b/sys/dev/i2c/adm1031.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1031.c,v 1.6 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: adm1031.c,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -47,8 +47,8 @@ struct admtt_softc {
i2c_addr_t sc_addr;
int sc_fanmul;
- struct sensor sc_sensor[ADMTT_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADMTT_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int admtt_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/adt7460.c b/sys/dev/i2c/adt7460.c
index ea648f55981..52d2ce85247 100644
--- a/sys/dev/i2c/adt7460.c
+++ b/sys/dev/i2c/adt7460.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adt7460.c,v 1.16 2006/12/31 06:47:14 deraadt Exp $ */
+/* $OpenBSD: adt7460.c,v 1.17 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -106,8 +106,8 @@ struct adt_softc {
u_int8_t sc_conf;
struct adt_chip *chip;
- struct sensor sc_sensor[ADT_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ADT_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int adt_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/asb100.c b/sys/dev/i2c/asb100.c
index f8770a25b8f..43759eab6dc 100644
--- a/sys/dev/i2c/asb100.c
+++ b/sys/dev/i2c/asb100.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asb100.c,v 1.8 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: asb100.c,v 1.9 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Damien Miller <djm@openbsd.org>
@@ -106,8 +106,8 @@ struct asbtm_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[ASB100_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[ASB100_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_fanmul[3];
int sc_satellite[2];
};
@@ -271,7 +271,7 @@ asbtm_attach(struct device *parent, struct device *self, void *aux)
}
static void
-fanval(struct sensor *sens, int mul, u_int8_t data)
+fanval(struct ksensor *sens, int mul, u_int8_t data)
{
int tmp = data * mul;
diff --git a/sys/dev/i2c/ds1631.c b/sys/dev/i2c/ds1631.c
index 184db2e6537..0eeb55f8b8b 100644
--- a/sys/dev/i2c/ds1631.c
+++ b/sys/dev/i2c/ds1631.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ds1631.c,v 1.7 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: ds1631.c,v 1.8 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -40,8 +40,8 @@ struct maxds_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[MAXDS_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[MAXDS_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int maxds_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/fcu.c b/sys/dev/i2c/fcu.c
index ba4dbd0e81d..ea2ec733291 100644
--- a/sys/dev/i2c/fcu.c
+++ b/sys/dev/i2c/fcu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fcu.c,v 1.5 2007/01/07 18:27:46 deraadt Exp $ */
+/* $OpenBSD: fcu.c,v 1.6 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -50,8 +50,8 @@ struct fcu_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[FCU_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[FCU_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int fcu_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/fintek.c b/sys/dev/i2c/fintek.c
index 928f8202770..7ad803d5ebb 100644
--- a/sys/dev/i2c/fintek.c
+++ b/sys/dev/i2c/fintek.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fintek.c,v 1.4 2006/12/24 01:26:20 deraadt Exp $ */
+/* $OpenBSD: fintek.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@openbsd.org>
*
@@ -38,8 +38,8 @@ struct fintek_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[F_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[F_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int fintek_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/gl518sm.c b/sys/dev/i2c/gl518sm.c
index fb674283ff1..d92cccab043 100644
--- a/sys/dev/i2c/gl518sm.c
+++ b/sys/dev/i2c/gl518sm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gl518sm.c,v 1.4 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: gl518sm.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
@@ -59,8 +59,8 @@ struct glenv_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[GLENV_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[GLENV_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_fan1_div, sc_fan2_div;
};
diff --git a/sys/dev/i2c/lm75.c b/sys/dev/i2c/lm75.c
index 92f99fd4d54..34cb7e53774 100644
--- a/sys/dev/i2c/lm75.c
+++ b/sys/dev/i2c/lm75.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm75.c,v 1.14 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: lm75.c,v 1.15 2007/03/22 16:55:31 deraadt Exp $ */
/* $NetBSD: lm75.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
* Copyright (c) 2006 Theo de Raadt <deraadt@openbsd.org>
@@ -61,8 +61,8 @@ struct lmtemp_softc {
int sc_model;
int sc_bits;
- struct sensor sc_sensor;
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor;
+ struct ksensordev sc_sensordev;
};
int lmtemp_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/lm87.c b/sys/dev/i2c/lm87.c
index 3eeced4bda1..038b7d50961 100644
--- a/sys/dev/i2c/lm87.c
+++ b/sys/dev/i2c/lm87.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm87.c,v 1.17 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: lm87.c,v 1.18 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -61,8 +61,8 @@ struct lmenv_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor[LMENV_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[LMENV_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
int sc_fan1_div, sc_fan2_div;
int sc_family;
};
diff --git a/sys/dev/i2c/maxim6690.c b/sys/dev/i2c/maxim6690.c
index 80031bd0768..f8448595d13 100644
--- a/sys/dev/i2c/maxim6690.c
+++ b/sys/dev/i2c/maxim6690.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: maxim6690.c,v 1.13 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: maxim6690.c,v 1.14 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -54,8 +54,8 @@ struct maxtmp_softc {
u_int8_t sc_temp_invalid[2];
u_int8_t sc_temp2_mask;
- struct sensor sc_sensor[MAXTMP_NUM_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[MAXTMP_NUM_SENSORS];
+ struct ksensordev sc_sensordev;
};
int maxtmp_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/pca9554.c b/sys/dev/i2c/pca9554.c
index 237c78d97ef..dae1db08d55 100644
--- a/sys/dev/i2c/pca9554.c
+++ b/sys/dev/i2c/pca9554.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pca9554.c,v 1.9 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: pca9554.c,v 1.10 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -45,8 +45,8 @@ struct pcagpio_softc {
struct gpio_chipset_tag sc_gpio_gc;
gpio_pin_t sc_gpio_pins[PCAGPIO_NPINS];
- struct sensor sc_sensor[PCAGPIO_NPINS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor[PCAGPIO_NPINS];
+ struct ksensordev sc_sensordev;
};
int pcagpio_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/tsl2560.c b/sys/dev/i2c/tsl2560.c
index e5dd30ba1a6..967981acfd9 100644
--- a/sys/dev/i2c/tsl2560.c
+++ b/sys/dev/i2c/tsl2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsl2560.c,v 1.4 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: tsl2560.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -40,8 +40,8 @@ struct tsl_softc {
i2c_tag_t sc_tag;
i2c_addr_t sc_addr;
- struct sensor sc_sensor;
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor;
+ struct ksensordev sc_sensordev;
};
int tsl_match(struct device *, void *, void *);
diff --git a/sys/dev/i2c/w83l784r.c b/sys/dev/i2c/w83l784r.c
index ee4c7cac726..9795bab4aef 100644
--- a/sys/dev/i2c/w83l784r.c
+++ b/sys/dev/i2c/w83l784r.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: w83l784r.c,v 1.10 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: w83l784r.c,v 1.11 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
@@ -78,8 +78,8 @@ struct wbenv_softc {
i2c_addr_t sc_addr[3];
u_int8_t sc_chip_id;
- struct sensor sc_sensors[WBENV_MAX_SENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensors[WBENV_MAX_SENSORS];
+ struct ksensordev sc_sensordev;
struct wbenv_sensor *sc_wbenv_sensors;
int sc_numsensors;
};
@@ -269,7 +269,7 @@ wbenv_refresh(void *arg)
void
w83l784r_refresh_volt(struct wbenv_softc *sc, int n)
{
- struct sensor *sensor = &sc->sc_sensors[n];
+ struct ksensor *sensor = &sc->sc_sensors[n];
int data, reg = sc->sc_wbenv_sensors[n].reg;
data = wbenv_readreg(sc, reg);
@@ -281,7 +281,7 @@ w83l784r_refresh_volt(struct wbenv_softc *sc, int n)
void
w83l785r_refresh_volt(struct wbenv_softc *sc, int n)
{
- struct sensor *sensor = &sc->sc_sensors[n];
+ struct ksensor *sensor = &sc->sc_sensors[n];
int data, reg = sc->sc_wbenv_sensors[n].reg;
data = wbenv_readreg(sc, reg);
@@ -293,7 +293,7 @@ w83l785r_refresh_volt(struct wbenv_softc *sc, int n)
void
wbenv_refresh_temp(struct wbenv_softc *sc, int n)
{
- struct sensor *sensor = &sc->sc_sensors[n];
+ struct ksensor *sensor = &sc->sc_sensors[n];
int sdata;
sdata = wbenv_readreg(sc, sc->sc_wbenv_sensors[n].reg);
@@ -305,7 +305,7 @@ wbenv_refresh_temp(struct wbenv_softc *sc, int n)
void
w83l784r_refresh_temp(struct wbenv_softc *sc, int n)
{
- struct sensor *sensor = &sc->sc_sensors[n];
+ struct ksensor *sensor = &sc->sc_sensors[n];
int16_t sdata;
u_int8_t cmd = 0;
@@ -318,7 +318,7 @@ w83l784r_refresh_temp(struct wbenv_softc *sc, int n)
void
w83l784r_refresh_fanrpm(struct wbenv_softc *sc, int n)
{
- struct sensor *sensor = &sc->sc_sensors[n];
+ struct ksensor *sensor = &sc->sc_sensors[n];
int data, divisor;
data = wbenv_readreg(sc, W83L784R_FANDIV);
@@ -340,7 +340,7 @@ w83l784r_refresh_fanrpm(struct wbenv_softc *sc, int n)
void
w83l785r_refresh_fanrpm(struct wbenv_softc *sc, int n)
{
- struct sensor *sensor = &sc->sc_sensors[n];
+ struct ksensor *sensor = &sc->sc_sensors[n];
int data, divisor;
data = wbenv_readreg(sc, W83L785R_FANDIV);
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index b28ff40d6b4..6650596dda8 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.176 2007/01/27 05:09:51 dlg Exp $ */
+/* $OpenBSD: ami.c,v 1.177 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -2442,11 +2442,11 @@ ami_create_sensors(struct ami_softc *sc)
if (ssc == NULL)
return (1);
- sc->sc_sensors = malloc(sizeof(struct sensor) * sc->sc_nunits,
+ sc->sc_sensors = malloc(sizeof(struct ksensor) * sc->sc_nunits,
M_DEVBUF, M_WAITOK);
if (sc->sc_sensors == NULL)
return (1);
- bzero(sc->sc_sensors, sizeof(struct sensor) * sc->sc_nunits);
+ bzero(sc->sc_sensors, sizeof(struct ksensor) * sc->sc_nunits);
strlcpy(sc->sc_sensordev.xname, DEVNAME(sc),
sizeof(sc->sc_sensordev.xname));
diff --git a/sys/dev/ic/amivar.h b/sys/dev/ic/amivar.h
index 5187bb50fe6..577bd0ba885 100644
--- a/sys/dev/ic/amivar.h
+++ b/sys/dev/ic/amivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amivar.h,v 1.51 2007/01/27 05:09:51 dlg Exp $ */
+/* $OpenBSD: amivar.h,v 1.52 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -141,8 +141,8 @@ struct ami_softc {
} sc_hdr[AMI_BIG_MAX_LDRIVES];
struct ami_rawsoftc *sc_rawsoftcs;
- struct sensor *sc_sensors;
- struct sensordev sc_sensordev;
+ struct ksensor *sc_sensors;
+ struct ksensordev sc_sensordev;
struct ami_big_diskarray *sc_bd;
};
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index 252499e4466..e1447c5136d 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.24 2007/01/18 14:46:24 mickey Exp $ */
+/* $OpenBSD: ciss.c,v 1.25 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -418,10 +418,10 @@ ciss_attach(struct ciss_softc *sc)
sc->sc_dev.dv_xname);
sc->sc_flags |= CISS_BIO;
- sc->sensors = malloc(sizeof(struct sensor) * sc->maxunits,
+ sc->sensors = malloc(sizeof(struct ksensor) * sc->maxunits,
M_DEVBUF, M_NOWAIT);
if (sc->sensors) {
- bzero(sc->sensors, sizeof(struct sensor) * sc->maxunits);
+ bzero(sc->sensors, sizeof(struct ksensor) * sc->maxunits);
strlcpy(sc->sensordev.xname, sc->sc_dev.dv_xname,
sizeof(sc->sensordev.xname));
for (i = 0; i < sc->maxunits;
diff --git a/sys/dev/ic/cissvar.h b/sys/dev/ic/cissvar.h
index c776adee065..2187c9afad0 100644
--- a/sys/dev/ic/cissvar.h
+++ b/sys/dev/ic/cissvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cissvar.h,v 1.6 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: cissvar.h,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -35,8 +35,8 @@ struct ciss_softc {
void *sc_sh;
struct proc *sc_thread;
int sc_flush;
- struct sensor *sensors;
- struct sensordev sensordev;
+ struct ksensor *sensors;
+ struct ksensordev sensordev;
u_int sc_flags;
#define CISS_BIO 0x0001
diff --git a/sys/dev/ic/lm78.c b/sys/dev/ic/lm78.c
index 7f670e7f6ec..b99a310f3cc 100644
--- a/sys/dev/ic/lm78.c
+++ b/sys/dev/ic/lm78.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm78.c,v 1.13 2007/02/22 20:44:51 kettenis Exp $ */
+/* $OpenBSD: lm78.c,v 1.14 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
@@ -575,7 +575,7 @@ lm_refresh_sensor_data(struct lm_softc *sc)
void
lm_refresh_volt(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int data;
data = sc->lm_readreg(sc, sc->lm_sensors[n].reg);
@@ -587,7 +587,7 @@ lm_refresh_volt(struct lm_softc *sc, int n)
void
lm_refresh_temp(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int sdata;
/*
@@ -609,7 +609,7 @@ lm_refresh_temp(struct lm_softc *sc, int n)
void
lm_refresh_fanrpm(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int data, divisor = 1;
/*
@@ -661,7 +661,7 @@ wb_refresh_sensor_data(struct lm_softc *sc)
void
wb_w83637hf_refresh_vcore(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int data;
data = sc->lm_readreg(sc, sc->lm_sensors[n].reg);
@@ -681,7 +681,7 @@ wb_w83637hf_refresh_vcore(struct lm_softc *sc, int n)
void
wb_refresh_nvolt(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int data;
data = sc->lm_readreg(sc, sc->lm_sensors[n].reg);
@@ -694,7 +694,7 @@ wb_refresh_nvolt(struct lm_softc *sc, int n)
void
wb_w83627ehf_refresh_nvolt(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int data;
data = sc->lm_readreg(sc, sc->lm_sensors[n].reg);
@@ -707,7 +707,7 @@ wb_w83627ehf_refresh_nvolt(struct lm_softc *sc, int n)
void
wb_refresh_temp(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int sdata;
/*
@@ -733,7 +733,7 @@ wb_refresh_temp(struct lm_softc *sc, int n)
void
wb_refresh_fanrpm(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int fan, data, divisor = 0;
/*
@@ -782,7 +782,7 @@ wb_refresh_fanrpm(struct lm_softc *sc, int n)
void
wb_w83792d_refresh_fanrpm(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int reg, shift, data, divisor = 1;
switch (sc->lm_sensors[n].reg) {
@@ -827,7 +827,7 @@ wb_w83792d_refresh_fanrpm(struct lm_softc *sc, int n)
void
as_refresh_temp(struct lm_softc *sc, int n)
{
- struct sensor *sensor = &sc->sensors[n];
+ struct ksensor *sensor = &sc->sensors[n];
int sdata;
/*
diff --git a/sys/dev/ic/lm78var.h b/sys/dev/ic/lm78var.h
index eff056f1154..3d526396ff6 100644
--- a/sys/dev/ic/lm78var.h
+++ b/sys/dev/ic/lm78var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm78var.h,v 1.10 2007/02/22 20:44:51 kettenis Exp $ */
+/* $OpenBSD: lm78var.h,v 1.11 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
@@ -137,8 +137,8 @@ struct lm_sensor {
struct lm_softc {
struct device sc_dev;
- struct sensor sensors[WB_MAX_SENSORS];
- struct sensordev sensordev;
+ struct ksensor sensors[WB_MAX_SENSORS];
+ struct ksensordev sensordev;
struct lm_sensor *lm_sensors;
u_int numsensors;
void (*refresh_sensor_data) (struct lm_softc *);
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 16f149d0582..af9498e6202 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.70 2007/02/14 00:53:16 dlg Exp $ */
+/* $OpenBSD: mfi.c,v 1.71 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -1788,11 +1788,11 @@ mfi_create_sensors(struct mfi_softc *sc)
if (ssc == NULL)
return (1);
- sc->sc_sensors = malloc(sizeof(struct sensor) * sc->sc_ld_cnt,
+ sc->sc_sensors = malloc(sizeof(struct ksensor) * sc->sc_ld_cnt,
M_DEVBUF, M_WAITOK);
if (sc->sc_sensors == NULL)
return (1);
- bzero(sc->sc_sensors, sizeof(struct sensor) * sc->sc_ld_cnt);
+ bzero(sc->sc_sensors, sizeof(struct ksensor) * sc->sc_ld_cnt);
strlcpy(sc->sc_sensordev.xname, DEVNAME(sc),
sizeof(sc->sc_sensordev.xname));
diff --git a/sys/dev/ic/mfivar.h b/sys/dev/ic/mfivar.h
index f001f80f1f8..de88877a4fc 100644
--- a/sys/dev/ic/mfivar.h
+++ b/sys/dev/ic/mfivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfivar.h,v 1.29 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: mfivar.h,v 1.30 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -144,8 +144,8 @@ struct mfi_softc {
struct mfi_ccb_list sc_ccb_freeq;
- struct sensor *sc_sensors;
- struct sensordev sc_sensordev;
+ struct ksensor *sc_sensors;
+ struct ksensordev sc_sensordev;
};
int mfi_attach(struct mfi_softc *sc);
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 5b741030663..e4a0bb5c2e6 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.52 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: ipmi.c,v 1.53 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -53,7 +53,7 @@ struct ipmi_sensor {
int i_num;
int stype;
int etype;
- struct sensor i_sensor;
+ struct ksensor i_sensor;
SLIST_ENTRY(ipmi_sensor) list;
};
diff --git a/sys/dev/ipmivar.h b/sys/dev/ipmivar.h
index 713ddde65b8..636d49cbd57 100644
--- a/sys/dev/ipmivar.h
+++ b/sys/dev/ipmivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmivar.h,v 1.17 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: ipmivar.h,v 1.18 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -104,7 +104,7 @@ struct ipmi_softc {
struct ipmi_bmc_args *sc_iowait_args;
struct ipmi_sensor *current_sensor;
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
};
struct ipmi_thread {
diff --git a/sys/dev/isa/aps.c b/sys/dev/isa/aps.c
index dde25c571fc..5ad9cfd94d2 100644
--- a/sys/dev/isa/aps.c
+++ b/sys/dev/isa/aps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aps.c,v 1.13 2007/01/05 07:00:37 jsg Exp $ */
+/* $OpenBSD: aps.c,v 1.14 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
*
@@ -90,8 +90,8 @@ struct aps_softc {
bus_space_tag_t aps_iot;
bus_space_handle_t aps_ioh;
- struct sensor sensors[APS_NUM_SENSORS];
- struct sensordev sensordev;
+ struct ksensor sensors[APS_NUM_SENSORS];
+ struct ksensordev sensordev;
void (*refresh_sensor_data)(struct aps_softc *);
struct sensor_rec aps_data;
diff --git a/sys/dev/isa/it.c b/sys/dev/isa/it.c
index 578c0cd0488..63583a3ddbf 100644
--- a/sys/dev/isa/it.c
+++ b/sys/dev/isa/it.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: it.c,v 1.21 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: it.c,v 1.22 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2003 Julien Bordet <zejames@greyhats.org>
@@ -61,9 +61,9 @@ void it_setup_volt(struct it_softc *, int, int);
void it_setup_temp(struct it_softc *, int, int);
void it_setup_fan(struct it_softc *, int, int);
-void it_generic_stemp(struct it_softc *, struct sensor *);
-void it_generic_svolt(struct it_softc *, struct sensor *);
-void it_generic_fanrpm(struct it_softc *, struct sensor *);
+void it_generic_stemp(struct it_softc *, struct ksensor *);
+void it_generic_svolt(struct it_softc *, struct ksensor *);
+void it_generic_fanrpm(struct it_softc *, struct ksensor *);
void it_refresh_sensor_data(struct it_softc *);
void it_refresh(void *);
@@ -236,7 +236,7 @@ it_setup_fan(struct it_softc *sc, int start, int n)
}
void
-it_generic_stemp(struct it_softc *sc, struct sensor *sensors)
+it_generic_stemp(struct it_softc *sc, struct ksensor *sensors)
{
int i, sdata;
@@ -248,7 +248,7 @@ it_generic_stemp(struct it_softc *sc, struct sensor *sensors)
}
void
-it_generic_svolt(struct it_softc *sc, struct sensor *sensors)
+it_generic_svolt(struct it_softc *sc, struct ksensor *sensors)
{
int i, sdata;
@@ -270,7 +270,7 @@ it_generic_svolt(struct it_softc *sc, struct sensor *sensors)
}
void
-it_generic_fanrpm(struct it_softc *sc, struct sensor *sensors)
+it_generic_fanrpm(struct it_softc *sc, struct ksensor *sensors)
{
int i, sdata, divisor, odivisor, ndivisor;
diff --git a/sys/dev/isa/itvar.h b/sys/dev/isa/itvar.h
index 509c8e23697..4bd39aa4783 100644
--- a/sys/dev/isa/itvar.h
+++ b/sys/dev/isa/itvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: itvar.h,v 1.3 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: itvar.h,v 1.4 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2003 Julien Bordet <zejames@greyhats.org>
@@ -80,8 +80,8 @@ struct it_softc {
bus_space_tag_t it_iot;
bus_space_handle_t it_ioh;
- struct sensor sensors[IT_NUM_SENSORS];
- struct sensordev sensordev;
+ struct ksensor sensors[IT_NUM_SENSORS];
+ struct ksensordev sensordev;
u_int numsensors;
void (*refresh_sensor_data)(struct it_softc *);
diff --git a/sys/dev/isa/nsclpcsio_isa.c b/sys/dev/isa/nsclpcsio_isa.c
index 3159c4158e5..1f6e7c8bd9c 100644
--- a/sys/dev/isa/nsclpcsio_isa.c
+++ b/sys/dev/isa/nsclpcsio_isa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsclpcsio_isa.c,v 1.10 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: nsclpcsio_isa.c,v 1.11 2007/03/22 16:55:31 deraadt Exp $ */
/* $NetBSD: nsclpcsio_isa.c,v 1.5 2002/10/22 16:18:26 drochner Exp $ */
/*
@@ -176,8 +176,8 @@ struct nsclpcsio_softc {
struct gpio_pin sc_gpio_pins[SIO_GPIO_NPINS];
/* TMS and VLM */
- struct sensor sensors[SIO_NUM_SENSORS];
- struct sensordev sensordev;
+ struct ksensor sensors[SIO_NUM_SENSORS];
+ struct ksensordev sensordev;
};
#define GPIO_READ(sc, reg) \
diff --git a/sys/dev/isa/viasio.c b/sys/dev/isa/viasio.c
index 6dca69d62d1..00f097b08b4 100644
--- a/sys/dev/isa/viasio.c
+++ b/sys/dev/isa/viasio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: viasio.c,v 1.8 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: viasio.c,v 1.9 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
*
@@ -52,8 +52,8 @@ struct viasio_softc {
/* Hardware monitor */
bus_space_handle_t sc_hm_ioh;
int sc_hm_clock;
- struct sensor sc_hm_sensors[VT1211_HM_NSENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_hm_sensors[VT1211_HM_NSENSORS];
+ struct ksensordev sc_sensordev;
struct timeout sc_hm_timo;
/* Watchdog timer */
diff --git a/sys/dev/onewire/owid.c b/sys/dev/onewire/owid.c
index 26711ee23a9..55639a19b56 100644
--- a/sys/dev/onewire/owid.c
+++ b/sys/dev/onewire/owid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owid.c,v 1.3 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: owid.c,v 1.4 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -37,8 +37,8 @@ struct owid_softc {
void * sc_onewire;
u_int64_t sc_rom;
- struct sensor sc_sensor;
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor;
+ struct ksensordev sc_sensordev;
int sc_dying;
};
diff --git a/sys/dev/onewire/owsbm.c b/sys/dev/onewire/owsbm.c
index 663ddc185f0..e67d7b8506a 100644
--- a/sys/dev/onewire/owsbm.c
+++ b/sys/dev/onewire/owsbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owsbm.c,v 1.1 2007/02/28 21:54:43 grange Exp $ */
+/* $OpenBSD: owsbm.c,v 1.2 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2007 Aaron Linville <aaron@linville.org>
@@ -62,12 +62,12 @@ struct owsbm_softc {
void * sc_onewire;
u_int64_t sc_rom;
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
- struct sensor sc_temp;
- struct sensor sc_voltage_vdd; /* Battery, AD = 1*/
- struct sensor sc_voltage_vad; /* General purpose, AD = 0 */
- struct sensor sc_voltage_cr; /* Current Register */
+ struct ksensor sc_temp;
+ struct ksensor sc_voltage_vdd; /* Battery, AD = 1*/
+ struct ksensor sc_voltage_vad; /* General purpose, AD = 0 */
+ struct ksensor sc_voltage_cr; /* Current Register */
struct rwlock sc_lock;
};
diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c
index a470b841279..47f78c67612 100644
--- a/sys/dev/onewire/owtemp.c
+++ b/sys/dev/onewire/owtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owtemp.c,v 1.6 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: owtemp.c,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -51,8 +51,8 @@ struct owtemp_softc {
void * sc_onewire;
u_int64_t sc_rom;
- struct sensor sc_sensor;
- struct sensordev sc_sensordev;
+ struct ksensor sc_sensor;
+ struct ksensordev sc_sensordev;
struct rwlock sc_lock;
};
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index b37b8d90710..0000231dbe2 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.58 2007/02/20 17:06:23 thib Exp $ */
+/* $OpenBSD: arc.c,v 1.59 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -384,8 +384,8 @@ struct arc_softc {
struct rwlock sc_lock;
volatile int sc_talking;
- struct sensor *sc_sensors;
- struct sensordev sc_sensordev;
+ struct ksensor *sc_sensors;
+ struct ksensordev sc_sensordev;
int sc_nsensors;
};
#define DEVNAME(_s) ((_s)->sc_dev.dv_xname)
@@ -1536,9 +1536,9 @@ arc_create_sensors(void *xsc, void *arg)
}
sc->sc_nsensors = bi.bi_novol;
- sc->sc_sensors = malloc(sizeof(struct sensor) * sc->sc_nsensors,
+ sc->sc_sensors = malloc(sizeof(struct ksensor) * sc->sc_nsensors,
M_DEVBUF, M_WAITOK);
- bzero(sc->sc_sensors, sizeof(struct sensor) * sc->sc_nsensors);
+ bzero(sc->sc_sensors, sizeof(struct ksensor) * sc->sc_nsensors);
strlcpy(sc->sc_sensordev.xname, DEVNAME(sc),
sizeof(sc->sc_sensordev.xname));
diff --git a/sys/dev/pci/mbg.c b/sys/dev/pci/mbg.c
index f317d4e96c9..a5ba23a4489 100644
--- a/sys/dev/pci/mbg.c
+++ b/sys/dev/pci/mbg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbg.c,v 1.12 2007/01/03 13:27:12 mbalmer Exp $ */
+/* $OpenBSD: mbg.c,v 1.13 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org>
@@ -37,9 +37,9 @@ struct mbg_softc {
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
- struct sensor sc_timedelta;
- struct sensor sc_signal;
- struct sensordev sc_sensordev;
+ struct ksensor sc_timedelta;
+ struct ksensor sc_signal;
+ struct ksensordev sc_sensordev;
u_int8_t sc_status;
int (*sc_read)(struct mbg_softc *, int cmd,
diff --git a/sys/dev/pci/viaenv.c b/sys/dev/pci/viaenv.c
index 04d389b86d1..6a9ae98ea5e 100644
--- a/sys/dev/pci/viaenv.c
+++ b/sys/dev/pci/viaenv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: viaenv.c,v 1.9 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: viaenv.c,v 1.10 2007/03/22 16:55:31 deraadt Exp $ */
/* $NetBSD: viaenv.c,v 1.9 2002/10/02 16:51:59 thorpej Exp $ */
/*
@@ -69,8 +69,8 @@ struct viaenv_softc {
int sc_fan_div[2]; /* fan RPM divisor */
- struct sensor sc_data[VIANUMSENSORS];
- struct sensordev sc_sensordev;
+ struct ksensor sc_data[VIANUMSENSORS];
+ struct ksensordev sc_sensordev;
};
int viaenv_match(struct device *, void *, void *);
diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c
index ea7adb909ec..85bbc7beb5e 100644
--- a/sys/dev/usb/udcf.c
+++ b/sys/dev/usb/udcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udcf.c,v 1.29 2007/01/02 22:40:22 mbalmer Exp $ */
+/* $OpenBSD: udcf.c,v 1.30 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org>
@@ -98,11 +98,11 @@ struct udcf_softc {
time_t sc_last;
int sc_nrecv; /* consecutive valid times */
struct timeval sc_last_tv; /* uptime of last valid time */
- struct sensor sc_sensor;
+ struct ksensor sc_sensor;
#ifdef UDCF_DEBUG
- struct sensor sc_skew; /* recv vs local skew */
+ struct ksensor sc_skew; /* recv vs local skew */
#endif
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
};
/*
diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c
index ff0ac07195a..cc198160998 100644
--- a/sys/kern/kern_sensors.c
+++ b/sys/kern/kern_sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sensors.c,v 1.16 2006/12/23 17:41:26 deraadt Exp $ */
+/* $OpenBSD: kern_sensors.c,v 1.17 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -32,7 +32,7 @@
#include "hotplug.h"
int sensordev_count = 0;
-SLIST_HEAD(, sensordev) sensordev_list = SLIST_HEAD_INITIALIZER(sensordev_list);
+SLIST_HEAD(, ksensordev) sensordev_list = SLIST_HEAD_INITIALIZER(sensordev_list);
struct sensor_task {
void *arg;
@@ -51,9 +51,9 @@ void sensor_task_schedule(struct sensor_task *);
TAILQ_HEAD(, sensor_task) tasklist = TAILQ_HEAD_INITIALIZER(tasklist);
void
-sensordev_install(struct sensordev *sensdev)
+sensordev_install(struct ksensordev *sensdev)
{
- struct sensordev *v, *nv;
+ struct ksensordev *v, *nv;
int s;
s = splhigh();
@@ -77,10 +77,10 @@ sensordev_install(struct sensordev *sensdev)
}
void
-sensor_attach(struct sensordev *sensdev, struct sensor *sens)
+sensor_attach(struct ksensordev *sensdev, struct ksensor *sens)
{
- struct sensor *v, *nv;
- struct sensors_head *sh;
+ struct ksensor *v, *nv;
+ struct ksensors_head *sh;
int s, i;
s = splhigh();
@@ -113,13 +113,13 @@ sensor_attach(struct sensordev *sensdev, struct sensor *sens)
}
void
-sensordev_deinstall(struct sensordev *sensdev)
+sensordev_deinstall(struct ksensordev *sensdev)
{
int s;
s = splhigh();
sensordev_count--;
- SLIST_REMOVE(&sensordev_list, sensdev, sensordev, list);
+ SLIST_REMOVE(&sensordev_list, sensdev, ksensordev, list);
splx(s);
#if NHOTPLUG > 0
@@ -128,15 +128,15 @@ sensordev_deinstall(struct sensordev *sensdev)
}
void
-sensor_detach(struct sensordev *sensdev, struct sensor *sens)
+sensor_detach(struct ksensordev *sensdev, struct ksensor *sens)
{
- struct sensors_head *sh;
+ struct ksensors_head *sh;
int s;
s = splhigh();
sh = &sensdev->sensors_list;
sensdev->sensors_count--;
- SLIST_REMOVE(sh, sens, sensor, list);
+ SLIST_REMOVE(sh, sens, ksensor, list);
/* we only decrement maxnumt[] if this is the tail
* sensor of this type
*/
@@ -145,10 +145,10 @@ sensor_detach(struct sensordev *sensdev, struct sensor *sens)
splx(s);
}
-struct sensordev *
+struct ksensordev *
sensordev_get(int num)
{
- struct sensordev *sd;
+ struct ksensordev *sd;
SLIST_FOREACH(sd, &sensordev_list, list)
if (sd->num == num)
@@ -157,12 +157,12 @@ sensordev_get(int num)
return (NULL);
}
-struct sensor *
+struct ksensor *
sensor_find(int dev, enum sensor_type type, int numt)
{
- struct sensor *s;
- struct sensordev *sensdev;
- struct sensors_head *sh;
+ struct ksensor *s;
+ struct ksensordev *sensdev;
+ struct ksensors_head *sh;
sensdev = sensordev_get(dev);
if (sensdev == NULL)
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 1178c4313f3..0f6b4ae48a5 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.148 2007/02/20 17:42:29 deraadt Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.149 2007/03/22 16:55:31 deraadt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -1776,8 +1776,10 @@ int
sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp,
void *newp, size_t newlen)
{
- struct sensor *s, *tmps;
- struct sensordev *sd, *tmpsd;
+ struct ksensor *ks;
+ struct sensor *us;
+ struct ksensordev *ksd;
+ struct sensordev *usd;
int dev, numt, ret;
enum sensor_type type;
@@ -1786,38 +1788,46 @@ sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp,
dev = name[0];
if (namelen == 1) {
- sd = sensordev_get(dev);
- if (sd == NULL)
+ ksd = sensordev_get(dev);
+ if (ksd == NULL)
return (ENOENT);
/* Grab a copy, to clear the kernel pointers */
- tmpsd = malloc(sizeof(*tmpsd), M_TEMP, M_WAITOK);
- bcopy(sd, tmpsd, sizeof(*tmpsd));
- bzero(&tmpsd->list, sizeof(tmpsd->list));
- bzero(&tmpsd->sensors_list, sizeof(tmpsd->sensors_list));
-
- ret = sysctl_rdstruct(oldp, oldlenp, newp, tmpsd,
+ usd = malloc(sizeof(*usd), M_TEMP, M_WAITOK);
+ bzero(usd, sizeof(*usd));
+ usd->num = ksd->num;
+ strlcpy(usd->xname, ksd->xname, sizeof(usd->xname));
+ memcpy(usd->maxnumt, ksd->maxnumt, sizeof(usd->maxnumt));
+ usd->sensors_count = ksd->sensors_count;
+
+ ret = sysctl_rdstruct(oldp, oldlenp, newp, usd,
sizeof(struct sensordev));
- free(tmpsd, M_TEMP);
+ free(usd, M_TEMP);
return (ret);
}
type = name[1];
numt = name[2];
- s = sensor_find(dev, type, numt);
- if (s == NULL)
+ ks = sensor_find(dev, type, numt);
+ if (ks == NULL)
return (ENOENT);
/* Grab a copy, to clear the kernel pointers */
- tmps = malloc(sizeof(*tmps), M_TEMP, M_WAITOK);
- bcopy(s, tmps, sizeof(*tmps));
- bzero(&tmps->list, sizeof(tmps->list));
-
- ret = sysctl_rdstruct(oldp, oldlenp, newp, tmps,
+ us = malloc(sizeof(*us), M_TEMP, M_WAITOK);
+ bzero(us, sizeof(*us));
+ memcpy(us->desc, ks->desc, sizeof(ks->desc));
+ us->tv = ks->tv;
+ us->value = ks->value;
+ us->type = ks->type;
+ us->status = ks->status;
+ us->numt = ks->numt;
+ us->flags = ks->flags;
+
+ ret = sysctl_rdstruct(oldp, oldlenp, newp, us,
sizeof(struct sensor));
- free(tmps, M_TEMP);
+ free(us, M_TEMP);
return (ret);
}
diff --git a/sys/kern/tty_nmea.c b/sys/kern/tty_nmea.c
index 3d7cb7e694c..fd7d28a5be5 100644
--- a/sys/kern/tty_nmea.c
+++ b/sys/kern/tty_nmea.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_nmea.c,v 1.20 2007/03/20 20:14:29 deraadt Exp $ */
+/* $OpenBSD: tty_nmea.c,v 1.21 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2006, 2007 Marc Balmer <mbalmer@openbsd.org>
@@ -48,8 +48,8 @@ int nmea_count; /* this is wrong, it should really be a SLIST */
struct nmea {
char cbuf[NMEAMAX]; /* receive buffer */
- struct sensor time; /* the timedelta sensor */
- struct sensordev timedev;
+ struct ksensor time; /* the timedelta sensor */
+ struct ksensordev timedev;
struct timespec ts; /* current timestamp */
struct timespec lts; /* timestamp of last '$' seen */
int64_t gap; /* gap between two sentences */
diff --git a/sys/scsi/safte.c b/sys/scsi/safte.c
index f9626728678..ce874794f35 100644
--- a/sys/scsi/safte.c
+++ b/sys/scsi/safte.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safte.c,v 1.33 2007/02/21 22:37:38 deanna Exp $ */
+/* $OpenBSD: safte.c,v 1.34 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -50,7 +50,7 @@ void safte_attach(struct device *, struct device *, void *);
int safte_detach(struct device *, int);
struct safte_sensor {
- struct sensor se_sensor;
+ struct ksensor se_sensor;
enum {
SAFTE_T_FAN,
SAFTE_T_PWRSUP,
@@ -71,7 +71,7 @@ struct safte_softc {
int sc_nsensors;
struct safte_sensor *sc_sensors;
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
int sc_celsius;
int sc_ntemps;
diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c
index 0f2adcdad1c..e50009e59fc 100644
--- a/sys/scsi/ses.c
+++ b/sys/scsi/ses.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ses.c,v 1.42 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: ses.c,v 1.43 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -51,7 +51,7 @@ void ses_attach(struct device *, struct device *, void *);
int ses_detach(struct device *, int);
struct ses_sensor {
- struct sensor se_sensor;
+ struct ksensor se_sensor;
u_int8_t se_type;
struct ses_status *se_stat;
@@ -83,7 +83,7 @@ struct ses_softc {
TAILQ_HEAD(, ses_slot) sc_slots;
#endif
TAILQ_HEAD(, ses_sensor) sc_sensors;
- struct sensordev sc_sensordev;
+ struct ksensordev sc_sensordev;
};
struct cfattach ses_ca = {
diff --git a/sys/sys/sensors.h b/sys/sys/sensors.h
index 6c764f827f3..411027ecaa2 100644
--- a/sys/sys/sensors.h
+++ b/sys/sys/sensors.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.h,v 1.22 2007/02/23 22:55:40 deraadt Exp $ */
+/* $OpenBSD: sensors.h,v 1.23 2007/03/22 16:55:31 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -68,7 +68,6 @@ static const char * const sensor_type_s[SENSOR_MAX_TYPES + 1] = {
"timedelta",
"undefined"
};
-
#endif /* !_KERNEL */
#define SENSOR_DRIVE_EMPTY 1
@@ -91,9 +90,10 @@ enum sensor_status {
SENSOR_S_UNKNOWN /* status is unknown */
};
-/* Sensor data */
+/* Sensor data:
+ * New fields should be added at the end to encourage backwards compat
+ */
struct sensor {
- SLIST_ENTRY(sensor) list; /* device-scope list */
char desc[32]; /* sensor description, may be empty */
struct timeval tv; /* sensor value last change time */
int64_t value; /* current value */
@@ -104,31 +104,53 @@ struct sensor {
#define SENSOR_FINVALID 0x0001 /* sensor is invalid */
#define SENSOR_FUNKNOWN 0x0002 /* sensor value is unknown */
};
-SLIST_HEAD(sensors_head, sensor);
-/* Sensor device data */
+/* Sensor device data:
+ * New fields should be added at the end to encourage backwards compat
+ */
struct sensordev {
- SLIST_ENTRY(sensordev) list;
int num; /* sensordev number */
char xname[16]; /* unix device name */
int maxnumt[SENSOR_MAX_TYPES];
int sensors_count;
- struct sensors_head sensors_list;
};
#define MAXSENSORDEVICES 32
#ifdef _KERNEL
-/* struct sensordev */
-void sensordev_install(struct sensordev *);
-void sensordev_deinstall(struct sensordev *);
-struct sensordev *sensordev_get(int);
+/* Sensor data */
+struct ksensor {
+ SLIST_ENTRY(ksensor) list; /* device-scope list */
+ char desc[32]; /* sensor description, may be empty */
+ struct timeval tv; /* sensor value last change time */
+ int64_t value; /* current value */
+ enum sensor_type type; /* sensor type */
+ enum sensor_status status; /* sensor status */
+ int numt; /* sensor number of .type type */
+ int flags; /* sensor flags, ie. SENSOR_FINVALID */
+};
+SLIST_HEAD(ksensors_head, ksensor);
+
+/* Sensor device data */
+struct ksensordev {
+ SLIST_ENTRY(ksensordev) list;
+ int num; /* sensordev number */
+ char xname[16]; /* unix device name */
+ int maxnumt[SENSOR_MAX_TYPES];
+ int sensors_count;
+ struct ksensors_head sensors_list;
+};
+
+/* struct ksensordev */
+void sensordev_install(struct ksensordev *);
+void sensordev_deinstall(struct ksensordev *);
+struct ksensordev *sensordev_get(int);
-/* struct sensor */
-void sensor_attach(struct sensordev *, struct sensor *);
-void sensor_detach(struct sensordev *, struct sensor *);
-struct sensor *sensor_find(int, enum sensor_type, int);
+/* struct ksensor */
+void sensor_attach(struct ksensordev *, struct ksensor *);
+void sensor_detach(struct ksensordev *, struct ksensor *);
+struct ksensor *sensor_find(int, enum sensor_type, int);
/* task scheduling */
int sensor_task_register(void *, void (*)(void *), int);