diff options
Diffstat (limited to 'sys/dev/usb/uhidev.c')
-rw-r--r-- | sys/dev/usb/uhidev.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index b2a109a0441..ffaddf7e034 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uhidev.c,v 1.5 2002/07/25 04:07:33 nate Exp $ */ -/* $NetBSD: uhidev.c,v 1.6 2002/07/11 21:14:29 augustss Exp $ */ +/* $OpenBSD: uhidev.c,v 1.6 2002/11/11 02:32:32 nate Exp $ */ +/* $NetBSD: uhidev.c,v 1.10 2002/10/09 06:27:09 fair Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -241,6 +241,11 @@ USB_ATTACH(uhidev) USB_ATTACH_ERROR_RETURN; } #endif +#if defined(__NetBSD__) && NRND > 0 + rnd_attach_source(&dev->rnd_source, + USBDEVNAME(dev->sc_dev), + RND_TYPE_TTY, 0); +#endif } } } @@ -306,7 +311,6 @@ uhidev_activate(device_ptr_t self, enum devact act) switch (act) { case DVACT_ACTIVATE: return (EOPNOTSUPP); - break; case DVACT_DEACTIVATE: rv = 0; @@ -337,6 +341,9 @@ USB_DETACH(uhidev) rv = 0; for (i = 0; i < sc->sc_nrepid; i++) { if (sc->sc_subdevs[i] != NULL) { +#if defined(__NetBSD__) && NRND > 0 + rnd_detach_source(&sc->sc_subdevs[i]->rnd_source); +#endif rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags); sc->sc_subdevs[i] = NULL; } @@ -400,6 +407,9 @@ uhidev_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) printf("%s: bad input length %d != %d\n",USBDEVNAME(sc->sc_dev), scd->sc_in_rep_size, cc); #endif +#if defined(__NetBSD__) && NRND > 0 + rnd_add_uint32(&scd->rnd_source, (uintptr_t)(sc->sc_ibuf)); +#endif scd->sc_intr(scd, p, cc); } |