Add ioctl USB_SET_REPORT for uhid. This will allow manipulating the

feature items.
This commit is contained in:
augustss 2000-03-19 22:23:28 +00:00
parent 5ce9472a83
commit c6eb2d324c
2 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhid.c,v 1.34 2000/02/29 21:37:01 augustss Exp $ */
/* $NetBSD: uhid.c,v 1.35 2000/03/19 22:23:28 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhid.c,v 1.22 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@ -635,6 +635,30 @@ uhid_do_ioctl(sc, cmd, addr, flag, p)
return (EIO);
break;
case USB_SET_REPORT:
re = (struct usb_ctl_report *)addr;
switch (re->report) {
case UHID_INPUT_REPORT:
size = sc->sc_isize;
id = sc->sc_iid;
break;
case UHID_OUTPUT_REPORT:
size = sc->sc_osize;
id = sc->sc_oid;
break;
case UHID_FEATURE_REPORT:
size = sc->sc_fsize;
id = sc->sc_fid;
break;
default:
return (EINVAL);
}
err = usbd_set_report(sc->sc_iface, re->report, id, re->data,
size);
if (err)
return (EIO);
break;
default:
return (EINVAL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.h,v 1.41 2000/02/29 21:37:01 augustss Exp $ */
/* $NetBSD: usb.h,v 1.42 2000/03/19 22:23:28 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
/*
@ -571,6 +571,7 @@ struct usb_event {
#define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc)
#define USB_SET_IMMED _IOW ('U', 22, int)
#define USB_GET_REPORT _IOWR('U', 23, struct usb_ctl_report)
#define USB_SET_REPORT _IOW ('U', 24, struct usb_ctl_report)
/* Generic USB device */
#define USB_GET_CONFIG _IOR ('U', 100, int)