mbox series

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

Message ID 20250206103428.1034784-1-niklas.neronin@linux.intel.com (mailing list archive)
Headers show
Series usb: xhci: improve trb_in_td() | expand

Message

Niklas Neronin Feb. 6, 2025, 10:34 a.m. UTC
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(-)