Rather than having a single tx frame completion topic that all transmit frame completions are published to, struct can_tx_frame_s will have a pointer to a topic on which its completion message will be published.
frame_pool will move from struct can_tx_queue_s into struct can_instance_s, and stage_head will be removed from struct can_tx_queue_s. An API will be provided to atomically allocate a list of N struct can_tx_frame_s from unlocked thread context, as well as an API to atomically commit a list of frames to be sent and an API to free a list of frames. This will simplify the tx queue and minimize the time spent in system locked state.
I'm going to make the following changes:
struct can_tx_frame_s
will have a pointer to a topic on which its completion message will be published.frame_pool
will move fromstruct can_tx_queue_s
intostruct can_instance_s
, andstage_head
will be removed fromstruct can_tx_queue_s
. An API will be provided to atomically allocate a list of Nstruct can_tx_frame_s
from unlocked thread context, as well as an API to atomically commit a list of frames to be sent and an API to free a list of frames. This will simplify the tx queue and minimize the time spent in system locked state.