dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::usb::isoc::pipeline< pipe_t, circular_t > Class Template Reference

one clock domain endpoint's request pipeline and data move over the slots of a round, the same in every environment More...

#include <dx_usb_isoc.h>

Inheritance diagram for dx::usb::isoc::pipeline< pipe_t, circular_t >:
Collaboration diagram for dx::usb::isoc::pipeline< pipe_t, circular_t >:

Classes

struct  [struct].cache
struct  [struct].sync

Public Member Functions

void charge(int64_t now, int64_t period)
 the session prologue past the alternate setting's selection: frees every slot, seeds the feedback, times the cycle
uint32_t fill(tick_t& tick)
 takes an out slot's data from the ring, sized as its request was submitted; returns the lines taken
void housekeeping(volatile uint64_t& rtx, uint32_t size, int64_t timestamp, int64_t entry, int64_t period)
 the ring's cycle bookkeeping past a tick's move: its timestamp and the cycle boundary's time
void initialize(uint32_t packet_size, uint32_t micro_frames)
void initialize(uint32_t samplerate, uint32_t line_size, uint32_t micro_frames, bool implicit_feedback)
 pipeline(pipe_t& pipe)
void rate(uint32_t samplerate)
bool submitting() const
void sync_initialize(uint32_t packet, uint32_t micro_frames)
 the feedback endpoint's slots stand: every slot's request a packet per micro frame
void sync_transfer(uint64_t frame)
 the sink's own feedback endpoint: collects the rate it states and turns it into this pipeline's per frame line counts
uint32_t transact(int64_t timestamp, int64_t period, uint32_t advance)
 a bulk or interrupt endpoint's tick: its slots are transactions the device paces, in submission order - the tick counts their completions, takes an in transaction as soon as the last bytes of each of its packets left the sentinel (at its completion where they never do: a short packet, a buffer the platform copies) and fills an out transaction once the device's position comes within lead transactions of it (at its submit where it already is). The device's position runs with the reference's advance and is raised by every completion; a completion ahead of its fill counts as overload. Returns the lines the wire moved.
uint32_t transfer(uint64_t frame, uint64_t live, int64_t timestamp, int64_t period, uint32_t advance)
 the group's tick at bus frame frame, the wire at live, the frame's start at timestamp, the reference stream's lines the tick before at advance; returns the lines moved

Public Attributes

struct  cache
bool charged{}
 the session's alternate setting is selected and the slots stand
circular_t* circular{}
 the endpoint's ring: its type's force_read/force_write are the wire format's codec
dx::circular* feedback{}
 asynchronous: the line count an out slot carries per frame, produced by the in side's scan
bool held{}
 past its stop: the session keeps it submitting while the direction the device stops first still holds requests (desc::start_stop_order)
dx::stream::clock::monitor* monitor{}
 the session's counters, while a client maps them
uint8_t* sentinel{}
 in: a slot's image of pseudo random lines, its fill between takes - the controller's data ends at the last line differing from it
os_result status{}
 the charge's: a failed one rests the group, a recovery clears it
struct  sync
struct dx::usb::audio::isoc::cycle::tick* tick= nullptr
bool ticking{}
 between start() and stop(): the tick charges and submits
uint32_t ticks{}

Friends

template<typename>
struct session

Detailed Description

template<typename pipe_t, typename circular_t = dx::circular>
class dx::usb::isoc::pipeline< pipe_t, circular_t >

one clock domain endpoint's request pipeline and data move over the slots of a round, the same in every environment

Compiled in user mode and in the kernel alike (status returns, no exceptions), the pipeline holds every scheduling rule of an endpoint's session - see dxd/CLAUDE.md "Isoc scheduling": the group's tick at bus frame frame submits the free slot a round ahead, resubmits every polled completion a round on, both in frame order, and moves the data - an out slot due lead frames ahead is filled from the ring into its pending request, the in slot due lead frames behind is taken ahead of its completion, the sentinel scan its size's source. A bulk or interrupt endpoint's slot is one transaction of cache.lines lines the device paces (transact). Completions only count.

The environment's pipe supplies the platform's part:

  • os_result receive(struct tick&, uint64_t& sequence) / transmit(...): the slot's request, sequence advanced past it
  • bool poll(isoc::result&): the next completion, in submission order (the platform's request ring keeps it), result.frame naming the slot's frames
  • void moved(): data moved between a slot and the ring: the ring's readers get told
  • size_t vendor(uint8_t* wire, size_t size, bool data): a transaction's wire bytes past its fill (out, data false: an idle slot) and ahead of its take (in: the bytes the ring takes)
  • int64_t now(): the timestamp clock, in the group's units
  • bool outstanding(): requests in flight, the session's idle gate; os_result charge(): the session prologue - the alternate setting selected, the slots stood, then the pipeline's own; it keeps its result in status, logging a failure as it starts and its recovery once
  • with a sync endpoint: os_result sync_receive(unsigned int slot, uint64_t& sequence) / bool sync_poll(isoc::result&), the feedback endpoint's request and completion

Constructor & Destructor Documentation

◆ pipeline()

template<typename pipe_t, typename circular_t= dx::circular>
dx::usb::isoc::pipeline<pipe_t, circular_t>::pipeline(pipe_t& pipe)
inline

Member Function Documentation

◆ charge()

template<typename pipe_t, typename circular_t= dx::circular>
void dx::usb::isoc::pipeline<pipe_t, circular_t>::charge(int64_t now, int64_t period)
inline

the session prologue past the alternate setting's selection: frees every slot, seeds the feedback, times the cycle

Here is the call graph for this function:

◆ fill()

template<typename pipe_t, typename circular_t= dx::circular>
uint32_t dx::usb::isoc::pipeline<pipe_t, circular_t>::fill(tick_t& tick)
inline

takes an out slot's data from the ring, sized as its request was submitted; returns the lines taken

Here is the caller graph for this function:

◆ housekeeping()

template<typename pipe_t, typename circular_t= dx::circular>
void dx::usb::isoc::pipeline<pipe_t, circular_t>::housekeeping(volatile uint64_t& rtx, uint32_t size, int64_t timestamp, int64_t entry, int64_t period)
inline

the ring's cycle bookkeeping past a tick's move: its timestamp and the cycle boundary's time

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [1/2]

void dx::usb::audio::isoc::cycle::initialize(uint32_t packet_size, uint32_t micro_frames)
inlineinherited

◆ initialize() [2/2]

void dx::usb::audio::isoc::cycle::initialize(uint32_t samplerate, uint32_t line_size, uint32_t micro_frames, bool implicit_feedback)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rate()

template<typename pipe_t, typename circular_t= dx::circular>
void dx::usb::isoc::pipeline<pipe_t, circular_t>::rate(uint32_t samplerate)
inline

the rate the domain committed, derived once for the tick: the lines a frame carries, the sizes the slots' requests carry - a ring outlives its sessions, so every commit rederives them and a session runs the rate set since

Here is the call graph for this function:
Here is the caller graph for this function:

◆ submitting()

template<typename pipe_t, typename circular_t= dx::circular>
bool dx::usb::isoc::pipeline<pipe_t, circular_t>::submitting() const
inline
Here is the caller graph for this function:

◆ sync_initialize()

template<typename pipe_t, typename circular_t= dx::circular>
void dx::usb::isoc::pipeline<pipe_t, circular_t>::sync_initialize(uint32_t packet, uint32_t micro_frames)
inline

the feedback endpoint's slots stand: every slot's request a packet per micro frame

◆ sync_transfer()

template<typename pipe_t, typename circular_t= dx::circular>
void dx::usb::isoc::pipeline<pipe_t, circular_t>::sync_transfer(uint64_t frame)
inline

the sink's own feedback endpoint: collects the rate it states and turns it into this pipeline's per frame line counts

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transact()

template<typename pipe_t, typename circular_t= dx::circular>
uint32_t dx::usb::isoc::pipeline<pipe_t, circular_t>::transact(int64_t timestamp, int64_t period, uint32_t advance)
inline

a bulk or interrupt endpoint's tick: its slots are transactions the device paces, in submission order - the tick counts their completions, takes an in transaction as soon as the last bytes of each of its packets left the sentinel (at its completion where they never do: a short packet, a buffer the platform copies) and fills an out transaction once the device's position comes within lead transactions of it (at its submit where it already is). The device's position runs with the reference's advance and is raised by every completion; a completion ahead of its fill counts as overload. Returns the lines the wire moved.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transfer()

template<typename pipe_t, typename circular_t= dx::circular>
uint32_t dx::usb::isoc::pipeline<pipe_t, circular_t>::transfer(uint64_t frame, uint64_t live, int64_t timestamp, int64_t period, uint32_t advance)
inline

the group's tick at bus frame frame, the wire at live, the frame's start at timestamp, the reference stream's lines the tick before at advance; returns the lines moved

Here is the call graph for this function:
Here is the caller graph for this function:

◆ session

template<typename pipe_t, typename circular_t= dx::circular>
template<typename>
friend struct session
friend

Member Data Documentation

◆ cache

◆ charged

template<typename pipe_t, typename circular_t= dx::circular>
bool dx::usb::isoc::pipeline<pipe_t, circular_t>::charged{}

the session's alternate setting is selected and the slots stand

◆ circular

template<typename pipe_t, typename circular_t= dx::circular>
circular_t* dx::usb::isoc::pipeline<pipe_t, circular_t>::circular{}

the endpoint's ring: its type's force_read/force_write are the wire format's codec

◆ feedback

template<typename pipe_t, typename circular_t= dx::circular>
dx::circular* dx::usb::isoc::pipeline<pipe_t, circular_t>::feedback{}

asynchronous: the line count an out slot carries per frame, produced by the in side's scan

◆ held

template<typename pipe_t, typename circular_t= dx::circular>
bool dx::usb::isoc::pipeline<pipe_t, circular_t>::held{}

past its stop: the session keeps it submitting while the direction the device stops first still holds requests (desc::start_stop_order)

◆ monitor

template<typename pipe_t, typename circular_t= dx::circular>
dx::stream::clock::monitor* dx::usb::isoc::pipeline<pipe_t, circular_t>::monitor{}

the session's counters, while a client maps them

◆ sentinel

template<typename pipe_t, typename circular_t= dx::circular>
uint8_t* dx::usb::isoc::pipeline<pipe_t, circular_t>::sentinel{}

in: a slot's image of pseudo random lines, its fill between takes - the controller's data ends at the last line differing from it

◆ status

template<typename pipe_t, typename circular_t= dx::circular>
os_result dx::usb::isoc::pipeline<pipe_t, circular_t>::status{}

the charge's: a failed one rests the group, a recovery clears it

◆ sync

◆ tick

struct dx::usb::audio::isoc::cycle::tick* dx::usb::audio::isoc::cycle::tick= nullptr
inherited

◆ ticking

template<typename pipe_t, typename circular_t= dx::circular>
bool dx::usb::isoc::pipeline<pipe_t, circular_t>::ticking{}

between start() and stop(): the tick charges and submits

◆ ticks

uint32_t dx::usb::audio::isoc::cycle::ticks{}
inherited

The documentation for this class was generated from the following file: