usbconfig: documentation fixes, mainly for -i option

* in usage(), clearly mark -i interface as optional
* both, -u busnum and -a devaddr are optional as well
* various minor man page fixes
* clearly mark those two commands that actually use -i ifaceidx
* remove unused bitfield tag got_iface
* fix indentation level according to review comment

Differential Revision:	https://reviews.freebsd.org/D33579/
Reviewed by:	hselasky
MFC after:	2 weeks
This commit is contained in:
Joerg Wunsch 2021-12-20 10:17:57 +01:00
parent ae450e6de9
commit cae1884d47
No known key found for this signature in database
GPG Key ID: 7E9EADC3030D34EB
2 changed files with 14 additions and 8 deletions

View File

@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd December 27, 2019
.Dd December 20, 2021
.Dt USBCONFIG 8
.Os
.Sh NAME
@ -33,9 +33,11 @@
.Nm
.Op Fl u Ar unit
.Op Fl a Ar addr
.Op Fl i Ar interface_index
.Op cmds...
.Nm
.Op Oo Fl d Oc Ar [ugen]<unit>.<addr>
.Fl d Ar [[/dev/]ugen]<unit>.<addr>
.Op Fl i Ar interface_index
.Op cmds...
.Sh DESCRIPTION
The
@ -49,7 +51,7 @@ Limit device range to USB devices connected to the given USBUS unit.
.It Fl a Ar addr
Limit device range to the given USB device index.
Should only be used in conjunction with the unit argument.
.It Fl d Ar [ugen]<unit>.<addr>
.It Fl d Ar [[/dev/]ugen]<unit>.<addr>
Limit device range to USB devices connected to the given unit and address.
The unit and address coordinates may be prefixed by the lowercased word "ugen",
or the full path name
@ -83,6 +85,9 @@ in
.Cm dump_curr_config_desc
output.
Usually there is no need to adjust this setting.
This command uses the
.Fl i Ar interface_index
option.
.It Cm set_template Ar template
Set the global USB device side template.
See
@ -128,6 +133,9 @@ or
currently attached to the device.
.It Cm detach_kernel_driver
Detach kernel driver for the selected interface and USB device.
This command uses the
.Fl i Ar interface_index
option.
.It Cm suspend
Force the device to suspend.
.It Cm resume

View File

@ -65,7 +65,6 @@ struct options {
uint8_t got_list:1;
uint8_t got_bus:1;
uint8_t got_addr:1;
uint8_t got_iface:1;
uint8_t got_set_config:1;
uint8_t got_set_alt:1;
uint8_t got_set_template:1;
@ -272,8 +271,8 @@ usage(void)
{
fprintf(stderr, ""
"usbconfig - configure the USB subsystem" "\n"
"usage: usbconfig -u <busnum> -a <devaddr> -i <ifaceindex> [cmds...]" "\n"
"usage: usbconfig -d [ugen]<busnum>.<devaddr> -i <ifaceindex> [cmds...]" "\n"
"usage: usbconfig [-u <busnum>] [-a <devaddr>] [-i <ifaceindex>] [cmds...]" "\n"
"usage: usbconfig -d [ugen]<busnum>.<devaddr> [-i <ifaceindex>] [cmds...]" "\n"
"commands:" "\n"
" set_config <cfg_index>" "\n"
" set_alt <alt_index>" "\n"
@ -576,7 +575,7 @@ main(int argc, char **argv)
if (strncmp(optarg, "ugen", strlen("ugen")) == 0) {
ptr = optarg + strlen("ugen");
} else if (strncmp(optarg, "/dev/ugen",
strlen("/dev/ugen")) == 0) {
strlen("/dev/ugen")) == 0) {
ptr = optarg + strlen("/dev/ugen");
} else {
ptr = optarg;
@ -596,7 +595,6 @@ main(int argc, char **argv)
case 'i':
opt->iface = num_id(optarg, "iface");
opt->got_iface = 1;
break;
case 'u':