From a4c3b7ec0287ed2c1f13db6adc27979043d7585d Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 25 Oct 2008 00:27:10 +0000 Subject: 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 --- sys/dev/onewire/owid.c | 4 +++- sys/dev/onewire/owsbm.c | 4 +++- sys/dev/onewire/owtemp.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'sys/dev') 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 @@ -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 @@ -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 @@ -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) { -- cgit v1.2.3