linux/drivers/crypto/hisilicon/zip/zip_crypto.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 HiSilicon Limited. */
#include <crypto/internal/acompress.h>
#include <linux/bitfield.h>
#include <linux/bitmap.h>
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
#include "zip.h"

/* hisi_zip_sqe dw3 */
#define HZIP_BD_STATUS_M
/* hisi_zip_sqe dw7 */
#define HZIP_IN_SGE_DATA_OFFSET_M
#define HZIP_SQE_TYPE_M
/* hisi_zip_sqe dw8 */
#define HZIP_OUT_SGE_DATA_OFFSET_M
/* hisi_zip_sqe dw9 */
#define HZIP_REQ_TYPE_M
#define HZIP_ALG_TYPE_DEFLATE
#define HZIP_BUF_TYPE_M
#define HZIP_SGL

#define HZIP_ALG_PRIORITY
#define HZIP_SGL_SGE_NR

#define HZIP_ALG_DEFLATE

static DEFINE_MUTEX(zip_algs_lock);
static unsigned int zip_available_devs;

enum hisi_zip_alg_type {};

enum {};

#define COMP_NAME_TO_TYPE(alg_name)

struct hisi_zip_req {};

struct hisi_zip_req_q {};

struct hisi_zip_qp_ctx {};

struct hisi_zip_sqe_ops {};

struct hisi_zip_ctx {};

static int sgl_sge_nr_set(const char *val, const struct kernel_param *kp)
{}

static const struct kernel_param_ops sgl_sge_nr_ops =;

static u16 sgl_sge_nr =;
module_param_cb();
MODULE_PARM_DESC();

static struct hisi_zip_req *hisi_zip_create_req(struct hisi_zip_qp_ctx *qp_ctx,
						struct acomp_req *req)
{}

static void hisi_zip_remove_req(struct hisi_zip_qp_ctx *qp_ctx,
				struct hisi_zip_req *req)
{}

static void hisi_zip_fill_addr(struct hisi_zip_sqe *sqe, struct hisi_zip_req *req)
{}

static void hisi_zip_fill_buf_size(struct hisi_zip_sqe *sqe, struct hisi_zip_req *req)
{}

static void hisi_zip_fill_buf_type(struct hisi_zip_sqe *sqe, u8 buf_type)
{}

static void hisi_zip_fill_req_type(struct hisi_zip_sqe *sqe, u8 req_type)
{}

static void hisi_zip_fill_tag(struct hisi_zip_sqe *sqe, struct hisi_zip_req *req)
{}

static void hisi_zip_fill_sqe_type(struct hisi_zip_sqe *sqe, u8 sqe_type)
{}

static void hisi_zip_fill_sqe(struct hisi_zip_ctx *ctx, struct hisi_zip_sqe *sqe,
			      u8 req_type, struct hisi_zip_req *req)
{}

static int hisi_zip_do_work(struct hisi_zip_qp_ctx *qp_ctx,
			    struct hisi_zip_req *req)
{}

static u32 hisi_zip_get_tag(struct hisi_zip_sqe *sqe)
{}

static u32 hisi_zip_get_status(struct hisi_zip_sqe *sqe)
{}

static u32 hisi_zip_get_dstlen(struct hisi_zip_sqe *sqe)
{}

static void hisi_zip_acomp_cb(struct hisi_qp *qp, void *data)
{}

static int hisi_zip_acompress(struct acomp_req *acomp_req)
{}

static int hisi_zip_adecompress(struct acomp_req *acomp_req)
{}

static int hisi_zip_start_qp(struct hisi_qp *qp, struct hisi_zip_qp_ctx *qp_ctx,
			     int alg_type, int req_type)
{}

static void hisi_zip_release_qp(struct hisi_zip_qp_ctx *qp_ctx)
{}

static const struct hisi_zip_sqe_ops hisi_zip_ops =;

static int hisi_zip_ctx_init(struct hisi_zip_ctx *hisi_zip_ctx, u8 req_type, int node)
{}

static void hisi_zip_ctx_exit(struct hisi_zip_ctx *hisi_zip_ctx)
{}

static int hisi_zip_create_req_q(struct hisi_zip_ctx *ctx)
{}

static void hisi_zip_release_req_q(struct hisi_zip_ctx *ctx)
{}

static int hisi_zip_create_sgl_pool(struct hisi_zip_ctx *ctx)
{}

static void hisi_zip_release_sgl_pool(struct hisi_zip_ctx *ctx)
{}

static void hisi_zip_set_acomp_cb(struct hisi_zip_ctx *ctx,
				  void (*fn)(struct hisi_qp *, void *))
{}

static int hisi_zip_acomp_init(struct crypto_acomp *tfm)
{}

static void hisi_zip_acomp_exit(struct crypto_acomp *tfm)
{}

static struct acomp_alg hisi_zip_acomp_deflate =;

static int hisi_zip_register_deflate(struct hisi_qm *qm)
{}

static void hisi_zip_unregister_deflate(struct hisi_qm *qm)
{}

int hisi_zip_register_to_crypto(struct hisi_qm *qm)
{}

void hisi_zip_unregister_from_crypto(struct hisi_qm *qm)
{}