diff options
-rw-r--r-- | Documentation/driver-api/usb/usb.rst | 439 | ||||
-rw-r--r-- | Documentation/usb/proc_usb_info.txt | 390 |
2 files changed, 405 insertions, 424 deletions
diff --git a/Documentation/driver-api/usb/usb.rst b/Documentation/driver-api/usb/usb.rst index a98f78c91ab6..dba0f876b36f 100644 --- a/Documentation/driver-api/usb/usb.rst +++ b/Documentation/driver-api/usb/usb.rst | |||
@@ -212,9 +212,14 @@ This chapter presents the Linux character device nodes. You may prefer | |||
212 | to avoid writing new kernel code for your USB driver. User mode device | 212 | to avoid writing new kernel code for your USB driver. User mode device |
213 | drivers are usually packaged as applications or libraries, and may use | 213 | drivers are usually packaged as applications or libraries, and may use |
214 | character devices through some programming library that wraps it. | 214 | character devices through some programming library that wraps it. |
215 | Such libraries include | 215 | Such libraries include: |
216 | `libusb <http://libusb.sourceforge.net>`__ for C/C++, and | 216 | |
217 | `jUSB <http://jUSB.sourceforge.net>`__ for Java. | 217 | - `libusb <http://libusb.sourceforge.net>`__ for C/C++, and |
218 | - `jUSB <http://jUSB.sourceforge.net>`__ for Java. | ||
219 | |||
220 | Some old information about it can be seen at the "USB Device Filesystem" | ||
221 | section of the USB Guide. The latest copy of the USB Guide can be found | ||
222 | at http://www.linux-usb.org/ | ||
218 | 223 | ||
219 | .. note:: | 224 | .. note:: |
220 | 225 | ||
@@ -230,45 +235,80 @@ What files are in "devtmpfs"? | |||
230 | 235 | ||
231 | Conventionally mounted at ``/dev/bus/usb/``, usbfs features include: | 236 | Conventionally mounted at ``/dev/bus/usb/``, usbfs features include: |
232 | 237 | ||
233 | - ``/dev/bus/usb//BBB/DDD`` ... magic files exposing the each device's | 238 | - ``/dev/bus/usb/BBB/DDD`` ... magic files exposing the each device's |
234 | configuration descriptors, and supporting a series of ioctls for | 239 | configuration descriptors, and supporting a series of ioctls for |
235 | making device requests, including I/O to devices. (Purely for access | 240 | making device requests, including I/O to devices. (Purely for access |
236 | by programs.) | 241 | by programs.) |
237 | 242 | ||
238 | Each bus is given a number (BBB) based on when it was enumerated; within | 243 | Each bus is given a number (``BBB``) based on when it was enumerated; within |
239 | each bus, each device is given a similar number (DDD). Those BBB/DDD | 244 | each bus, each device is given a similar number (``DDD``). Those ``BBB/DDD`` |
240 | paths are not "stable" identifiers; expect them to change even if you | 245 | paths are not "stable" identifiers; expect them to change even if you |
241 | always leave the devices plugged in to the same hub port. *Don't even | 246 | always leave the devices plugged in to the same hub port. *Don't even |
242 | think of saving these in application configuration files.* Stable | 247 | think of saving these in application configuration files.* Stable |
243 | identifiers are available, for user mode applications that want to use | 248 | identifiers are available, for user mode applications that want to use |
244 | them. HID and networking devices expose these stable IDs, so that for | 249 | them. HID and networking devices expose these stable IDs, so that for |
245 | example you can be sure that you told the right UPS to power down its | 250 | example you can be sure that you told the right UPS to power down its |
246 | second server. "usbfs" doesn't (yet) expose those IDs. | 251 | second server. Pleast note that it doesn't (yet) expose those IDs. |
247 | 252 | ||
248 | /dev/bus/usb//BBB/DDD | 253 | /dev/bus/usb/BBB/DDD |
249 | --------------------- | 254 | -------------------- |
250 | 255 | ||
251 | Use these files in one of these basic ways: | 256 | Use these files in one of these basic ways: |
252 | 257 | ||
253 | *They can be read,* producing first the device descriptor (18 bytes) and | 258 | - *They can be read,* producing first the device descriptor (18 bytes) and |
254 | then the descriptors for the current configuration. See the USB 2.0 spec | 259 | then the descriptors for the current configuration. See the USB 2.0 spec |
255 | for details about those binary data formats. You'll need to convert most | 260 | for details about those binary data formats. You'll need to convert most |
256 | multibyte values from little endian format to your native host byte | 261 | multibyte values from little endian format to your native host byte |
257 | order, although a few of the fields in the device descriptor (both of | 262 | order, although a few of the fields in the device descriptor (both of |
258 | the BCD-encoded fields, and the vendor and product IDs) will be | 263 | the BCD-encoded fields, and the vendor and product IDs) will be |
259 | byteswapped for you. Note that configuration descriptors include | 264 | byteswapped for you. Note that configuration descriptors include |
260 | descriptors for interfaces, altsettings, endpoints, and maybe additional | 265 | descriptors for interfaces, altsettings, endpoints, and maybe additional |
261 | class descriptors. | 266 | class descriptors. |
262 | 267 | ||
263 | *Perform USB operations* using *ioctl()* requests to make endpoint I/O | 268 | - *Perform USB operations* using *ioctl()* requests to make endpoint I/O |
264 | requests (synchronously or asynchronously) or manage the device. These | 269 | requests (synchronously or asynchronously) or manage the device. These |
265 | requests need the CAP_SYS_RAWIO capability, as well as filesystem | 270 | requests need the ``CAP_SYS_RAWIO`` capability, as well as filesystem |
266 | access permissions. Only one ioctl request can be made on one of these | 271 | access permissions. Only one ioctl request can be made on one of these |
267 | device files at a time. This means that if you are synchronously reading | 272 | device files at a time. This means that if you are synchronously reading |
268 | an endpoint from one thread, you won't be able to write to a different | 273 | an endpoint from one thread, you won't be able to write to a different |
269 | endpoint from another thread until the read completes. This works for | 274 | endpoint from another thread until the read completes. This works for |
270 | *half duplex* protocols, but otherwise you'd use asynchronous i/o | 275 | *half duplex* protocols, but otherwise you'd use asynchronous i/o |
271 | requests. | 276 | requests. |
277 | |||
278 | Each connected USB device has one file. The ``BBB`` indicates the bus | ||
279 | number. The ``DDD`` indicates the device address on that bus. Both | ||
280 | of these numbers are assigned sequentially, and can be reused, so | ||
281 | you can't rely on them for stable access to devices. For example, | ||
282 | it's relatively common for devices to re-enumerate while they are | ||
283 | still connected (perhaps someone jostled their power supply, hub, | ||
284 | or USB cable), so a device might be ``002/027`` when you first connect | ||
285 | it and ``002/048`` sometime later. | ||
286 | |||
287 | These files can be read as binary data. The binary data consists | ||
288 | of first the device descriptor, then the descriptors for each | ||
289 | configuration of the device. Multi-byte fields in the device descriptor | ||
290 | are converted to host endianness by the kernel. The configuration | ||
291 | descriptors are in bus endian format! The configuration descriptor | ||
292 | are wTotalLength bytes apart. If a device returns less configuration | ||
293 | descriptor data than indicated by wTotalLength there will be a hole in | ||
294 | the file for the missing bytes. This information is also shown | ||
295 | in text form by the ``/sys/kernel/debug/usb/devices`` file, described later. | ||
296 | |||
297 | These files may also be used to write user-level drivers for the USB | ||
298 | devices. You would open the ``/dev/bus/usb/BBB/DDD`` file read/write, | ||
299 | read its descriptors to make sure it's the device you expect, and then | ||
300 | bind to an interface (or perhaps several) using an ioctl call. You | ||
301 | would issue more ioctls to the device to communicate to it using | ||
302 | control, bulk, or other kinds of USB transfers. The IOCTLs are | ||
303 | listed in the ``<linux/usbdevice_fs.h>`` file, and at this writing the | ||
304 | source code (``linux/drivers/usb/core/devio.c``) is the primary reference | ||
305 | for how to access devices through those files. | ||
306 | |||
307 | Note that since by default these ``BBB/DDD`` files are writable only by | ||
308 | root, only root can write such user mode drivers. You can selectively | ||
309 | grant read/write permissions to other users by using ``chmod``. Also, | ||
310 | usbfs mount options such as ``devmode=0666`` may be helpful. | ||
311 | |||
272 | 312 | ||
273 | Life Cycle of User Mode Drivers | 313 | Life Cycle of User Mode Drivers |
274 | ------------------------------- | 314 | ------------------------------- |
@@ -276,7 +316,7 @@ Life Cycle of User Mode Drivers | |||
276 | Such a driver first needs to find a device file for a device it knows | 316 | Such a driver first needs to find a device file for a device it knows |
277 | how to handle. Maybe it was told about it because a ``/sbin/hotplug`` | 317 | how to handle. Maybe it was told about it because a ``/sbin/hotplug`` |
278 | event handling agent chose that driver to handle the new device. Or | 318 | event handling agent chose that driver to handle the new device. Or |
279 | maybe it's an application that scans all the /dev/bus/usb/ device files, | 319 | maybe it's an application that scans all the ``/dev/bus/usb`` device files, |
280 | and ignores most devices. In either case, it should :c:func:`read()` | 320 | and ignores most devices. In either case, it should :c:func:`read()` |
281 | all the descriptors from the device file, and check them against what it | 321 | all the descriptors from the device file, and check them against what it |
282 | knows how to handle. It might just reject everything except a particular | 322 | knows how to handle. It might just reject everything except a particular |
@@ -430,7 +470,7 @@ USBDEVFS_RELEASEINTERFACE | |||
430 | the number of the interface (bInterfaceNumber from descriptor); File | 470 | the number of the interface (bInterfaceNumber from descriptor); File |
431 | modification time is not updated by this request. | 471 | modification time is not updated by this request. |
432 | 472 | ||
433 | .. warning:: | 473 | .. warning:: |
434 | 474 | ||
435 | *No security check is made to ensure that the task which made | 475 | *No security check is made to ensure that the task which made |
436 | the claim is the one which is releasing it. This means that user | 476 | the claim is the one which is releasing it. This means that user |
@@ -442,7 +482,7 @@ USBDEVFS_RESETEP | |||
442 | as identified in the endpoint descriptor), with USB_DIR_IN added | 482 | as identified in the endpoint descriptor), with USB_DIR_IN added |
443 | if the device's endpoint sends data to the host. | 483 | if the device's endpoint sends data to the host. |
444 | 484 | ||
445 | **Warning** | 485 | .. Warning:: |
446 | 486 | ||
447 | *Avoid using this request. It should probably be removed.* Using | 487 | *Avoid using this request. It should probably be removed.* Using |
448 | it typically means the device and driver will lose toggle | 488 | it typically means the device and driver will lose toggle |
@@ -479,10 +519,10 @@ USBDEVFS_BULK | |||
479 | void *data; | 519 | void *data; |
480 | }; | 520 | }; |
481 | 521 | ||
482 | The "ep" value identifies a bulk endpoint number (1 to 15, as | 522 | The ``ep`` value identifies a bulk endpoint number (1 to 15, as |
483 | identified in an endpoint descriptor), masked with USB_DIR_IN when | 523 | identified in an endpoint descriptor), masked with USB_DIR_IN when |
484 | referring to an endpoint which sends data to the host from the | 524 | referring to an endpoint which sends data to the host from the |
485 | device. The length of the data buffer is identified by "len"; Recent | 525 | device. The length of the data buffer is identified by ``len``; Recent |
486 | kernels support requests up to about 128KBytes. *FIXME say how read | 526 | kernels support requests up to about 128KBytes. *FIXME say how read |
487 | length is returned, and how short reads are handled.*. | 527 | length is returned, and how short reads are handled.*. |
488 | 528 | ||
@@ -494,7 +534,7 @@ USBDEVFS_CLEAR_HALT | |||
494 | which sends data to the host from the device. | 534 | which sends data to the host from the device. |
495 | 535 | ||
496 | Use this on bulk or interrupt endpoints which have stalled, | 536 | Use this on bulk or interrupt endpoints which have stalled, |
497 | returning *-EPIPE* status to a data transfer request. Do not issue | 537 | returning ``-EPIPE`` status to a data transfer request. Do not issue |
498 | the control request directly, since that could invalidate the host's | 538 | the control request directly, since that could invalidate the host's |
499 | record of the data toggle. | 539 | record of the data toggle. |
500 | 540 | ||
@@ -674,3 +714,334 @@ Note that this behavior is intended to be used for informational and | |||
674 | debug purposes. It would be more appropriate to use programs such as | 714 | debug purposes. It would be more appropriate to use programs such as |
675 | udev or HAL to initialize a device or start a user-mode helper program, | 715 | udev or HAL to initialize a device or start a user-mode helper program, |
676 | for instance. | 716 | for instance. |
717 | |||
718 | In this file, each device's output has multiple lines of ASCII output. | ||
719 | |||
720 | I made it ASCII instead of binary on purpose, so that someone | ||
721 | can obtain some useful data from it without the use of an | ||
722 | auxiliary program. However, with an auxiliary program, the numbers | ||
723 | in the first 4 columns of each ``T:`` line (topology info: | ||
724 | Lev, Prnt, Port, Cnt) can be used to build a USB topology diagram. | ||
725 | |||
726 | Each line is tagged with a one-character ID for that line:: | ||
727 | |||
728 | T = Topology (etc.) | ||
729 | B = Bandwidth (applies only to USB host controllers, which are | ||
730 | virtualized as root hubs) | ||
731 | D = Device descriptor info. | ||
732 | P = Product ID info. (from Device descriptor, but they won't fit | ||
733 | together on one line) | ||
734 | S = String descriptors. | ||
735 | C = Configuration descriptor info. (* = active configuration) | ||
736 | I = Interface descriptor info. | ||
737 | E = Endpoint descriptor info. | ||
738 | |||
739 | /sys/kernel/debug/usb/devices output format | ||
740 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
741 | |||
742 | Legend:: | ||
743 | d = decimal number (may have leading spaces or 0's) | ||
744 | x = hexadecimal number (may have leading spaces or 0's) | ||
745 | s = string | ||
746 | |||
747 | |||
748 | |||
749 | Topology info | ||
750 | ^^^^^^^^^^^^^ | ||
751 | |||
752 | :: | ||
753 | |||
754 | T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd | ||
755 | | | | | | | | | |__MaxChildren | ||
756 | | | | | | | | |__Device Speed in Mbps | ||
757 | | | | | | | |__DeviceNumber | ||
758 | | | | | | |__Count of devices at this level | ||
759 | | | | | |__Connector/Port on Parent for this device | ||
760 | | | | |__Parent DeviceNumber | ||
761 | | | |__Level in topology for this bus | ||
762 | | |__Bus number | ||
763 | |__Topology info tag | ||
764 | |||
765 | Speed may be: | ||
766 | |||
767 | ======= ====================================================== | ||
768 | 1.5 Mbit/s for low speed USB | ||
769 | 12 Mbit/s for full speed USB | ||
770 | 480 Mbit/s for high speed USB (added for USB 2.0); | ||
771 | also used for Wireless USB, which has no fixed speed | ||
772 | 5000 Mbit/s for SuperSpeed USB (added for USB 3.0) | ||
773 | ======= ====================================================== | ||
774 | |||
775 | For reasons lost in the mists of time, the Port number is always | ||
776 | too low by 1. For example, a device plugged into port 4 will | ||
777 | show up with ``Port=03``. | ||
778 | |||
779 | Bandwidth info | ||
780 | ^^^^^^^^^^^^^^ | ||
781 | |||
782 | :: | ||
783 | |||
784 | B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd | ||
785 | | | | |__Number of isochronous requests | ||
786 | | | |__Number of interrupt requests | ||
787 | | |__Total Bandwidth allocated to this bus | ||
788 | |__Bandwidth info tag | ||
789 | |||
790 | Bandwidth allocation is an approximation of how much of one frame | ||
791 | (millisecond) is in use. It reflects only periodic transfers, which | ||
792 | are the only transfers that reserve bandwidth. Control and bulk | ||
793 | transfers use all other bandwidth, including reserved bandwidth that | ||
794 | is not used for transfers (such as for short packets). | ||
795 | |||
796 | The percentage is how much of the "reserved" bandwidth is scheduled by | ||
797 | those transfers. For a low or full speed bus (loosely, "USB 1.1"), | ||
798 | 90% of the bus bandwidth is reserved. For a high speed bus (loosely, | ||
799 | "USB 2.0") 80% is reserved. | ||
800 | |||
801 | |||
802 | Device descriptor info & Product ID info | ||
803 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
804 | |||
805 | :: | ||
806 | |||
807 | D: Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd | ||
808 | P: Vendor=xxxx ProdID=xxxx Rev=xx.xx | ||
809 | |||
810 | where:: | ||
811 | |||
812 | D: Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd | ||
813 | | | | | | | |__NumberConfigurations | ||
814 | | | | | | |__MaxPacketSize of Default Endpoint | ||
815 | | | | | |__DeviceProtocol | ||
816 | | | | |__DeviceSubClass | ||
817 | | | |__DeviceClass | ||
818 | | |__Device USB version | ||
819 | |__Device info tag #1 | ||
820 | |||
821 | where:: | ||
822 | |||
823 | P: Vendor=xxxx ProdID=xxxx Rev=xx.xx | ||
824 | | | | |__Product revision number | ||
825 | | | |__Product ID code | ||
826 | | |__Vendor ID code | ||
827 | |__Device info tag #2 | ||
828 | |||
829 | |||
830 | String descriptor info | ||
831 | ^^^^^^^^^^^^^^^^^^^^^^ | ||
832 | :: | ||
833 | |||
834 | S: Manufacturer=ssss | ||
835 | | |__Manufacturer of this device as read from the device. | ||
836 | | For USB host controller drivers (virtual root hubs) this may | ||
837 | | be omitted, or (for newer drivers) will identify the kernel | ||
838 | | version and the driver which provides this hub emulation. | ||
839 | |__String info tag | ||
840 | |||
841 | S: Product=ssss | ||
842 | | |__Product description of this device as read from the device. | ||
843 | | For older USB host controller drivers (virtual root hubs) this | ||
844 | | indicates the driver; for newer ones, it's a product (and vendor) | ||
845 | | description that often comes from the kernel's PCI ID database. | ||
846 | |__String info tag | ||
847 | |||
848 | S: SerialNumber=ssss | ||
849 | | |__Serial Number of this device as read from the device. | ||
850 | | For USB host controller drivers (virtual root hubs) this is | ||
851 | | some unique ID, normally a bus ID (address or slot name) that | ||
852 | | can't be shared with any other device. | ||
853 | |__String info tag | ||
854 | |||
855 | |||
856 | |||
857 | Configuration descriptor info | ||
858 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
859 | :: | ||
860 | |||
861 | C:* #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA | ||
862 | | | | | | |__MaxPower in mA | ||
863 | | | | | |__Attributes | ||
864 | | | | |__ConfiguratioNumber | ||
865 | | | |__NumberOfInterfaces | ||
866 | | |__ "*" indicates the active configuration (others are " ") | ||
867 | |__Config info tag | ||
868 | |||
869 | USB devices may have multiple configurations, each of which act | ||
870 | rather differently. For example, a bus-powered configuration | ||
871 | might be much less capable than one that is self-powered. Only | ||
872 | one device configuration can be active at a time; most devices | ||
873 | have only one configuration. | ||
874 | |||
875 | Each configuration consists of one or more interfaces. Each | ||
876 | interface serves a distinct "function", which is typically bound | ||
877 | to a different USB device driver. One common example is a USB | ||
878 | speaker with an audio interface for playback, and a HID interface | ||
879 | for use with software volume control. | ||
880 | |||
881 | Interface descriptor info (can be multiple per Config) | ||
882 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
883 | :: | ||
884 | |||
885 | I:* If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss | ||
886 | | | | | | | | | |__Driver name | ||
887 | | | | | | | | | or "(none)" | ||
888 | | | | | | | | |__InterfaceProtocol | ||
889 | | | | | | | |__InterfaceSubClass | ||
890 | | | | | | |__InterfaceClass | ||
891 | | | | | |__NumberOfEndpoints | ||
892 | | | | |__AlternateSettingNumber | ||
893 | | | |__InterfaceNumber | ||
894 | | |__ "*" indicates the active altsetting (others are " ") | ||
895 | |__Interface info tag | ||
896 | |||
897 | A given interface may have one or more "alternate" settings. | ||
898 | For example, default settings may not use more than a small | ||
899 | amount of periodic bandwidth. To use significant fractions | ||
900 | of bus bandwidth, drivers must select a non-default altsetting. | ||
901 | |||
902 | Only one setting for an interface may be active at a time, and | ||
903 | only one driver may bind to an interface at a time. Most devices | ||
904 | have only one alternate setting per interface. | ||
905 | |||
906 | |||
907 | Endpoint descriptor info (can be multiple per Interface) | ||
908 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
909 | |||
910 | :: | ||
911 | |||
912 | E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddss | ||
913 | | | | | |__Interval (max) between transfers | ||
914 | | | | |__EndpointMaxPacketSize | ||
915 | | | |__Attributes(EndpointType) | ||
916 | | |__EndpointAddress(I=In,O=Out) | ||
917 | |__Endpoint info tag | ||
918 | |||
919 | The interval is nonzero for all periodic (interrupt or isochronous) | ||
920 | endpoints. For high speed endpoints the transfer interval may be | ||
921 | measured in microseconds rather than milliseconds. | ||
922 | |||
923 | For high speed periodic endpoints, the ``EndpointMaxPacketSize`` reflects | ||
924 | the per-microframe data transfer size. For "high bandwidth" | ||
925 | endpoints, that can reflect two or three packets (for up to | ||
926 | 3KBytes every 125 usec) per endpoint. | ||
927 | |||
928 | With the Linux-USB stack, periodic bandwidth reservations use the | ||
929 | transfer intervals and sizes provided by URBs, which can be less | ||
930 | than those found in endpoint descriptor. | ||
931 | |||
932 | Usage examples | ||
933 | ~~~~~~~~~~~~~~ | ||
934 | |||
935 | If a user or script is interested only in Topology info, for | ||
936 | example, use something like ``grep ^T: /sys/kernel/debug/usb/devices`` | ||
937 | for only the Topology lines. A command like | ||
938 | ``grep -i ^[tdp]: /sys/kernel/debug/usb/devices`` can be used to list | ||
939 | only the lines that begin with the characters in square brackets, | ||
940 | where the valid characters are TDPCIE. With a slightly more able | ||
941 | script, it can display any selected lines (for example, only T, D, | ||
942 | and P lines) and change their output format. (The ``procusb`` | ||
943 | Perl script is the beginning of this idea. It will list only | ||
944 | selected lines [selected from TBDPSCIE] or "All" lines from | ||
945 | ``/sys/kernel/debug/usb/devices``.) | ||
946 | |||
947 | The Topology lines can be used to generate a graphic/pictorial | ||
948 | of the USB devices on a system's root hub. (See more below | ||
949 | on how to do this.) | ||
950 | |||
951 | The Interface lines can be used to determine what driver is | ||
952 | being used for each device, and which altsetting it activated. | ||
953 | |||
954 | The Configuration lines could be used to list maximum power | ||
955 | (in milliamps) that a system's USB devices are using. | ||
956 | For example, ``grep ^C: /sys/kernel/debug/usb/devices``. | ||
957 | |||
958 | |||
959 | Here's an example, from a system which has a UHCI root hub, | ||
960 | an external hub connected to the root hub, and a mouse and | ||
961 | a serial converter connected to the external hub. | ||
962 | |||
963 | :: | ||
964 | |||
965 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
966 | B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0 | ||
967 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
968 | P: Vendor=0000 ProdID=0000 Rev= 0.00 | ||
969 | S: Product=USB UHCI Root Hub | ||
970 | S: SerialNumber=dce0 | ||
971 | C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA | ||
972 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
973 | E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms | ||
974 | |||
975 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | ||
976 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
977 | P: Vendor=0451 ProdID=1446 Rev= 1.00 | ||
978 | C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA | ||
979 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
980 | E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms | ||
981 | |||
982 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | ||
983 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
984 | P: Vendor=04b4 ProdID=0001 Rev= 0.00 | ||
985 | C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA | ||
986 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | ||
987 | E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms | ||
988 | |||
989 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | ||
990 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
991 | P: Vendor=0565 ProdID=0001 Rev= 1.08 | ||
992 | S: Manufacturer=Peracom Networks, Inc. | ||
993 | S: Product=Peracom USB to Serial Converter | ||
994 | C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA | ||
995 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | ||
996 | E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl= 16ms | ||
997 | E: Ad=01(O) Atr=02(Bulk) MxPS= 16 Ivl= 16ms | ||
998 | E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl= 8ms | ||
999 | |||
1000 | |||
1001 | Selecting only the ``T:`` and ``I:`` lines from this (for example, by using | ||
1002 | ``procusb ti``), we have | ||
1003 | |||
1004 | :: | ||
1005 | |||
1006 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
1007 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | ||
1008 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
1009 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | ||
1010 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | ||
1011 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | ||
1012 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | ||
1013 | |||
1014 | |||
1015 | Physically this looks like (or could be converted to):: | ||
1016 | |||
1017 | +------------------+ | ||
1018 | | PC/root_hub (12)| Dev# = 1 | ||
1019 | +------------------+ (nn) is Mbps. | ||
1020 | Level 0 | CN.0 | CN.1 | [CN = connector/port #] | ||
1021 | +------------------+ | ||
1022 | / | ||
1023 | / | ||
1024 | +-----------------------+ | ||
1025 | Level 1 | Dev#2: 4-port hub (12)| | ||
1026 | +-----------------------+ | ||
1027 | |CN.0 |CN.1 |CN.2 |CN.3 | | ||
1028 | +-----------------------+ | ||
1029 | \ \____________________ | ||
1030 | \_____ \ | ||
1031 | \ \ | ||
1032 | +--------------------+ +--------------------+ | ||
1033 | Level 2 | Dev# 3: mouse (1.5)| | Dev# 4: serial (12)| | ||
1034 | +--------------------+ +--------------------+ | ||
1035 | |||
1036 | |||
1037 | |||
1038 | Or, in a more tree-like structure (ports [Connectors] without | ||
1039 | connections could be omitted):: | ||
1040 | |||
1041 | PC: Dev# 1, root hub, 2 ports, 12 Mbps | ||
1042 | |_ CN.0: Dev# 2, hub, 4 ports, 12 Mbps | ||
1043 | |_ CN.0: Dev #3, mouse, 1.5 Mbps | ||
1044 | |_ CN.1: | ||
1045 | |_ CN.2: Dev #4, serial, 12 Mbps | ||
1046 | |_ CN.3: | ||
1047 | |_ CN.1: | ||
diff --git a/Documentation/usb/proc_usb_info.txt b/Documentation/usb/proc_usb_info.txt deleted file mode 100644 index 06d7960e9ae6..000000000000 --- a/Documentation/usb/proc_usb_info.txt +++ /dev/null | |||
@@ -1,390 +0,0 @@ | |||
1 | /proc/bus/usb filesystem output | ||
2 | =============================== | ||
3 | (version 2010.09.13) | ||
4 | |||
5 | |||
6 | The usbfs filesystem for USB devices is traditionally mounted at | ||
7 | /proc/bus/usb. It provides the /sys/kernel/debug/usb/devices file, as well as | ||
8 | the /proc/bus/usb/BBB/DDD files. | ||
9 | |||
10 | In many modern systems the usbfs filesystem isn't used at all. Instead | ||
11 | USB device nodes are created under /dev/usb/ or someplace similar. The | ||
12 | "devices" file is available in debugfs, typically as | ||
13 | /sys/kernel/debug/usb/devices. | ||
14 | |||
15 | |||
16 | **NOTE**: If /proc/bus/usb appears empty, and a host controller | ||
17 | driver has been linked, then you need to mount the | ||
18 | filesystem. Issue the command (as root): | ||
19 | |||
20 | mount -t usbfs none /proc/bus/usb | ||
21 | |||
22 | An alternative and more permanent method would be to add | ||
23 | |||
24 | none /proc/bus/usb usbfs defaults 0 0 | ||
25 | |||
26 | to /etc/fstab. This will mount usbfs at each reboot. | ||
27 | You can then issue `cat /sys/kernel/debug/usb/devices` to extract | ||
28 | USB device information, and user mode drivers can use usbfs | ||
29 | to interact with USB devices. | ||
30 | |||
31 | There are a number of mount options supported by usbfs. | ||
32 | Consult the source code (linux/drivers/usb/core/inode.c) for | ||
33 | information about those options. | ||
34 | |||
35 | **NOTE**: The filesystem has been renamed from "usbdevfs" to | ||
36 | "usbfs", to reduce confusion with "devfs". You may | ||
37 | still see references to the older "usbdevfs" name. | ||
38 | |||
39 | For more information on mounting the usbfs file system, see the | ||
40 | "USB Device Filesystem" section of the USB Guide. The latest copy | ||
41 | of the USB Guide can be found at http://www.linux-usb.org/ | ||
42 | |||
43 | |||
44 | THE /proc/bus/usb/BBB/DDD FILES: | ||
45 | -------------------------------- | ||
46 | Each connected USB device has one file. The BBB indicates the bus | ||
47 | number. The DDD indicates the device address on that bus. Both | ||
48 | of these numbers are assigned sequentially, and can be reused, so | ||
49 | you can't rely on them for stable access to devices. For example, | ||
50 | it's relatively common for devices to re-enumerate while they are | ||
51 | still connected (perhaps someone jostled their power supply, hub, | ||
52 | or USB cable), so a device might be 002/027 when you first connect | ||
53 | it and 002/048 sometime later. | ||
54 | |||
55 | These files can be read as binary data. The binary data consists | ||
56 | of first the device descriptor, then the descriptors for each | ||
57 | configuration of the device. Multi-byte fields in the device descriptor | ||
58 | are converted to host endianness by the kernel. The configuration | ||
59 | descriptors are in bus endian format! The configuration descriptor | ||
60 | are wTotalLength bytes apart. If a device returns less configuration | ||
61 | descriptor data than indicated by wTotalLength there will be a hole in | ||
62 | the file for the missing bytes. This information is also shown | ||
63 | in text form by the /sys/kernel/debug/usb/devices file, described later. | ||
64 | |||
65 | These files may also be used to write user-level drivers for the USB | ||
66 | devices. You would open the /proc/bus/usb/BBB/DDD file read/write, | ||
67 | read its descriptors to make sure it's the device you expect, and then | ||
68 | bind to an interface (or perhaps several) using an ioctl call. You | ||
69 | would issue more ioctls to the device to communicate to it using | ||
70 | control, bulk, or other kinds of USB transfers. The IOCTLs are | ||
71 | listed in the <linux/usbdevice_fs.h> file, and at this writing the | ||
72 | source code (linux/drivers/usb/core/devio.c) is the primary reference | ||
73 | for how to access devices through those files. | ||
74 | |||
75 | Note that since by default these BBB/DDD files are writable only by | ||
76 | root, only root can write such user mode drivers. You can selectively | ||
77 | grant read/write permissions to other users by using "chmod". Also, | ||
78 | usbfs mount options such as "devmode=0666" may be helpful. | ||
79 | |||
80 | |||
81 | |||
82 | THE /sys/kernel/debug/usb/devices FILE: | ||
83 | ------------------------------- | ||
84 | In /sys/kernel/debug/usb/devices, each device's output has multiple | ||
85 | lines of ASCII output. | ||
86 | I made it ASCII instead of binary on purpose, so that someone | ||
87 | can obtain some useful data from it without the use of an | ||
88 | auxiliary program. However, with an auxiliary program, the numbers | ||
89 | in the first 4 columns of each "T:" line (topology info: | ||
90 | Lev, Prnt, Port, Cnt) can be used to build a USB topology diagram. | ||
91 | |||
92 | Each line is tagged with a one-character ID for that line: | ||
93 | |||
94 | T = Topology (etc.) | ||
95 | B = Bandwidth (applies only to USB host controllers, which are | ||
96 | virtualized as root hubs) | ||
97 | D = Device descriptor info. | ||
98 | P = Product ID info. (from Device descriptor, but they won't fit | ||
99 | together on one line) | ||
100 | S = String descriptors. | ||
101 | C = Configuration descriptor info. (* = active configuration) | ||
102 | I = Interface descriptor info. | ||
103 | E = Endpoint descriptor info. | ||
104 | |||
105 | ======================================================================= | ||
106 | |||
107 | /sys/kernel/debug/usb/devices output format: | ||
108 | |||
109 | Legend: | ||
110 | d = decimal number (may have leading spaces or 0's) | ||
111 | x = hexadecimal number (may have leading spaces or 0's) | ||
112 | s = string | ||
113 | |||
114 | |||
115 | Topology info: | ||
116 | |||
117 | T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd | ||
118 | | | | | | | | | |__MaxChildren | ||
119 | | | | | | | | |__Device Speed in Mbps | ||
120 | | | | | | | |__DeviceNumber | ||
121 | | | | | | |__Count of devices at this level | ||
122 | | | | | |__Connector/Port on Parent for this device | ||
123 | | | | |__Parent DeviceNumber | ||
124 | | | |__Level in topology for this bus | ||
125 | | |__Bus number | ||
126 | |__Topology info tag | ||
127 | |||
128 | Speed may be: | ||
129 | 1.5 Mbit/s for low speed USB | ||
130 | 12 Mbit/s for full speed USB | ||
131 | 480 Mbit/s for high speed USB (added for USB 2.0); | ||
132 | also used for Wireless USB, which has no fixed speed | ||
133 | 5000 Mbit/s for SuperSpeed USB (added for USB 3.0) | ||
134 | |||
135 | For reasons lost in the mists of time, the Port number is always | ||
136 | too low by 1. For example, a device plugged into port 4 will | ||
137 | show up with "Port=03". | ||
138 | |||
139 | Bandwidth info: | ||
140 | B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd | ||
141 | | | | |__Number of isochronous requests | ||
142 | | | |__Number of interrupt requests | ||
143 | | |__Total Bandwidth allocated to this bus | ||
144 | |__Bandwidth info tag | ||
145 | |||
146 | Bandwidth allocation is an approximation of how much of one frame | ||
147 | (millisecond) is in use. It reflects only periodic transfers, which | ||
148 | are the only transfers that reserve bandwidth. Control and bulk | ||
149 | transfers use all other bandwidth, including reserved bandwidth that | ||
150 | is not used for transfers (such as for short packets). | ||
151 | |||
152 | The percentage is how much of the "reserved" bandwidth is scheduled by | ||
153 | those transfers. For a low or full speed bus (loosely, "USB 1.1"), | ||
154 | 90% of the bus bandwidth is reserved. For a high speed bus (loosely, | ||
155 | "USB 2.0") 80% is reserved. | ||
156 | |||
157 | |||
158 | Device descriptor info & Product ID info: | ||
159 | |||
160 | D: Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd | ||
161 | P: Vendor=xxxx ProdID=xxxx Rev=xx.xx | ||
162 | |||
163 | where | ||
164 | D: Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd | ||
165 | | | | | | | |__NumberConfigurations | ||
166 | | | | | | |__MaxPacketSize of Default Endpoint | ||
167 | | | | | |__DeviceProtocol | ||
168 | | | | |__DeviceSubClass | ||
169 | | | |__DeviceClass | ||
170 | | |__Device USB version | ||
171 | |__Device info tag #1 | ||
172 | |||
173 | where | ||
174 | P: Vendor=xxxx ProdID=xxxx Rev=xx.xx | ||
175 | | | | |__Product revision number | ||
176 | | | |__Product ID code | ||
177 | | |__Vendor ID code | ||
178 | |__Device info tag #2 | ||
179 | |||
180 | |||
181 | String descriptor info: | ||
182 | |||
183 | S: Manufacturer=ssss | ||
184 | | |__Manufacturer of this device as read from the device. | ||
185 | | For USB host controller drivers (virtual root hubs) this may | ||
186 | | be omitted, or (for newer drivers) will identify the kernel | ||
187 | | version and the driver which provides this hub emulation. | ||
188 | |__String info tag | ||
189 | |||
190 | S: Product=ssss | ||
191 | | |__Product description of this device as read from the device. | ||
192 | | For older USB host controller drivers (virtual root hubs) this | ||
193 | | indicates the driver; for newer ones, it's a product (and vendor) | ||
194 | | description that often comes from the kernel's PCI ID database. | ||
195 | |__String info tag | ||
196 | |||
197 | S: SerialNumber=ssss | ||
198 | | |__Serial Number of this device as read from the device. | ||
199 | | For USB host controller drivers (virtual root hubs) this is | ||
200 | | some unique ID, normally a bus ID (address or slot name) that | ||
201 | | can't be shared with any other device. | ||
202 | |__String info tag | ||
203 | |||
204 | |||
205 | |||
206 | Configuration descriptor info: | ||
207 | |||
208 | C:* #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA | ||
209 | | | | | | |__MaxPower in mA | ||
210 | | | | | |__Attributes | ||
211 | | | | |__ConfiguratioNumber | ||
212 | | | |__NumberOfInterfaces | ||
213 | | |__ "*" indicates the active configuration (others are " ") | ||
214 | |__Config info tag | ||
215 | |||
216 | USB devices may have multiple configurations, each of which act | ||
217 | rather differently. For example, a bus-powered configuration | ||
218 | might be much less capable than one that is self-powered. Only | ||
219 | one device configuration can be active at a time; most devices | ||
220 | have only one configuration. | ||
221 | |||
222 | Each configuration consists of one or more interfaces. Each | ||
223 | interface serves a distinct "function", which is typically bound | ||
224 | to a different USB device driver. One common example is a USB | ||
225 | speaker with an audio interface for playback, and a HID interface | ||
226 | for use with software volume control. | ||
227 | |||
228 | |||
229 | Interface descriptor info (can be multiple per Config): | ||
230 | |||
231 | I:* If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss | ||
232 | | | | | | | | | |__Driver name | ||
233 | | | | | | | | | or "(none)" | ||
234 | | | | | | | | |__InterfaceProtocol | ||
235 | | | | | | | |__InterfaceSubClass | ||
236 | | | | | | |__InterfaceClass | ||
237 | | | | | |__NumberOfEndpoints | ||
238 | | | | |__AlternateSettingNumber | ||
239 | | | |__InterfaceNumber | ||
240 | | |__ "*" indicates the active altsetting (others are " ") | ||
241 | |__Interface info tag | ||
242 | |||
243 | A given interface may have one or more "alternate" settings. | ||
244 | For example, default settings may not use more than a small | ||
245 | amount of periodic bandwidth. To use significant fractions | ||
246 | of bus bandwidth, drivers must select a non-default altsetting. | ||
247 | |||
248 | Only one setting for an interface may be active at a time, and | ||
249 | only one driver may bind to an interface at a time. Most devices | ||
250 | have only one alternate setting per interface. | ||
251 | |||
252 | |||
253 | Endpoint descriptor info (can be multiple per Interface): | ||
254 | |||
255 | E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddss | ||
256 | | | | | |__Interval (max) between transfers | ||
257 | | | | |__EndpointMaxPacketSize | ||
258 | | | |__Attributes(EndpointType) | ||
259 | | |__EndpointAddress(I=In,O=Out) | ||
260 | |__Endpoint info tag | ||
261 | |||
262 | The interval is nonzero for all periodic (interrupt or isochronous) | ||
263 | endpoints. For high speed endpoints the transfer interval may be | ||
264 | measured in microseconds rather than milliseconds. | ||
265 | |||
266 | For high speed periodic endpoints, the "MaxPacketSize" reflects | ||
267 | the per-microframe data transfer size. For "high bandwidth" | ||
268 | endpoints, that can reflect two or three packets (for up to | ||
269 | 3KBytes every 125 usec) per endpoint. | ||
270 | |||
271 | With the Linux-USB stack, periodic bandwidth reservations use the | ||
272 | transfer intervals and sizes provided by URBs, which can be less | ||
273 | than those found in endpoint descriptor. | ||
274 | |||
275 | |||
276 | ======================================================================= | ||
277 | |||
278 | |||
279 | If a user or script is interested only in Topology info, for | ||
280 | example, use something like "grep ^T: /sys/kernel/debug/usb/devices" | ||
281 | for only the Topology lines. A command like | ||
282 | "grep -i ^[tdp]: /sys/kernel/debug/usb/devices" can be used to list | ||
283 | only the lines that begin with the characters in square brackets, | ||
284 | where the valid characters are TDPCIE. With a slightly more able | ||
285 | script, it can display any selected lines (for example, only T, D, | ||
286 | and P lines) and change their output format. (The "procusb" | ||
287 | Perl script is the beginning of this idea. It will list only | ||
288 | selected lines [selected from TBDPSCIE] or "All" lines from | ||
289 | /sys/kernel/debug/usb/devices.) | ||
290 | |||
291 | The Topology lines can be used to generate a graphic/pictorial | ||
292 | of the USB devices on a system's root hub. (See more below | ||
293 | on how to do this.) | ||
294 | |||
295 | The Interface lines can be used to determine what driver is | ||
296 | being used for each device, and which altsetting it activated. | ||
297 | |||
298 | The Configuration lines could be used to list maximum power | ||
299 | (in milliamps) that a system's USB devices are using. | ||
300 | For example, "grep ^C: /sys/kernel/debug/usb/devices". | ||
301 | |||
302 | |||
303 | Here's an example, from a system which has a UHCI root hub, | ||
304 | an external hub connected to the root hub, and a mouse and | ||
305 | a serial converter connected to the external hub. | ||
306 | |||
307 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
308 | B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0 | ||
309 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
310 | P: Vendor=0000 ProdID=0000 Rev= 0.00 | ||
311 | S: Product=USB UHCI Root Hub | ||
312 | S: SerialNumber=dce0 | ||
313 | C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA | ||
314 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
315 | E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms | ||
316 | |||
317 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | ||
318 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
319 | P: Vendor=0451 ProdID=1446 Rev= 1.00 | ||
320 | C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA | ||
321 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
322 | E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms | ||
323 | |||
324 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | ||
325 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
326 | P: Vendor=04b4 ProdID=0001 Rev= 0.00 | ||
327 | C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA | ||
328 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | ||
329 | E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms | ||
330 | |||
331 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | ||
332 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
333 | P: Vendor=0565 ProdID=0001 Rev= 1.08 | ||
334 | S: Manufacturer=Peracom Networks, Inc. | ||
335 | S: Product=Peracom USB to Serial Converter | ||
336 | C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA | ||
337 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | ||
338 | E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl= 16ms | ||
339 | E: Ad=01(O) Atr=02(Bulk) MxPS= 16 Ivl= 16ms | ||
340 | E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl= 8ms | ||
341 | |||
342 | |||
343 | Selecting only the "T:" and "I:" lines from this (for example, by using | ||
344 | "procusb ti"), we have: | ||
345 | |||
346 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
347 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | ||
348 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
349 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | ||
350 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | ||
351 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | ||
352 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | ||
353 | |||
354 | |||
355 | Physically this looks like (or could be converted to): | ||
356 | |||
357 | +------------------+ | ||
358 | | PC/root_hub (12)| Dev# = 1 | ||
359 | +------------------+ (nn) is Mbps. | ||
360 | Level 0 | CN.0 | CN.1 | [CN = connector/port #] | ||
361 | +------------------+ | ||
362 | / | ||
363 | / | ||
364 | +-----------------------+ | ||
365 | Level 1 | Dev#2: 4-port hub (12)| | ||
366 | +-----------------------+ | ||
367 | |CN.0 |CN.1 |CN.2 |CN.3 | | ||
368 | +-----------------------+ | ||
369 | \ \____________________ | ||
370 | \_____ \ | ||
371 | \ \ | ||
372 | +--------------------+ +--------------------+ | ||
373 | Level 2 | Dev# 3: mouse (1.5)| | Dev# 4: serial (12)| | ||
374 | +--------------------+ +--------------------+ | ||
375 | |||
376 | |||
377 | |||
378 | Or, in a more tree-like structure (ports [Connectors] without | ||
379 | connections could be omitted): | ||
380 | |||
381 | PC: Dev# 1, root hub, 2 ports, 12 Mbps | ||
382 | |_ CN.0: Dev# 2, hub, 4 ports, 12 Mbps | ||
383 | |_ CN.0: Dev #3, mouse, 1.5 Mbps | ||
384 | |_ CN.1: | ||
385 | |_ CN.2: Dev #4, serial, 12 Mbps | ||
386 | |_ CN.3: | ||
387 | |_ CN.1: | ||
388 | |||
389 | |||
390 | ### END ### | ||