Commit Graph

12 Commits

Author SHA1 Message Date
Emil Velikov
52f333ae04 ci: add codespell action, fix all typos
v2:
 - ignore NEWS, omit suppressions
 - split off style changes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2024-10-16 16:57:34 +01:00
Emil Velikov
5d14ff7127 meson: always include config.h first, use -include
Seems like we've (tried) to fix this in the past, although it crept in
again. Just use a compiler directive and drop the error prone individual
includes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2024-09-18 23:15:10 +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
Greg Kroah-Hartman
e63347dfec desc-dump.c: fix compiler warning about unused variable
Left over from the descriptor changes that just got merged.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-07 19:04:44 +02:00
Michael Drake
4f2a365e20 lsusb: Add support for descriptor extensions.
These allow descriptors with common fields at the start, one of
which common fields specifies a field whos value determines which
of a set of descriptor extensions should be used to render the
remainder of the descriptor.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2018-06-07 17:55:45 +01:00
Michael Drake
80843d0818 lsusb: Split out field name rendering.
Splits out the rendering of fields from desc_dump() since it
is a single unit of functionality and the desc_dump() function
had grown quite complex.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2018-06-07 17:55:40 +01:00
Michael Drake
e497fcd9d6 lsusb: Split out routine that fetches value for given field.
Field value lookup was done in multiple places, so it's useful
as a helper function.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2018-06-07 17:55:25 +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
Michael Drake
090fd9b7c4 lsusb: Fix array entry count for variable sized entries.
This fixes a divide by zero which happened when an array,
without an explicit entry count (ultimately calculated from
the value in the descriptor data's bLength field) was used
on field with a variable size.

The solultion is to use the get_entry_size() function on
the array entry, which can get the entry size from a
referenced field.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-07 21:01:17 +01:00
Michael Drake
969054759a lsusb: Squash Wpointer-compare warning.
This squashes "warning: comparison between pointer and zero character"

This was an empty string check that was checking the pointer rather
than the first character.  The check was done correctly before the
string was used, so here we yank the correct check up, to the upper
level, replacing the ineffectual/broken one.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-07 18:15:29 +01:00
Michael Drake
5696933b47 lsusb: Add descriptor definitions for UAC3.
These descriptor definitions descibe how raw descriptor data
should be interpreted.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-07 15:53:28 +01:00
Michael Drake
7e9defbdb6 lsusb: Add code to dump descriptor data using descriptor definition.
This adds a new way of dumping descriptors.  It takes the descriptor
data to be dumped, and a descriptor definition as input.

The descriptor definition takes the form of a NULL terminated array
of descriptor field definitions.

These definitions describe how the raw descriptor data buffer should
be interpreted.

Thus the knowledge of how to interpret a descriptor buffer is separate
from the shared code that renders the descriptor dump.  This has two
advantages:

1. The code for dumping descriptors is common, so the output is easy
   to keep consistent.  It is also consistent and thorough in its
   handling of insufficient descriptor data buffer, and junk data
   at the end of a descriptor.

2. It is easy to add support for new descriptors, since they are now
   simple definitions that resemble the tables in the USB specifications.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-07 15:52:48 +01:00