#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <crypto/scatterwalk.h>
#include <crypto/des.h>
#include <linux/ccp.h>
#include "ccp-dev.h"
static const __be32 ccp_sha1_init[SHA1_DIGEST_SIZE / sizeof(__be32)] = …;
static const __be32 ccp_sha224_init[SHA256_DIGEST_SIZE / sizeof(__be32)] = …;
static const __be32 ccp_sha256_init[SHA256_DIGEST_SIZE / sizeof(__be32)] = …;
static const __be64 ccp_sha384_init[SHA512_DIGEST_SIZE / sizeof(__be64)] = …;
static const __be64 ccp_sha512_init[SHA512_DIGEST_SIZE / sizeof(__be64)] = …;
#define CCP_NEW_JOBID(ccp) …
static u32 ccp_gen_jobid(struct ccp_device *ccp)
{ … }
static void ccp_sg_free(struct ccp_sg_workarea *wa)
{ … }
static int ccp_init_sg_workarea(struct ccp_sg_workarea *wa, struct device *dev,
struct scatterlist *sg, u64 len,
enum dma_data_direction dma_dir)
{ … }
static void ccp_update_sg_workarea(struct ccp_sg_workarea *wa, unsigned int len)
{ … }
static void ccp_dm_free(struct ccp_dm_workarea *wa)
{ … }
static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa,
struct ccp_cmd_queue *cmd_q,
unsigned int len,
enum dma_data_direction dir)
{ … }
static int ccp_set_dm_area(struct ccp_dm_workarea *wa, unsigned int wa_offset,
struct scatterlist *sg, unsigned int sg_offset,
unsigned int len)
{ … }
static void ccp_get_dm_area(struct ccp_dm_workarea *wa, unsigned int wa_offset,
struct scatterlist *sg, unsigned int sg_offset,
unsigned int len)
{ … }
static int ccp_reverse_set_dm_area(struct ccp_dm_workarea *wa,
unsigned int wa_offset,
struct scatterlist *sg,
unsigned int sg_offset,
unsigned int len)
{ … }
static void ccp_reverse_get_dm_area(struct ccp_dm_workarea *wa,
unsigned int wa_offset,
struct scatterlist *sg,
unsigned int sg_offset,
unsigned int len)
{ … }
static void ccp_free_data(struct ccp_data *data, struct ccp_cmd_queue *cmd_q)
{ … }
static int ccp_init_data(struct ccp_data *data, struct ccp_cmd_queue *cmd_q,
struct scatterlist *sg, u64 sg_len,
unsigned int dm_len,
enum dma_data_direction dir)
{ … }
static unsigned int ccp_queue_buf(struct ccp_data *data, unsigned int from)
{ … }
static unsigned int ccp_fill_queue_buf(struct ccp_data *data)
{ … }
static unsigned int ccp_empty_queue_buf(struct ccp_data *data)
{ … }
static void ccp_prepare_data(struct ccp_data *src, struct ccp_data *dst,
struct ccp_op *op, unsigned int block_size,
bool blocksize_op)
{ … }
static void ccp_process_data(struct ccp_data *src, struct ccp_data *dst,
struct ccp_op *op)
{ … }
static int ccp_copy_to_from_sb(struct ccp_cmd_queue *cmd_q,
struct ccp_dm_workarea *wa, u32 jobid, u32 sb,
u32 byte_swap, bool from)
{ … }
static int ccp_copy_to_sb(struct ccp_cmd_queue *cmd_q,
struct ccp_dm_workarea *wa, u32 jobid, u32 sb,
u32 byte_swap)
{ … }
static int ccp_copy_from_sb(struct ccp_cmd_queue *cmd_q,
struct ccp_dm_workarea *wa, u32 jobid, u32 sb,
u32 byte_swap)
{ … }
static noinline_for_stack int
ccp_run_aes_cmac_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_aes_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_xts_aes_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_des3_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_rsa_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_passthru_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_passthru_nomap_cmd(struct ccp_cmd_queue *cmd_q,
struct ccp_cmd *cmd)
{ … }
static int ccp_run_ecc_mm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static int ccp_run_ecc_pm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
static noinline_for_stack int
ccp_run_ecc_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }
int ccp_run_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{ … }