#include "ssi_hash.h"
#include "ssi_aead.h"
-#define GET_DMA_BUFFER_TYPE(buff_type) ( \
- ((buff_type) == SSI_DMA_BUF_NULL) ? "BUF_NULL" : \
- ((buff_type) == SSI_DMA_BUF_DLLI) ? "BUF_DLLI" : \
- ((buff_type) == SSI_DMA_BUF_MLLI) ? "BUF_MLLI" : "BUF_INVALID")
-
enum dma_buffer_type {
DMA_NULL_TYPE = -1,
DMA_SGL_TYPE = 1,
u32 *mlli_nents[MAX_NUM_OF_BUFFERS_IN_MLLI];
};
+static inline char *cc_dma_buf_type(enum ssi_req_dma_buf_type type)
+{
+ switch (type) {
+ case SSI_DMA_BUF_NULL:
+ return "BUF_NULL";
+ case SSI_DMA_BUF_DLLI:
+ return "BUF_DLLI";
+ case SSI_DMA_BUF_MLLI:
+ return "BUF_MLLI";
+ default:
+ return "BUF_INVALID";
+ }
+}
+
/**
* cc_copy_mac() - Copy MAC to temporary location
*
}
dev_dbg(dev, "areq_ctx->dma_buf_type = %s\n",
- GET_DMA_BUFFER_TYPE(req_ctx->dma_buf_type));
+ cc_dma_buf_type(req_ctx->dma_buf_type));
return 0;
areq_ctx->assoc.nents = 0;
areq_ctx->assoc.mlli_nents = 0;
dev_dbg(dev, "Chain assoc of length 0: buff_type=%s nents=%u\n",
- GET_DMA_BUFFER_TYPE(areq_ctx->assoc_buff_type),
+ cc_dma_buf_type(areq_ctx->assoc_buff_type),
areq_ctx->assoc.nents);
goto chain_assoc_exit;
}
if (unlikely((do_chain) ||
areq_ctx->assoc_buff_type == SSI_DMA_BUF_MLLI)) {
dev_dbg(dev, "Chain assoc: buff_type=%s nents=%u\n",
- GET_DMA_BUFFER_TYPE(areq_ctx->assoc_buff_type),
+ cc_dma_buf_type(areq_ctx->assoc_buff_type),
areq_ctx->assoc.nents);
cc_add_sg_entry(dev, sg_data, areq_ctx->assoc.nents, req->src,
req->assoclen, 0, is_last,
/* change the buffer index for the unmap function */
areq_ctx->buff_index = (areq_ctx->buff_index ^ 1);
dev_dbg(dev, "areq_ctx->data_dma_buf_type = %s\n",
- GET_DMA_BUFFER_TYPE(areq_ctx->data_dma_buf_type));
+ cc_dma_buf_type(areq_ctx->data_dma_buf_type));
return 0;
fail_unmap_din: