diff options
author | Ryder Lee <ryder.lee@mediatek.com> | 2017-03-09 05:11:15 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-03-16 12:58:53 +0300 |
commit | 3d21c41f7e9b51c70d37b316f11cf5cce9dd3311 (patch) | |
tree | 57a1fccf9f7d5e9399a2c8af74f4b9e743795249 /drivers/crypto/mediatek/mtk-platform.h | |
parent | 82445fe995f4b1edf131157a7328796d5aec1efb (diff) | |
download | linux-3d21c41f7e9b51c70d37b316f11cf5cce9dd3311.tar.xz |
crypto: mediatek - simplify descriptor ring management
This patch replaces cmd_pos/res_pos with pointer cmd_next/res_next.
In old code, we must to add one to shift ring to the next segment, and
then use this value to caculate current offset from ring base for each
DMA operation. Now these pointers helps us to simplify flow, so we just
need to move pointers and check the boundaries of ring.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/mediatek/mtk-platform.h')
-rw-r--r-- | drivers/crypto/mediatek/mtk-platform.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/mediatek/mtk-platform.h b/drivers/crypto/mediatek/mtk-platform.h index 78ce54e136c5..218e30d1828a 100644 --- a/drivers/crypto/mediatek/mtk-platform.h +++ b/drivers/crypto/mediatek/mtk-platform.h @@ -84,11 +84,11 @@ struct mtk_desc { /** * struct mtk_ring - Descriptor ring * @cmd_base: pointer to command descriptor ring base + * @cmd_next: pointer to the next command descriptor * @cmd_dma: DMA address of command descriptor ring - * @cmd_pos: current position in the command descriptor ring * @res_base: pointer to result descriptor ring base + * @res_next: pointer to the next result descriptor * @res_dma: DMA address of result descriptor ring - * @res_pos: current position in the result descriptor ring * * A descriptor ring is a circular buffer that is used to manage * one or more descriptors. There are two type of descriptor rings; @@ -96,11 +96,11 @@ struct mtk_desc { */ struct mtk_ring { struct mtk_desc *cmd_base; + struct mtk_desc *cmd_next; dma_addr_t cmd_dma; - u32 cmd_pos; struct mtk_desc *res_base; + struct mtk_desc *res_next; dma_addr_t res_dma; - u32 res_pos; }; /** |