tools/usb/hcd-tests.sh
Source file repositories/reference/linux-study-clean/tools/usb/hcd-tests.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/usb/hcd-tests.sh- Extension
.sh- Size
- 6217 bytes
- Lines
- 275
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function do_test
Annotated Snippet
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# test types can be passed on the command line:
#
# - control: any device can do this
# - out, in: out needs 'bulk sink' firmware, in needs 'bulk src'
# - iso-out, iso-in: out needs 'iso sink' firmware, in needs 'iso src'
# - halt: needs bulk sink+src, tests halt set/clear from host
# - unlink: needs bulk sink and/or src, test HCD unlink processing
# - loop: needs firmware that will buffer N transfers
#
# run it for hours, days, weeks.
#
#
# this default provides a steady test load for a bulk device
#
TYPES='control out in'
#TYPES='control out in halt'
#
# to test HCD code
#
# - include unlink tests
# - add some ${RANDOM}ness
# - connect several devices concurrently (same HC)
# - keep HC's IRQ lines busy with unrelated traffic (IDE, net, ...)
# - add other concurrent system loads
#
declare -i COUNT BUFLEN
COUNT=50000
BUFLEN=2048
# NOTE: the 'in' and 'out' cases are usually bulk, but can be
# set up to use interrupt transfers by 'usbtest' module options
if [ "$DEVICE" = "" ]; then
echo "testing ALL recognized usbtest devices"
echo ""
TEST_ARGS="-a"
else
TEST_ARGS=""
fi
do_test ()
{
if ! ./testusb $TEST_ARGS -s $BUFLEN -c $COUNT $* 2>/dev/null
then
echo "FAIL"
exit 1
fi
}
ARGS="$*"
if [ "$ARGS" = "" ];
then
ARGS="$TYPES"
fi
# FIXME use /sys/bus/usb/device/$THIS/bConfigurationValue to
# check and change configs
CONFIG=''
check_config ()
Annotation
- Detected declarations: `function do_test`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.