Skip to content

Commit

Permalink
Properly configure USB 3.1 speed, if supported by the kernel
Browse files Browse the repository at this point in the history
USBIP in Linux 6.12 accepts USB_SPEED_SUPER_PLUS now (see
bb548c1654db4a6f1a42657ed9068237e0c044b5 in Linux). Configure USB 3.1
device this way if kernel is new enough.

QubesOS/qubes-issues#9587
  • Loading branch information
marmarek committed Nov 19, 2024
1 parent 90d68ce commit fc8806b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/usb-import
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,18 @@ if [ -z "$untrusted_devid" ] && [ -z "$untrusted_speed" ]; then
exit 1
fi

max_supported_speed=5
if printf "6.12\n%s\n" "$(uname -r)" | sort -VC; then
max_supported_speed=6
fi

case "$untrusted_speed" in
1.5) speed=1 ;; # Low Speed
12) speed=2 ;; # Full speed
480) speed=3 ;; # High Speed
53.3-480) speed=4 ;; # Wireless
5000) speed=5 ;; # Super Speed
10000) speed=5 ;; # Super Speed Plus (USB 3.1); Announce as USB 3.0 until USBIP get support
10000) speed=$max_supported_speed ;; # Super Speed Plus (USB 3.1); Announce as USB 3.0 until USBIP get support
*) ERROR "Invalid speed \"$untrusted_speed\" received." \
"Expected \"1.5\", \"12\", \"480\", \"53.3-480\", \"5000\", \"10000\". " \
"If the remote side sent nothing, this could mean "\
Expand Down

0 comments on commit fc8806b

Please sign in to comment.