From f1a1841fd46d19db9e9c9715c72e7253c6821208 Mon Sep 17 00:00:00 2001 From: thompsa Date: Tue, 24 Feb 2009 03:43:05 +0000 Subject: MFp4 //depot/projects/usb@157974 Add support for setting and getting the USB template value through libusb20 and usbconfig. Submitted by: Hans Petter Selasky --- usr.sbin/usbconfig/usbconfig.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'usr.sbin/usbconfig') diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index 4b69dc5..8a4ac1d 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -42,6 +42,7 @@ struct options { const char *quirkname; void *buffer; + int template; gid_t gid; uid_t uid; mode_t mode; @@ -65,6 +66,8 @@ struct options { uint8_t got_set_alt:1; uint8_t got_set_owner:1; uint8_t got_set_perm:1; + uint8_t got_set_template:1; + uint8_t got_get_template:1; uint8_t got_suspend:1; uint8_t got_resume:1; uint8_t got_reset:1; @@ -99,6 +102,8 @@ enum { T_SET_ALT, T_SET_OWNER, T_SET_PERM, + T_SET_TEMPLATE, + T_GET_TEMPLATE, T_ADD_DEVICE_QUIRK, T_REMOVE_DEVICE_QUIRK, T_SHOW_IFACE_DRIVER, @@ -130,6 +135,8 @@ static const struct token token[] = { {"set_alt", T_SET_ALT, 1}, {"set_owner", T_SET_OWNER, 1}, {"set_perm", T_SET_PERM, 1}, + {"set_template", T_SET_TEMPLATE, 1}, + {"get_template", T_GET_TEMPLATE, 0}, {"add_dev_quirk_vplh", T_ADD_DEVICE_QUIRK, 5}, {"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, @@ -283,6 +290,8 @@ usage(void) " set_alt " "\n" " set_owner " "\n" " set_perm " "\n" + " set_template