summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_autoconf.c
diff options
context:
space:
mode:
authormk <mk@openbsd.org>2006-05-28 01:33:50 +0000
committermk <mk@openbsd.org>2006-05-28 01:33:50 +0000
commit7a67db76dd056adc7bf322132dc4a836b9479f75 (patch)
treecc6d75336a710565f40c5bf210c705b813e68f34 /sys/kern/subr_autoconf.c
parentrename mpi_complete to mpi_poll and make it call mpi_start itself. (diff)
downloadwireguard-openbsd-7a67db76dd056adc7bf322132dc4a836b9479f75.tar.xz
wireguard-openbsd-7a67db76dd056adc7bf322132dc4a836b9479f75.zip
Include device id in hotplug events. This will be used by ntpd to check
sensors on attach/detach. hotplugd changes following in a minute. ok henning.
Diffstat (limited to 'sys/kern/subr_autoconf.c')
-rw-r--r--sys/kern/subr_autoconf.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 94fa73cf057..13c8acedbc1 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.46 2006/05/17 23:56:03 krw Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.47 2006/05/28 01:33:50 mk Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -397,7 +397,7 @@ config_attach(struct device *parent, void *match, void *aux, cfprint_t print)
config_process_deferred_children(dev);
#if NHOTPLUG > 0
if (!cold)
- hotplug_device_attach(cd->cd_class, dev->dv_xname);
+ hotplug_device_attach(cd->cd_class, dev->dv_xname, dev->dv_unit);
#endif
return (dev);
}
@@ -495,6 +495,7 @@ config_detach(struct device *dev, int flags)
int rv = 0, i;
#if NHOTPLUG > 0
char devname[16];
+ int devnum = dev->dv_unit;
strlcpy(devname, dev->dv_xname, sizeof(devname));
#endif
@@ -561,10 +562,10 @@ config_detach(struct device *dev, int flags)
for (cf = cfdata; cf->cf_driver; cf++) {
if (cf->cf_driver == cd) {
if (cf->cf_fstate == FSTATE_FOUND &&
- cf->cf_unit == dev->dv_unit)
+ cf->cf_unit == devnum)
cf->cf_fstate = FSTATE_NOTFOUND;
if (cf->cf_fstate == FSTATE_STAR &&
- cf->cf_unit == dev->dv_unit + 1)
+ cf->cf_unit == devnum + 1)
cf->cf_unit--;
}
}
@@ -578,7 +579,7 @@ config_detach(struct device *dev, int flags)
/*
* Remove from cfdriver's array, tell the world, and free softc.
*/
- cd->cd_devs[dev->dv_unit] = NULL;
+ cd->cd_devs[devnum] = NULL;
if ((flags & DETACH_QUIET) == 0)
printf("%s detached\n", dev->dv_xname);
@@ -598,7 +599,7 @@ config_detach(struct device *dev, int flags)
#if NHOTPLUG > 0
if (!cold)
- hotplug_device_detach(cd->cd_class, devname);
+ hotplug_device_detach(cd->cd_class, devname, devnum);
#endif
/*