[PATCH 0/4] usb: xhci: improve trb_in_td()

Niklas Neronin
2025-02-06T10:36:22Z

Function td_in_trd() checks whether a DMA address is within the TDs
boundaries. This patch set aims to simplify and improve trb_in_td().

Additionally, the rework will enable trb_in_td() (with renaming and minor
modifications) to also check whether a DMA address is in a ring queue.
This will be utilized in the upcoming handle_tx_event() rework.

Example of a Ring Structure:
The example segment ring is composed of three segments (A, B, C), each
containing three TRBs (1, 2, 3). Any segment can serve as the start or
end segment, and any TRB within the start segment can be the start TRB,
and vice versa.

+---+ +---+ +---+
C --> | A |-->| B |-->| C |--> A
+---+ +---+ +---+
| | |
+---+ +---+ +---+
| 1 | | 1 | | 1 |
| 2 | | 2 | | 2 |
| 3 | | 3 | | 3 |
+---+ +---+ +---+

Niklas Neronin (4):
usb: xhci: refactor trb_in_td() to be static
usb: xhci: move debug capabilities from trb_in_td() to
handle_tx_event()
usb: xhci: rework and simplify trb_in_td()
usb: xhci: modify trb_in_td() to be more modular

drivers/usb/host/xhci-ring.c | 143 ++++++++++++++++++-----------------
drivers/usb/host/xhci.h | 2 -
2 files changed, 72 insertions(+), 73 deletions(-)

--
2.47.2