summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2008-10-25 00:27:09 +0000
committerderaadt <deraadt@openbsd.org>2008-10-25 00:27:09 +0000
commit0fb176696ddc1516f7c82988ad7c8721e7dea77a (patch)
tree19f9c827765e007f907ca374ec36d6aa853c3c85
parentregen (diff)
downloadwireguard-openbsd-0fb176696ddc1516f7c82988ad7c8721e7dea77a.tar.xz
wireguard-openbsd-0fb176696ddc1516f7c82988ad7c8721e7dea77a.zip
put the serial number into the name of the devices (for sysctl), because
Joerg Goltermann has so many of them and has convinced me that he cannot tell them apart. ok grange cnst henning
-rw-r--r--sys/dev/onewire/owid.c4
-rw-r--r--sys/dev/onewire/owsbm.c4
-rw-r--r--sys/dev/onewire/owtemp.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/onewire/owid.c b/sys/dev/onewire/owid.c
index 2470f48b263..e2efab5b6d2 100644
--- a/sys/dev/onewire/owid.c
+++ b/sys/dev/onewire/owid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owid.c,v 1.5 2007/06/01 21:30:31 cnst Exp $ */
+/* $OpenBSD: owid.c,v 1.6 2008/10/25 00:27:09 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -85,6 +85,8 @@ owid_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_INTEGER;
sc->sc_sensor.value = ONEWIRE_ROM_SN(sc->sc_rom);
+ snprintf(sc->sc_sensor.desc, sizeof(sc->sc_sensor.desc), "sn %012llx",
+ ONEWIRE_ROM_SN(oa->oa_rom));
sensor_attach(&sc->sc_sensordev, &sc->sc_sensor);
sensordev_install(&sc->sc_sensordev);
diff --git a/sys/dev/onewire/owsbm.c b/sys/dev/onewire/owsbm.c
index 3f6ef634f2a..3fb4faf54b4 100644
--- a/sys/dev/onewire/owsbm.c
+++ b/sys/dev/onewire/owsbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owsbm.c,v 1.4 2007/06/24 05:34:35 dlg Exp $ */
+/* $OpenBSD: owsbm.c,v 1.5 2008/10/25 00:27:09 deraadt Exp $ */
/*
* Copyright (c) 2007 Aaron Linville <aaron@linville.org>
@@ -117,6 +117,8 @@ owsbm_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
sizeof(sc->sc_sensordev.xname));
sc->sc_temp.type = SENSOR_TEMP;
+ snprintf(sc->sc_temp.desc, sizeof(sc->sc_temp.desc), "sn %012llx",
+ ONEWIRE_ROM_SN(oa->oa_rom));
sensor_attach(&sc->sc_sensordev, &sc->sc_temp);
/* Initialize voltage sensor */
diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c
index 38d990f59a9..204ed1e93f8 100644
--- a/sys/dev/onewire/owtemp.c
+++ b/sys/dev/onewire/owtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owtemp.c,v 1.9 2007/11/28 18:26:11 todd Exp $ */
+/* $OpenBSD: owtemp.c,v 1.10 2008/10/25 00:27:09 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -100,6 +100,8 @@ owtemp_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_TEMP;
+ snprintf(sc->sc_sensor.desc, sizeof(sc->sc_sensor.desc), "sn %012llx",
+ ONEWIRE_ROM_SN(oa->oa_rom));
sc->sc_sensortask = sensor_task_register(sc, owtemp_update, 5);
if (sc->sc_sensortask == NULL) {