Suggested changes to support CPU cache flushing before doing DMA to target devices.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@46 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2006-12-12 11:20:19 +00:00
parent e63a0dcbd0
commit ea2141e197

View File

@@ -1013,6 +1013,13 @@ struct scst_cmd
*/
unsigned int mem_checked:1;
/*
* Set if target driver may need to call dma_sync_sg() or similar
* function before transferring cmd' data to the target device
* via DMA.
*/
unsigned int may_need_dma_sync:1;
/**************************************************************/
unsigned long cmd_flags; /* cmd's async flags */
@@ -1895,6 +1902,19 @@ static inline void scst_cmd_set_expected(struct scst_cmd *cmd,
cmd->expected_values_set = 1;
}
/*
* Get/clear functions for cmd's may_need_dma_sync
*/
static inline int scst_get_may_need_dma_sync(struct scst_cmd *cmd)
{
return cmd->may_need_dma_sync;
}
static inline void scst_clear_may_need_dma_sync(struct scst_cmd *cmd)
{
cmd->may_need_dma_sync = 0;
}
/*
* Get/Set function for mgmt cmd's target private data
*/
@@ -1931,6 +1951,7 @@ int __scst_get_buf(struct scst_cmd *cmd, uint8_t **buf);
static inline int scst_get_buf_first(struct scst_cmd *cmd, uint8_t **buf)
{
cmd->get_sg_buf_entry_num = 0;
cmd->may_need_dma_sync = 1;
return __scst_get_buf(cmd, buf);
}