Both ID's are given in decimal and may be omitted. Show only devices in specified bus and/or devnum.
Class descriptors will be shown, when available, for USB device classes including hub, audio, HID, communications, and chipcard. This includes configuration descriptors for the device's current 70 */ 71 #define USB_DT_CS_DEVICE (LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_DT_DEVICE) 72 #define USB_DT_CS_CONFIG (LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_DT_CONFIG) 73 #define USB_DT_CS_STRING (LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_DT_STRING) 74 #define USB_DT_CS_INTERFACE (LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_DT_INTERFACE) 75 #define USB_DT_CS_ENDPOINT (LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_DT_ENDPOINT) 76 77 #ifndef USB_CLASS_CCID 78 #define USB_CLASS_CCID 0x0b 79 #endif 80 81 #ifndef USB_CLASS_VIDEO 82 #define USB_CLASS_VIDEO 0x0e 83 #endif 84 85 #ifndef USB_CLASS_APPLICATION 86 #define USB_CLASS_APPLICATION 0xfe 87 #endif 88 89 #ifndef USB_AUDIO_CLASS_1 90 #define USB_AUDIO_CLASS_1 0x00 91 #endif 92 93 #ifndef USB_AUDIO_CLASS_2 94 #define USB_AUDIO_CLASS_2 0x20 95 #endif 96 97 /* USB DCD for Audio Devices Release 3.0: Section A.6, pp139 */ 98 #ifndef USB_AUDIO_CLASS_3 99 #define USB_AUDIO_CLASS_3 0x30 100 #endif 101 102 #ifndef USB_VIDEO_PROTOCOL_15 103 #define USB_VIDEO_PROTOCOL_15 0x01 104 #endif 105 106 #define VERBLEVEL_DEFAULT 0 /* 0 gives lspci behaviour 1, lsusb-0.-v, -verbose Tells lsusb to be verbose and display detailed information about the devices shown. Individual class specs 69 * are authoritative for their usage, not the "common class" writeup. The convention is 68 * defined in the USB "Common Class" Spec (3.11).
#LSUSB LINUX CODE#
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option.Īlternatively you can here view or download the uninterpreted source code file.įor more information about "lsusb.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 013_vs_014.ġ // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * lspci like utility for the USB bus 4 * 5 * Copyright (C) 1999-2001, 2003 Thomas Sailer 6 * Copyright (C) 2003-2005 David Brownell 7 */ 8 9 #include "config.h" 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #include 17 #include 18 #include 19 #include 20 21 #ifdef HAVE_BYTESWAP_H 22 #include 23 #endif 24 25 #include 26 #include 27 28 #include "lsusb.h" 29 #include "names.h" 30 #include "sysfs.h" 31 #include "usbmisc.h" 32 #include "desc-defs.h" 33 #include "desc-dump.h" 34 35 #include 36 37 #define le16_to_cpu(x) libusb_cpu_to_le16(libusb_cpu_to_le16(x)) 38 39 /* from USB 2.0 spec and updates */ 40 #define USB_DT_DEVICE_QUALIFIER 0x06 41 #define USB_DT_OTHER_SPEED_CONFIG 0x07 42 #define USB_DT_OTG 0x09 43 #define USB_DT_DEBUG 0x0a 44 #define USB_DT_INTERFACE_ASSOCIATION 0x0b 45 #define USB_DT_SECURITY 0x0c 46 #define USB_DT_KEY 0x0d 47 #define USB_DT_ENCRYPTION_TYPE 0x0e 48 #define USB_DT_BOS 0x0f 49 #define USB_DT_DEVICE_CAPABILITY 0x10 50 #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 51 #define USB_DT_WIRE_ADAPTER 0x21 52 #define USB_DT_RPIPE 0x22 53 #define USB_DT_RC_INTERFACE 0x23 54 #define USB_DT_SS_ENDPOINT_COMP 0x30 55 56 /* Device Capability Type Codes (Wireless USB spec and USB 3.0 bus spec) */ 57 #define USB_DC_WIRELESS_USB 0x01 58 #define USB_DC_20_EXTENSION 0x02 59 #define USB_DC_SUPERSPEED 0x03 60 #define USB_DC_CONTAINER_ID 0x04 61 #define USB_DC_PLATFORM 0x05 62 #define USB_DC_SUPERSPEEDPLUS 0x0a 63 #define USB_DC_BILLBOARD 0x0d 64 #define USB_DC_BILLBOARD_ALT_MODE 0x0f 65 #define USB_DC_CONFIGURATION_SUMMARY 0x10 66 67 /* Conventional codes for class-specific descriptors.