提交 834e2312 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

USB: teach "devices" file about Wireless and SuperSpeed USB

The /sys/kernel/debug/usb/devices file doesn't know about Wireless or
SuperSpeed USB.  This patch (as1416b) teaches it, and updates the
Documentation/usb/proc_sub_info.txt file accordingly.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
CC: David Vrabel <david.vrabel@csr.com>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d3134c3b
/proc/bus/usb filesystem output /proc/bus/usb filesystem output
=============================== ===============================
(version 2003.05.30) (version 2010.09.13)
The usbfs filesystem for USB devices is traditionally mounted at The usbfs filesystem for USB devices is traditionally mounted at
/proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as /proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as
the /proc/bus/usb/BBB/DDD files. the /proc/bus/usb/BBB/DDD files.
In many modern systems the usbfs filsystem isn't used at all. Instead
USB device nodes are created under /dev/usb/ or someplace similar. The
"devices" file is available in debugfs, typically as
/sys/kernel/debug/usb/devices.
**NOTE**: If /proc/bus/usb appears empty, and a host controller **NOTE**: If /proc/bus/usb appears empty, and a host controller
driver has been linked, then you need to mount the driver has been linked, then you need to mount the
...@@ -106,7 +111,7 @@ Legend: ...@@ -106,7 +111,7 @@ Legend:
Topology info: Topology info:
T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd
| | | | | | | | |__MaxChildren | | | | | | | | |__MaxChildren
| | | | | | | |__Device Speed in Mbps | | | | | | | |__Device Speed in Mbps
| | | | | | |__DeviceNumber | | | | | | |__DeviceNumber
...@@ -120,8 +125,13 @@ T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd ...@@ -120,8 +125,13 @@ T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd
Speed may be: Speed may be:
1.5 Mbit/s for low speed USB 1.5 Mbit/s for low speed USB
12 Mbit/s for full speed USB 12 Mbit/s for full speed USB
480 Mbit/s for high speed USB (added for USB 2.0) 480 Mbit/s for high speed USB (added for USB 2.0);
also used for Wireless USB, which has no fixed speed
5000 Mbit/s for SuperSpeed USB (added for USB 3.0)
For reasons lost in the mists of time, the Port number is always
too low by 1. For example, a device plugged into port 4 will
show up with "Port=03".
Bandwidth info: Bandwidth info:
B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd
......
...@@ -66,8 +66,8 @@ ...@@ -66,8 +66,8 @@
#define ALLOW_SERIAL_NUMBER #define ALLOW_SERIAL_NUMBER
static const char *format_topo = static const char *format_topo =
/* T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd */ /* T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd */
"\nT: Bus=%2.2d Lev=%2.2d Prnt=%2.2d Port=%2.2d Cnt=%2.2d Dev#=%3d Spd=%3s MxCh=%2d\n"; "\nT: Bus=%2.2d Lev=%2.2d Prnt=%2.2d Port=%2.2d Cnt=%2.2d Dev#=%3d Spd=%-4s MxCh=%2d\n";
static const char *format_string_manufacturer = static const char *format_string_manufacturer =
/* S: Manufacturer=xxxx */ /* S: Manufacturer=xxxx */
...@@ -520,11 +520,14 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes, ...@@ -520,11 +520,14 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
speed = "1.5"; break; speed = "1.5"; break;
case USB_SPEED_UNKNOWN: /* usb 1.1 root hub code */ case USB_SPEED_UNKNOWN: /* usb 1.1 root hub code */
case USB_SPEED_FULL: case USB_SPEED_FULL:
speed = "12 "; break; speed = "12"; break;
case USB_SPEED_WIRELESS: /* Wireless has no real fixed speed */
case USB_SPEED_HIGH: case USB_SPEED_HIGH:
speed = "480"; break; speed = "480"; break;
case USB_SPEED_SUPER:
speed = "5000"; break;
default: default:
speed = "?? "; speed = "??";
} }
data_end = pages_start + sprintf(pages_start, format_topo, data_end = pages_start + sprintf(pages_start, format_topo,
bus->busnum, level, parent_devnum, bus->busnum, level, parent_devnum,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册