doc: usb_adapters: add container for lsusb dump of adapters

When extending an existing adapter driver, developer has to
carefully avoid to break backward compatibility.
But not all developers have access to many adapters for testing.

Prepare a folder aimed at containing 'lsusb -v' dumps of adapters
to be used as reference.
Add documentation and a simple dump script.

Change-Id: Ia3a9132d65ec8869734721f9605cebcebcf33608
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7296
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2022-10-22 18:12:16 +02:00
parent 9ffda10298
commit 2c191ef1da
2 changed files with 67 additions and 0 deletions

24
doc/usb_adapters/dump.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
devs=$(lsusb -d $1:$2 | wc -l)
case "$devs" in
0 )
echo "Error: USB device $1:$2 not found" > /dev/stderr
exit 1
;;
1 )
echo "Dumping $(lsusb -d $1:$2)" > /dev/stderr
;;
* )
echo "Error: Multiple matches for 'lsusb -d $1:$2'" > /dev/stderr
exit 1
;;
esac
# break SPDX tag to hide it to checkpatch
echo '# SPDX-''License-Identifier: GPL-2.0-or-later OR GFDL-1.2-no-invariants-or-later'
echo ''
echo '# Optional comment'
lsusb -v -d $1:$2 | sed 's/ *$//'