1、异步传输描述符(linux/dmaengine.h):
struct dma_async_tx_descriptor {
dma_cookie_t cookie; /*本次传输的跟踪cookie,如果本次传输位于独立的链表,则设置为-EBUSY*/
enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */
dma_addr_t phys; /*该描述符的物理地址*/
struct dma_chan *chan; /*本次操作的目标通道*/
dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); /*设置准备好的描述符被DMA引擎执行*/
dma_async_tx_callback callback; /*本次操作完成后的回调函数*/
void *callback_param; /*完成回调函数的参数*/
struct dma_async_tx_descriptor *next; /*完成后递交该描述符*/
struct dma_async_tx_descriptor *parent; /*升级的下一个描述符*/
spinlock_t lock;
};
2、异步传输递交/完成控制器(linux/async_tx.h)
/**
* struct async_submit_ctl - async_tx submission/completion modifiers
* @flags: submission modifiers
* @depend_tx: parent dependency of the current operation being submitted
* @cb_fn: callback routine to run at operation completion
* @cb_param: parameter for the callback routine
* @scribble: caller provided space for dma/page address conversions
*/
struct async_submit_ctl {
enum async_tx_flags flags; /*异步传输标志位*/
struct dma_async_tx_

本文详细介绍了在Linux系统中,软RAID5实现中涉及到的DMA异步传输描述符、控制器、标志位的使用,以及如何初始化和执行异步操作。通过异步传输控制器设置传输标志,利用dma_async_tx_descriptor结构体描述异步传输过程,并通过异步传输回调函数处理传输完成。同时,文章阐述了如何找到合适的通道执行异步操作,以及在找不到通道时转为同步执行的情况。
最低0.47元/天 解锁文章
5158

被折叠的 条评论
为什么被折叠?



