aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usb_dev.c9
-rw-r--r--sys/dev/usb/usb_device.h4
-rw-r--r--sys/dev/usb/usb_ioctl.h2
3 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c
index f8e2c96fa349..8df78d236a73 100644
--- a/sys/dev/usb/usb_dev.c
+++ b/sys/dev/usb/usb_dev.c
@@ -1377,6 +1377,15 @@ usb2_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
case USB_DEV_QUIRK_REMOVE:
err = usb2_quirk_ioctl_p(cmd, data, fflag, td);
break;
+ case USB_GET_TEMPLATE:
+ *(int *)data = usb2_template;
+ break;
+ case USB_SET_TEMPLATE:
+ err = priv_check(curthread, PRIV_ROOT);
+ if (err)
+ break;
+ usb2_template = *(int *)data;
+ break;
default:
err = ENOTTY;
break;
diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h
index e20479d99cfa..4c296d456725 100644
--- a/sys/dev/usb/usb_device.h
+++ b/sys/dev/usb/usb_device.h
@@ -155,6 +155,10 @@ struct usb2_device {
char product[64]; /* product string */
};
+/* globals */
+
+extern int usb2_template;
+
/* function prototypes */
struct usb2_device *usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
diff --git a/sys/dev/usb/usb_ioctl.h b/sys/dev/usb/usb_ioctl.h
index 27e4beaac031..73f77964e110 100644
--- a/sys/dev/usb/usb_ioctl.h
+++ b/sys/dev/usb/usb_ioctl.h
@@ -267,6 +267,8 @@ struct usb2_gen_quirk {
#define USB_SET_PORT_DISABLE _IOW ('U', 144, int)
#define USB_SET_POWER_MODE _IOW ('U', 145, int)
#define USB_GET_POWER_MODE _IOR ('U', 146, int)
+#define USB_SET_TEMPLATE _IOW ('U', 147, int)
+#define USB_GET_TEMPLATE _IOR ('U', 148, int)
/* Modem device */
#define USB_GET_CM_OVER_DATA _IOR ('U', 180, int)