diff options
Diffstat (limited to 'drivers/usb/core/devices.c')
-rw-r--r-- | drivers/usb/core/devices.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index ea398e5d50af..a47c30b2d764 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -104,7 +104,7 @@ static const char *format_config = | |||
104 | 104 | ||
105 | static const char *format_iface = | 105 | static const char *format_iface = |
106 | /* I: If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=xxxx*/ | 106 | /* I: If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=xxxx*/ |
107 | "I: If#=%2d Alt=%2d #EPs=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x Driver=%s\n"; | 107 | "I:%c If#=%2d Alt=%2d #EPs=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x Driver=%s\n"; |
108 | 108 | ||
109 | static const char *format_endpt = | 109 | static const char *format_endpt = |
110 | /* E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */ | 110 | /* E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */ |
@@ -164,10 +164,10 @@ static const char *class_decode(const int class) | |||
164 | for (ix = 0; clas_info[ix].class != -1; ix++) | 164 | for (ix = 0; clas_info[ix].class != -1; ix++) |
165 | if (clas_info[ix].class == class) | 165 | if (clas_info[ix].class == class) |
166 | break; | 166 | break; |
167 | return (clas_info[ix].class_name); | 167 | return clas_info[ix].class_name; |
168 | } | 168 | } |
169 | 169 | ||
170 | static char *usb_dump_endpoint_descriptor ( | 170 | static char *usb_dump_endpoint_descriptor( |
171 | int speed, | 171 | int speed, |
172 | char *start, | 172 | char *start, |
173 | char *end, | 173 | char *end, |
@@ -212,9 +212,9 @@ static char *usb_dump_endpoint_descriptor ( | |||
212 | break; | 212 | break; |
213 | case USB_ENDPOINT_XFER_INT: | 213 | case USB_ENDPOINT_XFER_INT: |
214 | type = "Int."; | 214 | type = "Int."; |
215 | if (speed == USB_SPEED_HIGH) { | 215 | if (speed == USB_SPEED_HIGH) |
216 | interval = 1 << (desc->bInterval - 1); | 216 | interval = 1 << (desc->bInterval - 1); |
217 | } else | 217 | else |
218 | interval = desc->bInterval; | 218 | interval = desc->bInterval; |
219 | break; | 219 | break; |
220 | default: /* "can't happen" */ | 220 | default: /* "can't happen" */ |
@@ -242,15 +242,19 @@ static char *usb_dump_interface_descriptor(char *start, char *end, | |||
242 | { | 242 | { |
243 | const struct usb_interface_descriptor *desc = &intfc->altsetting[setno].desc; | 243 | const struct usb_interface_descriptor *desc = &intfc->altsetting[setno].desc; |
244 | const char *driver_name = ""; | 244 | const char *driver_name = ""; |
245 | int active = 0; | ||
245 | 246 | ||
246 | if (start > end) | 247 | if (start > end) |
247 | return start; | 248 | return start; |
248 | down_read(&usb_bus_type.subsys.rwsem); | 249 | down_read(&usb_bus_type.subsys.rwsem); |
249 | if (iface) | 250 | if (iface) { |
250 | driver_name = (iface->dev.driver | 251 | driver_name = (iface->dev.driver |
251 | ? iface->dev.driver->name | 252 | ? iface->dev.driver->name |
252 | : "(none)"); | 253 | : "(none)"); |
254 | active = (desc == &iface->cur_altsetting->desc); | ||
255 | } | ||
253 | start += sprintf(start, format_iface, | 256 | start += sprintf(start, format_iface, |
257 | active ? '*' : ' ', /* mark active altsetting */ | ||
254 | desc->bInterfaceNumber, | 258 | desc->bInterfaceNumber, |
255 | desc->bAlternateSetting, | 259 | desc->bAlternateSetting, |
256 | desc->bNumEndpoints, | 260 | desc->bNumEndpoints, |
@@ -343,7 +347,7 @@ static char *usb_dump_device_descriptor(char *start, char *end, const struct usb | |||
343 | 347 | ||
344 | if (start > end) | 348 | if (start > end) |
345 | return start; | 349 | return start; |
346 | start += sprintf (start, format_device1, | 350 | start += sprintf(start, format_device1, |
347 | bcdUSB >> 8, bcdUSB & 0xff, | 351 | bcdUSB >> 8, bcdUSB & 0xff, |
348 | desc->bDeviceClass, | 352 | desc->bDeviceClass, |
349 | class_decode (desc->bDeviceClass), | 353 | class_decode (desc->bDeviceClass), |
@@ -363,7 +367,7 @@ static char *usb_dump_device_descriptor(char *start, char *end, const struct usb | |||
363 | /* | 367 | /* |
364 | * Dump the different strings that this device holds. | 368 | * Dump the different strings that this device holds. |
365 | */ | 369 | */ |
366 | static char *usb_dump_device_strings (char *start, char *end, struct usb_device *dev) | 370 | static char *usb_dump_device_strings(char *start, char *end, struct usb_device *dev) |
367 | { | 371 | { |
368 | if (start > end) | 372 | if (start > end) |
369 | return start; | 373 | return start; |
@@ -395,7 +399,7 @@ static char *usb_dump_desc(char *start, char *end, struct usb_device *dev) | |||
395 | if (start > end) | 399 | if (start > end) |
396 | return start; | 400 | return start; |
397 | 401 | ||
398 | start = usb_dump_device_strings (start, end, dev); | 402 | start = usb_dump_device_strings(start, end, dev); |
399 | 403 | ||
400 | for (i = 0; i < dev->descriptor.bNumConfigurations; i++) { | 404 | for (i = 0; i < dev->descriptor.bNumConfigurations; i++) { |
401 | if (start > end) | 405 | if (start > end) |