Commit Graph

15 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
0cc65720ad lsusb: add fallback names for 'lsusb -v' output
Previously the -v output would not show the vendor/product names if they
were not in the hwdb.  Change that to look in sysfs as well if the
database does not have a string, as that's what the non-v version does.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-30 12:26:33 +01:00
Greg Kroah-Hartman
23b232bf36 rename "GPL-2.0+" to "GPL-2.0-or-later"
This makes `reuse lint` happy as well as license lawyers...

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-22 14:25:02 +01:00
Thomas Hebb
c37f33cf31 Move read_sysfs_prop() from names.c to its own file
This function was added to names.c by commit dddb696e01 ("lsusb: Read
unkown names from sysfs device desc."), but it doesn't really belong
there: sysfs is an entirely different data source from the udev hwdb
that names.c works with, and this function both does things (like
directly accessing files) that other functions in names.c don't and
doesn't do things (like depending on the work done by names_init()) that
those other functions do.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2020-08-08 01:30:00 -07:00
Greg Kroah-Hartman
3c2dba4053 fix up standard int types
Use the C standard uint*_t variable types, not the "unix" types of
u_int*_t as we should be able to all finally agree on one type of C
variables.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-28 09:50:15 +01:00
Daniel Schaefer
dddb696e01 lsusb: Read unkown names from sysfs device desc.
lsusb tries to get the names for manufacturer and product of a device by
asking the udev hwdb for the names of the device id.
Not every manufacturer and device are in this database. Most devices
however provide those names in the standard USB descriptors, namely
iManufacturer and iProduct.
To get those with libusb we would have to open the device which
requires superuser privileges. To get those values anyway the kernel
provides them in sysfs.

Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
2018-12-22 01:08:35 +01:00
Greg Kroah-Hartman
f6f293c82d Add correct SPDX license identifiers to all files
This removes the "boiler-plate" license texts in the individual files to
use SPDX identifiers instead.  Cleans up the text a lot.

All copyright notices were left intact, as this does not change
anything.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-08 15:46:10 +01:00
Tom Gundersen
5d7ea40bc9 drop dependency on usb.ids
Also remove usb.ids from the repository. [Note that these were probably
never used by distributions regarless, as most distros ship the usb.ids
directly from upstream.]

Hardcode the usb-spec information that used to be in usb.ids,
but which was not moved to hwdb.

Increase the size of tha hash table from 16 to 512, though using a
hash at all is probably overkill at this point.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-12 15:59:31 -07:00
Greg Kroah-Hartman
bfb14c8340 Make 'lsusb -t' use the correct device class string names
This fixes the annoying "bInterfaceClass 0x0e not yet handled" messages
in 'lsusb -t' for video devices, and will handle any future class types
as well.

Just one step in merging 'lsusb -t' into the main portion of the program
instead of really just being a stand-alone program.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 13:03:58 -07:00
Greg Kroah-Hartman
aae65b6293 Remove the FSF address from the source files.
This keeps us from having to track the movements of them, as that's a
pointless exercise.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09 11:41:43 -07:00
Dafydd Crosby
71413e7723 Verbose flag in tree mode shows vendor and product name.
When running `lsusb -tv`, devices should have the vendor and
product name appended to the row.

Signed-off-by: Dafydd Crosby <dtcrsby@gmail.com>
2011-06-08 14:45:30 -06:00
Greg Kroah-Hartman
5590848ce8 Fix up a lot of memory leaks
Based on an original patch from Pedro Kiefer <pedro@kiefer.com.br>

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-12 15:51:53 -07:00
Greg Kroah-Hartman
93aa80bfbd coding style cleanups for .h files.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-28 10:27:29 -07:00
David Brownell
d06e0b8f3f Print video terminal info; from Laurent Pinchart. 2005-10-22 06:22:41 +00:00
Thomas Sailer
f72b28bdea From: Aurelien Jarno <aurelien@aurel32.net>
Subject: [usbutils] Patch to support reporting of keyboard country type
Date:    Thu, 18 Mar 2004 10:58:31 +0100

Hi Thomas !

Please find attached a patch against the current CVS that I received
viathe Debian Bug Tracking System. It looks up the decimal HID Country
Code in usb.ids and reports it when "lsusb -v" is used on an HID
device.

For most cheap PC USB keyboards the data may be misleading, as they
commonly report as 00 or 33 types regardless of mapping.  However, Sun
and Apple kit uses the extension.

The list of HID Country Code has already been integrated into
usb.ids.You may have to update the version in the CVS from
http://linux-usb.org

Regards,
Aurelien
2004-03-18 10:52:42 +00:00
Thomas Sailer
cd35e0d38c Initial revision 2004-02-20 14:08:19 +00:00