xhci: Refactor xhci_generic_setup code

Our USB TRB buildup subroutines were previously difficult to follow. In
setup_generic_chain_sub(), the routine filled TRB packets based on the
characteristics passed by the caller and the current state (for example,
whether the TRB was the last in the TD).

However, most TRB types (except Normal TRBs) cannot be shared across TDs.
To simplify the logic, refactor xhci_setup_generic() so that TRBs are
constructed according to their transfer type, with dedicated helper
functions for each TRB type.

Sponsored by:   The FreeBSD Foundation
Assisted-by:    Claude Code (Opus 4.6, Opus 4.8(1M) and Sonet 5.0)
Differential Revision:  https://reviews.freebsd.org/D57130
This commit is contained in:
ShengYi Hung committed 2026-07-25 09:49:35 +08:00
1 parent a594783bac
commit e0b235ecd4
1 file changed
+533 -526
File diff suppressed because it is too large. Load diff