summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ulpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/ulpt.c')
-rw-r--r--sys/dev/usb/ulpt.c94
1 files changed, 1 insertions, 93 deletions
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index fc9a630cdc2..0b58bb100be 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ulpt.c,v 1.23 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: ulpt.c,v 1.24 2007/06/01 06:12:20 mbalmer Exp $ */
/* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
@@ -48,14 +48,8 @@
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/kernel.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
#include <sys/uio.h>
#include <sys/conf.h>
#include <sys/vnode.h>
@@ -117,51 +111,8 @@ struct ulpt_softc {
int sc_refcnt;
u_char sc_dying;
-
-#if defined(__FreeBSD__)
- dev_t dev;
- dev_t dev_noprime;
-#endif
};
-#if defined(__NetBSD__)
-dev_type_open(ulptopen);
-dev_type_close(ulptclose);
-dev_type_write(ulptwrite);
-dev_type_ioctl(ulptioctl);
-
-const struct cdevsw ulpt_cdevsw = {
- ulptopen, ulptclose, noread, ulptwrite, ulptioctl,
- nostop, notty, nopoll, nommap, nokqfilter,
-};
-#elif defined(__FreeBSD__)
-Static d_open_t ulptopen;
-Static d_close_t ulptclose;
-Static d_write_t ulptwrite;
-Static d_ioctl_t ulptioctl;
-
-#define ULPT_CDEV_MAJOR 113
-
-Static struct cdevsw ulpt_cdevsw = {
- /* open */ ulptopen,
- /* close */ ulptclose,
- /* read */ noread,
- /* write */ ulptwrite,
- /* ioctl */ ulptioctl,
- /* poll */ nopoll,
- /* mmap */ nommap,
- /* strategy */ nostrategy,
- /* name */ "ulpt",
- /* maj */ ULPT_CDEV_MAJOR,
- /* dump */ nodump,
- /* psize */ nopsize,
- /* flags */ 0,
-#if !defined(__FreeBSD__) || (__FreeBSD__ < 5)
- /* bmaj */ -1
-#endif
-};
-#endif
-
void ulpt_disco(void *);
int ulpt_do_write(struct ulpt_softc *, struct uio *uio, int);
@@ -342,20 +293,10 @@ ulpt_attach(struct device *parent, struct device *self, void *aux)
}
}
#endif
-
-#if defined(__FreeBSD__)
- sc->dev = make_dev(&ulpt_cdevsw, device_get_unit(self),
- UID_ROOT, GID_OPERATOR, 0644, "ulpt%d", device_get_unit(self));
- sc->dev_noprime = make_dev(&ulpt_cdevsw,
- device_get_unit(self)|ULPT_NOPRIME,
- UID_ROOT, GID_OPERATOR, 0644, "unlpt%d", device_get_unit(self));
-#endif
-
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
USBDEV(sc->sc_dev));
}
-#if defined(__NetBSD__) || defined(__OpenBSD__)
int
ulpt_activate(device_ptr_t self, enum devact act)
{
@@ -371,18 +312,13 @@ ulpt_activate(device_ptr_t self, enum devact act)
}
return (0);
}
-#endif
int
ulpt_detach(struct device *self, int flags)
{
struct ulpt_softc *sc = (struct ulpt_softc *)self;
int s;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
int maj, mn;
-#elif defined(__FreeBSD__)
- struct vnode *vp;
-#endif
DPRINTF(("ulpt_detach: sc=%p\n", sc));
@@ -400,31 +336,15 @@ ulpt_detach(struct device *self, int flags)
}
splx(s);
-#if defined(__NetBSD__) || defined(__OpenBSD__)
/* locate the major number */
-#if defined(__NetBSD__)
- maj = cdevsw_lookup_major(&ulpt_cdevsw);
-#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == ulptopen)
break;
-#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
vdevgone(maj, mn, mn, VCHR);
vdevgone(maj, mn | ULPT_NOPRIME , mn | ULPT_NOPRIME, VCHR);
-#elif defined(__FreeBSD__)
- vp = SLIST_FIRST(&sc->dev->si_hlist);
- if (vp)
- VOP_REVOKE(vp, REVOKEALL);
- vp = SLIST_FIRST(&sc->dev_noprime->si_hlist);
- if (vp)
- VOP_REVOKE(vp, REVOKEALL);
-
- destroy_dev(sc->dev);
- destroy_dev(sc->dev_noprime);
-#endif
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
USBDEV(sc->sc_dev));
@@ -514,14 +434,6 @@ ulptopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
sc->sc_flags = flags;
DPRINTF(("ulptopen: flags=0x%x\n", (unsigned)flags));
-#if defined(ULPT_DEBUG) && defined(__FreeBSD__)
- /* Ignoring these flags might not be a good idea */
- if ((flags & ~ULPT_NOPRIME) != 0)
- printf("ulptopen: flags ignored: %b\n", flags,
- "\20\3POS_INIT\4POS_ACK\6PRIME_OPEN\7AUTOLF\10BYPASS");
-#endif
-
-
error = 0;
sc->sc_refcnt++;
@@ -749,7 +661,3 @@ ieee1284_print_id(char *str)
}
}
#endif
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass, usbd_driver_load, 0);
-#endif