Skip to content

Commit 38f4026

Browse files
committed
Merge remote-tracking branch 'origin/pr/46'
* origin/pr/46: Accept USB 3.2 Gen 2x2 (20Gbps) speed Properly configure USB 3.1 speed, if supported by the kernel
2 parents 340679d + 814240b commit 38f4026

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/usb-import

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,21 @@ if [ -z "$untrusted_devid" ] && [ -z "$untrusted_speed" ]; then
125125
exit 1
126126
fi
127127

128+
max_supported_speed=5
129+
if printf "6.12\n%s\n" "$(uname -r)" | sort -VC; then
130+
max_supported_speed=6
131+
fi
132+
128133
case "$untrusted_speed" in
129134
1.5) speed=1 ;; # Low Speed
130135
12) speed=2 ;; # Full speed
131136
480) speed=3 ;; # High Speed
132137
53.3-480) speed=4 ;; # Wireless
133138
5000) speed=5 ;; # Super Speed
134-
10000) speed=5 ;; # Super Speed Plus (USB 3.1); Announce as USB 3.0 until USBIP get support
139+
10000) speed=$max_supported_speed ;; # Super Speed Plus (USB 3.1)
140+
20000) speed=$max_supported_speed ;; # Super Speed Gen 2x2; Announce as USB 3.1 until USBIP get support
135141
*) ERROR "Invalid speed \"$untrusted_speed\" received." \
136-
"Expected \"1.5\", \"12\", \"480\", \"53.3-480\", \"5000\", \"10000\". " \
142+
"Expected \"1.5\", \"12\", \"480\", \"53.3-480\", \"5000\", \"10000\", \"20000\". " \
137143
"If the remote side sent nothing, this could mean "\
138144
" - the device is invalid or unplugged" \
139145
" - the VM crashed" \

0 commit comments

Comments
 (0)