diff options
author | 2000-11-08 18:10:37 +0000 | |
---|---|---|
committer | 2000-11-08 18:10:37 +0000 | |
commit | 591e0ca75a39e5cfe89cd5cfbe6a9a4dfa937238 (patch) | |
tree | 695a938ce9079932137b732e8b0a37d8cdc42696 /sys/dev/usb/uhid.c | |
parent | sync (diff) | |
download | wireguard-openbsd-591e0ca75a39e5cfe89cd5cfbe6a9a4dfa937238.tar.xz wireguard-openbsd-591e0ca75a39e5cfe89cd5cfbe6a9a4dfa937238.zip |
Sync with NetBSD. Too many changes to mention. For now I have skipped
umass.c and ukbd.c as the diffs are a bit hairier.
Diffstat (limited to 'sys/dev/usb/uhid.c')
-rw-r--r-- | sys/dev/usb/uhid.c | 80 |
1 files changed, 21 insertions, 59 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 41459b39e88..e47a2454e3d 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uhid.c,v 1.11 2000/07/04 11:44:23 fgsch Exp $ */ -/* $NetBSD: uhid.c,v 1.37 2000/04/14 14:12:47 augustss Exp $ */ +/* $OpenBSD: uhid.c,v 1.12 2000/11/08 18:10:38 aaron Exp $ */ +/* $NetBSD: uhid.c,v 1.40 2000/10/10 12:37:01 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhid.c,v 1.22 1999/11/17 22:33:43 n_hibma Exp $ */ /* @@ -150,13 +150,11 @@ Static struct cdevsw uhid_cdevsw = { }; #endif -Static void uhid_intr __P((usbd_xfer_handle, usbd_private_handle, - usbd_status)); +Static void uhid_intr(usbd_xfer_handle, usbd_private_handle, usbd_status); -Static int uhid_do_read __P((struct uhid_softc *, struct uio *uio, int)); -Static int uhid_do_write __P((struct uhid_softc *, struct uio *uio, int)); -Static int uhid_do_ioctl __P((struct uhid_softc *, u_long, caddr_t, int, - struct proc *)); +Static int uhid_do_read(struct uhid_softc *, struct uio *uio, int); +Static int uhid_do_write(struct uhid_softc *, struct uio *uio, int); +Static int uhid_do_ioctl(struct uhid_softc*, u_long, caddr_t, int,struct proc*); USB_DECLARE_DRIVER(uhid); @@ -218,7 +216,7 @@ USB_ATTACH(uhid) sc->sc_ep_addr = ed->bEndpointAddress; - desc = 0; + desc = NULL; err = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_USBDEV); if (err) { printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev)); @@ -254,9 +252,7 @@ USB_ATTACH(uhid) #if defined(__NetBSD__) || defined(__OpenBSD__) int -uhid_activate(self, act) - device_ptr_t self; - enum devact act; +uhid_activate(device_ptr_t self, enum devact act) { struct uhid_softc *sc = (struct uhid_softc *)self; @@ -313,7 +309,8 @@ USB_DETACH(uhid) /* XXX not implemented yet */ #endif - free(sc->sc_repdesc, M_USBDEV); + if (sc->sc_repdesc) + free(sc->sc_repdesc, M_USBDEV); usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, USBDEV(sc->sc_dev)); @@ -322,10 +319,7 @@ USB_DETACH(uhid) } void -uhid_intr(xfer, addr, status) - usbd_xfer_handle xfer; - usbd_private_handle addr; - usbd_status status; +uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) { struct uhid_softc *sc = addr; @@ -366,11 +360,7 @@ uhid_intr(xfer, addr, status) } int -uhidopen(dev, flag, mode, p) - dev_t dev; - int flag; - int mode; - struct proc *p; +uhidopen(dev_t dev, int flag, int mode, struct proc *p) { struct uhid_softc *sc; usbd_status err; @@ -415,11 +405,7 @@ uhidopen(dev, flag, mode, p) } int -uhidclose(dev, flag, mode, p) - dev_t dev; - int flag; - int mode; - struct proc *p; +uhidclose(dev_t dev, int flag, int mode, struct proc *p) { struct uhid_softc *sc; @@ -445,10 +431,7 @@ uhidclose(dev, flag, mode, p) } int -uhid_do_read(sc, uio, flag) - struct uhid_softc *sc; - struct uio *uio; - int flag; +uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag) { int s; int error = 0; @@ -510,10 +493,7 @@ uhid_do_read(sc, uio, flag) } int -uhidread(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; +uhidread(dev_t dev, struct uio *uio, int flag) { struct uhid_softc *sc; int error; @@ -528,10 +508,7 @@ uhidread(dev, uio, flag) } int -uhid_do_write(sc, uio, flag) - struct uhid_softc *sc; - struct uio *uio; - int flag; +uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag) { int error; int size; @@ -562,10 +539,7 @@ uhid_do_write(sc, uio, flag) } int -uhidwrite(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; +uhidwrite(dev_t dev, struct uio *uio, int flag) { struct uhid_softc *sc; int error; @@ -580,12 +554,8 @@ uhidwrite(dev, uio, flag) } int -uhid_do_ioctl(sc, cmd, addr, flag, p) - struct uhid_softc *sc; - u_long cmd; - caddr_t addr; - int flag; - struct proc *p; +uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, + int flag, struct proc *p) { struct usb_ctl_report_desc *rd; struct usb_ctl_report *re; @@ -695,12 +665,7 @@ uhid_do_ioctl(sc, cmd, addr, flag, p) } int -uhidioctl(dev, cmd, addr, flag, p) - dev_t dev; - u_long cmd; - caddr_t addr; - int flag; - struct proc *p; +uhidioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) { struct uhid_softc *sc; int error; @@ -715,10 +680,7 @@ uhidioctl(dev, cmd, addr, flag, p) } int -uhidpoll(dev, events, p) - dev_t dev; - int events; - struct proc *p; +uhidpoll(dev_t dev, int events, struct proc *p) { struct uhid_softc *sc; int revents = 0; |