Date: Mon, 6 Jan 2020 09:37:13 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r356404 - stable/10/usr.sbin/usbconfig Message-ID: <202001060937.0069bDrM013918@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Jan 6 09:37:13 2020 New Revision: 356404 URL: https://svnweb.freebsd.org/changeset/base/356404 Log: MFC r330875: Add "usbconfig dump_all_desc", a subcommand to dump all device and config descriptors. Reviewed by: hselasky@ Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/usbconfig/usbconfig.8 stable/10/usr.sbin/usbconfig/usbconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- stable/10/usr.sbin/usbconfig/usbconfig.8 Mon Jan 6 09:35:57 2020 (r356403) +++ stable/10/usr.sbin/usbconfig/usbconfig.8 Mon Jan 6 09:37:13 2020 (r356404) @@ -97,6 +97,8 @@ Remove a quirk. Add quirk for the currently selected USB device. .It Cm remove_quirk Ar quirk_name Remove a quirk for the currently selected USB device. +.It Cm dump_all_desc +Display the device and configuration descriptors. .It Cm dump_quirk_names Display the list of supported quirk names. .It Cm dump_device_quirks Modified: stable/10/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- stable/10/usr.sbin/usbconfig/usbconfig.c Mon Jan 6 09:35:57 2020 (r356403) +++ stable/10/usr.sbin/usbconfig/usbconfig.c Mon Jan 6 09:37:13 2020 (r356404) @@ -75,6 +75,7 @@ struct options { uint8_t got_power_on:1; uint8_t got_dump_device_quirks:1; uint8_t got_dump_quirk_names:1; + uint8_t got_dump_all_desc:1; uint8_t got_dump_device_desc:1; uint8_t got_dump_curr_config:1; uint8_t got_dump_all_config:1; @@ -110,6 +111,7 @@ enum { T_SHOW_IFACE_DRIVER, T_DUMP_QUIRK_NAMES, T_DUMP_DEVICE_QUIRKS, + T_DUMP_ALL_DESC, T_DUMP_DEVICE_DESC, T_DUMP_CURR_CONFIG_DESC, T_DUMP_ALL_CONFIG_DESC, @@ -142,6 +144,7 @@ static const struct token token[] = { {"remove_quirk", T_REMOVE_QUIRK, 1}, {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, {"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0}, + {"dump_all_desc", T_DUMP_ALL_DESC, 0}, {"dump_device_desc", T_DUMP_DEVICE_DESC, 0}, {"dump_curr_config_desc", T_DUMP_CURR_CONFIG_DESC, 0}, {"dump_all_config_desc", T_DUMP_ALL_CONFIG_DESC, 0}, @@ -281,6 +284,7 @@ usage(void) " remove_quirk <quirk>" "\n" " dump_quirk_names" "\n" " dump_device_quirks" "\n" + " dump_all_desc" "\n" " dump_device_desc" "\n" " dump_curr_config_desc" "\n" " dump_all_config_desc" "\n" @@ -487,7 +491,8 @@ flush_command(struct libusb20_backend *pbe, struct opt } } dump_any = - (opt->got_dump_device_desc || + (opt->got_dump_all_desc || + opt->got_dump_device_desc || opt->got_dump_curr_config || opt->got_dump_all_config || opt->got_dump_info); @@ -506,6 +511,10 @@ flush_command(struct libusb20_backend *pbe, struct opt } else if (opt->got_dump_curr_config) { printf("\n"); dump_config(pdev, 0); + } else if (opt->got_dump_all_desc) { + printf("\n"); + dump_device_desc(pdev); + dump_config(pdev, 1); } if (dump_any) { printf("\n"); @@ -692,6 +701,12 @@ main(int argc, char **argv) if (opt->got_get_template) duplicate_option(argv[n]); opt->got_get_template = 1; + opt->got_any++; + break; + case T_DUMP_ALL_DESC: + if (opt->got_dump_all_desc) + duplicate_option(argv[n]); + opt->got_dump_all_desc = 1; opt->got_any++; break; case T_DUMP_DEVICE_DESC:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001060937.0069bDrM013918>