2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CFGADM_USB 1M "Mar 1, 2007"
8 cfgadm_usb \- USB hardware-specific commands for cfgadm
12 \fB/usr/sbin/cfgadm\fR [\fB-f\fR] [\fB-y\fR | \fB-n\fR] [\fB-v\fR] \fB-c\fR \fIfunction\fR \fIap_id\fR...
17 \fB/usr/sbin/cfgadm\fR \fB-f\fR [\fB-y\fR | \fB-n\fR] [\fB-v\fR] [\fB-o\fR \fIhardware_options\fR]
18 \fB-x\fR \fIhardware_function\fR \fIap_id\fR...
23 \fB/usr/sbin/cfgadm\fR \fB-v\fR [\fB-a\fR] [\fB-s\fR \fIlisting_option\fR]
24 [\fB-l\fR [\fIap_id\fR | \fIap_type\fR...]]
29 \fB/usr/sbin/cfgadm\fR \fB-v\fR \fB-h\fR [\fIap_id\fR]...
35 The Universal Serial Bus (\fBUSB\fR) hardware-specific library
36 \fB/usr/lib/cfgadm/usb.so.1\fR provides the functionality for administering
37 \fBUSB\fR devices via the \fBcfgadm\fR(1M) command. \fBcfgadm\fR operates on
38 attachment points. For details regarding attachment points, refer to
42 For \fBUSB\fR administration, the only attachment points supported are the
43 ports of hubs attached to the \fBUSB\fR bus.
46 Attachment points are named through attachment point IDs (\fIap_ids\fR). The
47 \fBUSB\fR bus is hierarchical, so the \fIap_ids\fR are as well. \fBUSB\fR hubs
48 have ports, numbered from \fB1\fR to \fIn\fR. All \fBUSB\fR \fIap_ids\fR
49 consist of a string of the following form:
53 usb\fIN\fR/\fIA\fR[.\fIB\fR[.\fIC\fR[...]]]
63 \fIN\fR is the \fIN\fRth \fBUSB\fR host controller on the system,
67 \fIA\fR is port #\fIA\fR on the root (top) hub.
71 \fIB\fR is port #\fIB\fR of the hub plugged into port #\fIA\fR of the hub above
76 \fIC\fR is port #\fIC\fR of the hub plugged into port #\fIB \fRof the hub above
81 For example, the first port on the root hub of USB controller \fB0\fR (the only
82 controller), has a logical \fIap_id\fR:
93 Similarly, the second port on the first external hub plugged into the first
94 port on the root hub of the first \fBUSB\fR controller has a logical
106 For example, if the \fIap_id\fR is \fBusb0/1.4.3.4\fR, it represents port
107 \fB4\fR of the hub plugged into port \fB3\fR of the hub plugged into port
108 \fB4\fR of the hub plugged into port \fB1\fR of the root hub of the first
109 \fBUSB\fR host controller on the system.
113 example# \fBcfgadm -l\fR
114 Ap_Id Type Receptacle Occupant Condition
115 usb0/1 USB-hub connected configured ok
116 usb0/2 unknown empty unconfigured ok
117 usb0/1.1 USB-storage connected configured ok
118 usb0/1.2 unknown empty unconfigured ok
119 usb0/1.3 unknown empty unconfigured ok
120 usb0/1.4 USB-device connected configured ok
127 \fBUSB2.0\fR chips have one \fBEHCI\fR host \fBUSB2.0\fR host controller and a
128 number of companion \fBUSB 1.\fR\fIx\fR host controllers (either \fBOHCI\fR or
129 \fBUHCI\fR host controllers).
132 When a \fBUSB2.0\fR device has been plugged in, it shows up on the \fBEHCI\fR
133 logical ports which might not have a \fB1\fR to \fB1\fR mapping to external
134 physical port numbers on the system. When a \fBUSB1.\fR\fIx\fR device is
135 plugged in, the \fBEHCI\fR host controller reroutes the device to a companion
136 host controller and the device shows up on the companion's logical port
140 The mapping of logical port numbers to physical port numbers can get quite
141 complicated. For example:
146 Ap_Id Type Receptacle Occupant Condition
147 c0 scsi-bus connected configured unknown
148 usb0/1 usb-mouse connected configured ok
149 usb0/2 usb-kbd connected configured ok
150 usb0/3 unknown empty unconfigured ok
151 usb0/4 usb-hub connected configured ok
152 usb0/4.1 unknown empty unconfigured ok
153 usb0/4.2 unknown empty unconfigured ok
154 usb0/4.3 unknown empty unconfigured ok
155 usb0/4.4 usb-storage connected configured ok
156 usb1/1 unknown empty unconfigured ok
157 usb1/2 unknown empty unconfigured ok
158 usb1/3 unknown empty unconfigured ok
159 usb2/1 unknown empty unconfigured ok
160 usb2/2 usb-device connected configured ok
161 usb3/1 unknown empty unconfigured ok
162 usb3/2 unknown empty unconfigured ok
163 usb3/3 unknown empty unconfigured ok
164 usb3/4 unknown empty unconfigured ok
165 usb3/5 unknown empty unconfigured ok
172 In this example \fBusb0\fR is the onboard USB 1.\fIx\fR host controller.
173 \fBusb1\fR and \fBusb2\fR are companion \fBOHCI USB1.\fR\fIx\fR host
174 controllers and \fBusb3\fR is an \fBEHCI USB2.0\fR host controller.
177 The following table shows the somewhat confusing routing for this USB2.0 chip:
181 logical port number physical port number
182 ------------------- --------------------
183 usb1/1 internal port 1
184 usb1/2 external port 1
185 usb1/3 external port 3
187 usb2/1 internal port 2
188 usb2/2 external port 2
190 usb3/1 internal port 1
191 usb3/2 internal port 2
192 usb3/3 external port 1
193 usb3/4 external port 2
194 usb3/5 external port 3
201 Unfortunately, the exact routing can often only be determined by
205 The receptacle states for attachment points at the \fBUSB\fR port have the
210 \fB\fBconnected\fR\fR
214 \fBUSB\fR port is powered on and enabled. A USB device is plugged in to the
215 port. The device is logically connected to the USB bus.
221 \fB\fBdisconnected\fR\fR
225 \fBUSB\fR port is powered on and enabled. A \fBUSB\fR device is plugged into
226 the port. The device has been logically disconnected from the \fBUSB\fR bus
227 (using the \fBcfgadm\fR \fB-c\fR \fBdisconnect\fR command).
237 \fBUSB\fR port is powered on, but no device is plugged in to it.
242 The occupant states for devices at \fBUSB\fR port attachment points at the
243 \fBUSB\fR port have the following meanings:
247 \fB\fBconfigured\fR\fR
251 The \fBUSB\fR device at the \fBUSB\fR port is configured and usable by Solaris.
257 \fB\fBunconfigured\fR\fR
261 The \fBUSB\fR device at the \fBUSB\fR port was explicitly off-lined using
262 \fBcfgadm\fR \fB-c\fR \fBunconfigure\fR, or was not successfully configured for
263 use with Solaris, for example, having no driver or a device problem.
268 The attachment point conditions are:
276 Normal state - ready for use.
306 The user has physically removed a device while an application had the device
307 open (there might be outstanding \fBI/O\fR). Users need to reinsert the same
308 physical device and close the application properly before removing the device
309 again. The port cannot configure other inserted devices until this is done.
311 If the original device cannot be reinserted into the port, see the \fI\fR for
312 instructions for clearing this attachment point condition.
327 A \fBUSB\fR device can be hotplugged or hotunplugged at any time, and the
328 system detects the event and takes the appropriate action.
331 It is not necessary to transition a receptacle to the \fBdisconnected\fR state
332 before removing its device from the \fBUSB\fR. However, it is not recommended
333 to hot-remove devices currently in use (such as removable disks currently
334 opened by a volume manager or some other application).
338 \fBcfgadm\fR defines several types of operations. These operations include
339 invoking configuration state changes (\fB-c\fR), invoking hardware-specific
340 functions (\fB-x\fR), and obtaining configuration administration help messages
344 If any of these operations fail, the device and attachment point might not be
345 in the expected state. Use the \fBcfgadm\fR \fB-l\fR command to display the
346 device's current status.
349 All other options have the same meaning as defined in \fBcfgadm\fR(1M).
352 The following options are supported:
356 \fB\fB-c\fR \fIfunction\fR\fR
360 The following generic commands are defined for the \fBUSB\fR hardware specific
361 library. The following configuration state change operations are supported:
365 \fB\fBconfigure\fR\fR
369 If there is a \fBUSB\fR device plugged into the port, this command attempts to
370 configure it and set everything up so that it is usable by Solaris. This
371 command does an implied \fBconnect\fR (reverse of \fBdisconnect\fR) if
372 necessary. This command accomplishes nothing, and returns an error message, if
373 the device at that port is already configured. After successful execution of
374 this command, the device is ready for use under Solaris.
380 \fB\fBdisconnect\fR\fR
384 Performs an \fBunconfigure\fR on the \fIap_id\fR (if it is not already
385 \fBunconfigured\fR), and then transitions the receptacle to the
386 \fBdisconnected\fR state, even though a device is still be plugged into the
387 port. Issuing a \fBcfgadm\fR \fB-c\fR \fBconfigure\fR, or physically
388 hotplugging the device, brings the device back to the \fBconnected\fR
389 receptacle state, and to the \fBconfigured\fR occupant state, assuming a driver
390 can be found and there are no problems enumerating and configuring the device.
396 \fB\fBunconfigure\fR\fR
400 Makes the device plugged into the port unusable by Solaris (offline it). If
401 successful, \fBcfgadm\fR reports this \fIap_id\fR's occupant state as
402 \fBunconfigured\fR. Issuing a \fBconfigure\fR to the \fIap_id\fR (if
403 successful) brings its occupant back to the \fBconfigured\fR (online)
404 condition, as it physically hotplugging the device on the port.
422 \fB\fB-h\fR \fIap_id\fR\fR
426 \fBUSB\fR specific help can be obtained by using the help option with any
427 \fBUSB\fR attachment point.
433 \fB\fB-l\fR[\fBv\fR]\fR
437 The \fB-l\fR option works as described in \fBcfgadm\fR(1M). When paired with
438 the \fB-v\fR option, the \fBInformation\fR field contains the following
439 \fBUSB\fR-specific information:
444 \fBMfg\fR: manufacturer string (\fBiManufacturer\fR)
450 \fBProduct\fR: product string (\fBiProduct\fR)
456 \fBNConfigs\fR: total number of configurations the device supports
457 (\fBbNumConfigurations\fR).
463 \fBConfig\fR: current configuration setting in decimal (configuration index,
464 not configuration value).
470 The configuration string descriptor for the current configuration
471 (\fBiConfiguration\fR)
473 See the Universal Serial Bus specification for a description of these fields.
479 \fB\fB-o\fR \fIhardware_options\fR\fR
483 Hardware options are only supported for the hardware-specific command, \fB-x\fR
484 \fBusb_config\fR. See the description of that command below for an explanation
485 of the options available.
491 \fB\fB-s\fR \fIlisting_options\fR\fR
495 Attachment points of class \fBUSB\fR can be listed by using the \fBselect\fR
496 sub-option. See \fBcfgadm\fR(1M).
502 \fB\fB-x\fR \fIhardware_function\fR\fR
506 The following hardware-specific functions are defined:
510 \fB\fBusb_config\fR \fB-o\fR \fBconfig=\fR\fIn\fR\fR
514 This command requires the mandatory \fBconfig\fR value to be specified using
517 Sets the \fBUSB\fR configuration of a multi-configuration \fBUSB\fR device at
518 \fIap_id\fR to configuration index \fIn\fR. The device is set to this
519 configuration henceforth and this setting persists across reboots, hot-removes,
520 and unconfigure/configure of the device.
522 Valid values of \fIn\fR range from \fB0\fR to (\fBNconfigs -1\fR). The device
523 is reset by a \fBdisconnect\fR followed by a \fBconfigure\fR. The
524 \fBconfigure\fR causes the device to be configured to the new configuration
527 If any of these steps fail, the configuration file and the device are restored
528 to their previous state and an error message is issued.
534 \fB\fBusb_reset\fR\fR
538 Performs a software reset (re-enumeration) of the device. This is the
539 equivalent of removing the device and inserting it back again. The port on the
540 hub is power cycled if the hub supports power cycling of individual ports.
542 If the connected device is a hub, this function has the effect of resetting
543 that hub and any devices down the tree of which it is the root.
545 If any of these steps fail, the device is restored to its previous state and an
546 error message is issued.
553 State table: attachment points state versus commands:
558 empty/unconfigured \(-> no device connected
560 disconnected/unconfigured \(-> logically disconnected,
562 devinfo node removed,
563 device physically connected
565 connected/unconfigured \(-> logically connected,
569 connected/configured \(-> connected, available
576 The table below clarifies the state transitions resulting from actions or
581 current state operation new state
582 ------------- --------- ---------
585 device plugged in: connected/configured or
586 connected/unconfigured
587 (if enumeration failed)
589 cfgadm -c unconfigure: empty/unconfigured
590 cfgadm -c configure: empty/unconfigured
591 cfgadm -c disconnect: empty/unconfigured
596 device plugged in: n/a
597 device removed: empty/unconfigured
598 cfgadm -c unconfigure: disconnected/unconfigured
599 cfgadm -c configure: connected/configured, or
600 connected/unconfigured
601 (if reenumeration failed)
602 cfgadm -c disconnect: disconnected/unconfigured
604 connected/unconfigured:
605 device plugged in: n/a
606 device removed: empty/unconfigured
607 cfgadm -c unconfigure: connected/unconfigured
608 cfgadm -c configure: connected/configured, or
609 connected/unconfigured
610 (if reenumeration failed)
611 cfgadm -c disconnect: disconnected/unconfigured
613 connected/configured:
614 device plugged in: n/a
615 device removed: empty/unconfigured or
616 connected/configured,
617 but with ap condition
619 was open when removed
620 cfgadm -c unconfigure: connected/unconfigured
621 cfgadm -c configure: connected/configured
622 cfgadm -c disconnect: disconnected/unconfigured
629 \fBExample 1 \fRListing the Status of All USB Devices
632 The following command lists the status of all \fBUSB\fR devices on the system:
638 Ap_Id Type Receptacle Occupant Condition
639 usb0/1 USB-hub connected configured ok
640 usb0/2 unknown empty unconfigured ok
641 usb0/1.1 USB-storage connected configured ok
642 usb0/1.2 unknown empty unconfigured ok
643 usb0/1.3 unknown empty unconfigured ok
644 usb0/1.4 USB-device connected configured ok
651 Notice that \fBcfgadm\fR treats the \fBUSB-device\fR device at \fBap_id
652 usb0/1.4\fR as a single unit, since it cannot currently control individual
656 \fBExample 2 \fRListing the Status of a Port with No Device Plugged In
659 The following command lists the status of a port with no device plugged in:
664 example# \fBcfgadm -l usb0/1.3\fR
665 Ap_Id Type Receptacle Occupant Condition
666 usb0/1.3 unknown empty unconfigured ok
672 \fBExample 3 \fRListing the Status of the Same Port with a Device Plugged In
675 The following command lists the status of the same port after physically
676 plugging in a device that configures without problems:
681 example# \fBcfgadm -l usb0/1.3\fR
682 Ap_Id Type Receptacle Occupant Condition
683 usb0/1.3 USB-hub connected configured ok
689 \fBExample 4 \fRUnconfiguring an Existing USB Device
692 The following command unconfigures the \fBUSB\fR device attached to
693 \fBusb0/1.3\fR, then displays the status of the \fBap_id\fR:
698 example# \fBcfgadm -c unconfigure usb0/1.3\fR
699 Unconfigure the device: /devices/pci@0,0/pci8086,7112@7,2/hub@2:2.3
700 This operation suspends activity on the USB device
707 example# \fBcfgadm -l usb0/1.3\fR
708 Ap_Id Type Receptacle Occupant Condition
709 usb0/1.3 unknown connected unconfigured ok
715 \fBExample 5 \fRUnconfiguring and Logically Disconnecting an Existing USB
719 The following command unconfigures and logically disconnects a \fBUSB\fR device
720 attached to \fBusb0/1.3\fR:
725 example# \fBcfgadm -c disconnect usb0/1.3\fR
726 Disconnect the device: /devices/pci@0,0/pci8086,7112@7,2/hub@2:2.3
727 This operation suspends activity on the USB device
734 example# \fBcfgadm -l usb0/1.3\fR
735 Ap_Id Type Receptacle Occupant Condition
736 usb0/1.3 unknown disconnected unconfigured ok
743 A \fBdisconnect\fR implies that \fBcfgadm\fR does an \fBunconfigure\fR first.
744 The receptacle status now shows \fBdisconnected\fR, even though the device is
745 still physically connected. In this case, a physical hotplug or using the
746 \fBcfgadm \fR\fB-c\fR \fBconfigure\fR on the \fBap_id\fR brings it back
750 \fBExample 6 \fRConfiguring a Previously Unconfigured USB Device
753 The following command configures a \fBUSB\fR device that was previously
754 attached to \fBusb0/1.3\fR:
759 example # \fBcfgadm -yc configure usb0/1.3\fR
760 example# \fBcfgadm -l usb0/1.3\fR
761 Ap_Id Type Receptacle Occupant Condition
762 usb0/1.3 unknown connected configured ok
768 \fBExample 7 \fRResetting a USB Device
771 The following command resets a \fBUSB\fR device:
776 example# \fBcfgadm -x usb_reset usb0/1.3\fR
777 Reset the device: /devices/pci@0,0/pci8086,7112@7,2/hub@2:2.3
778 This operation suspends activity on the USB device
789 \fBExample 8 \fRDisplaying Detailed Information About a USB Device
792 The following command displays detailed information about a \fBUSB\fR device.
793 This device shows the following \fBUSB\fR-specific information in
794 the '\fBInformation\fR' field:
800 Manufacturer string: Iomega
806 Product string: \fBUSB Zip 250\fR
812 Number of configurations supported: 1
818 Configuration currently active: 0
824 Configuration string descriptor for configuration 0: Default
829 example# \fBcfgadm -lv usb0/1.5\fR
830 Ap_Id Receptacle Occupant Condition Information
831 When Type Busy Phys_Id
832 usb0/1.5 connected configured ok Mfg:"Io
833 mega" Product:"USB Zip 250" NConfigs:1 Config:0 : Default
841 example# \fBcfgadm -l -s "cols=ap_id:info" usb0/1.5\fR
843 usb0/1.5 Mfg:"Iomega" Product:"USB Zip 250"
844 NConfigs:1 Config:0 : Default
850 \fBExample 9 \fRDisplaying Detailed Information About All USB Devices
853 The following command displays detailed information about all \fBUSB\fR devices
859 example# \fBcfgadm -l -s "select=class(usb),cols=ap_id:info"\fR
861 usb0/1 Mfg:<undefined> Product:<undefined>
862 NConfigs:1 Config:0 <no cfg str descr>
864 usb0/1.1 Mfg:<undefined> Product:<undefined>
865 NConfigs:1 Config:0 <no cfg str descr>
868 usb0/1.4 Mfg:"Wizard" Product:"Modem/ISDN"
869 NConfigs:3 Config:1 : V.90 Analog Modem
870 usb0/1.5 Mfg:"Iomega" Product:"USB Zip 250"
871 NConfigs:1 Config:0 : Default
872 usb0/1.6 Mfg:"SOLID YEAR" Product:"SOLID YEAR
873 USB"NConfigs:1 Config:0 <no cfg str descr>
881 Lines containing only an \fBap_id\fR are empty ports. These can be filtered
882 out. This example only lists \fBUSB\fR \fBap_id\fRs with connected devices, and
883 information about those devices.
888 example# \fBcfgadm -l -s "select=class(usb),cols=ap_id:info" | grep Mfg\fR
889 usb0/1 Mfg:<undefined> Product:<undefined>
890 NConfigs:1 Config:0 <no cfg str descr>
891 usb0/1.1 Mfg:<undefined> Product:<undefined>
892 NConfigs:1 Config:0 <no cfg str descr>
893 usb0/1.4 Mfg:"Wizard" Product:"Modem/ISDN"
894 NConfigs:3 Config:1 : V.90 Analog Modem
895 usb0/1.5 Mfg:"Iomega" Product:"USB Zip 250"
896 NConfigs:1 Config:0 : Default
897 usb0/1.6 Mfg:"SOLID YEAR" Product:"SOLID YEAR USB"
898 Config:0 <no cfg str descr>
904 \fBExample 10 \fRListing Information About a Multi-configuration USB Device
907 The following example lists information about a multi-configuration \fBUSB\fR
912 Notice the \fBNConfigs\fR field: the configurations available for this device
913 are \fB0\fR, \fB1\fR, and \fB2\fR (\fB0\fR to (\fIN\fR\fBConfigs-1\fR)).
918 example# \fBcfgadm -l -s "cols=ap_id:info" usb0/1.4\fR
920 usb0/1.4 Mfg:"Wizard" Product:"Modem/ISDN"
921 NConfigs:3 Config:1 V.90 Analog Modem"
927 \fBExample 11 \fRSetting the Current Configuration of a Multi-configuration USB
931 The following example sets the current configuration of a multi-configuration
937 example# \fBcfgadm -o config=2 -x usb_config usb0/1.4\fR
938 Setting the device: /devices/pci@1f,2000/usb@1/device@3
939 to USB configuration 2
940 This operation suspends activity on the USB device
947 USB configuration changed successfully.
954 The device path should be checked to ensure that the right instance of a device
955 is being referred to, in the case where multiple devices of the exact same type
956 are on the same bus. This information is available in the '\fBInformation\fR'
963 \fB\fB/usr/lib/cfgadm/usb.so.1\fR\fR
967 Hardware specific library for generic USB device administration
973 \fBcfgadm\fR(1M), \fBconfig_admin\fR(3CFGADM), \fBattributes\fR(5),
974 \fBscsa2usb\fR(7D), \fBusba\fR(7D)
977 Universal Serial Bus 1.1 Specification (\fBwww.usb.org\fR)
984 \fBcfgadm\fR(1M) can not unconfigure, disconnect, reset, or change the
985 configuration of any \fBUSB\fR device currently opened by any application.
986 These operations also fail on a hub if a device in its hierarchy is opened by
987 an application. See \fBscsa2usb\fR(7D) for unconfiguring a \fBUSB\fR
988 mass-storage device that is currently in use.
991 Only super-users can execute any functions on an attachment point. However, one
992 need not be a super-user to list the attachment points.