2020-05-27 15:21:28 +00:00
|
|
|
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
|
|
|
|
|
/* Copyright(c) 2014 - 2020 Intel Corporation */
|
2014-06-05 20:43:32 +00:00
|
|
|
#ifndef _QAT_CRYPTO_INSTANCE_H_
|
|
|
|
|
#define _QAT_CRYPTO_INSTANCE_H_
|
|
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
|
|
|
|
#include <linux/slab.h>
|
|
|
|
|
#include "adf_accel_devices.h"
|
|
|
|
|
#include "icp_qat_fw_la.h"
|
|
|
|
|
|
|
|
|
|
struct qat_crypto_instance {
|
|
|
|
|
struct adf_etr_ring_data *sym_tx;
|
|
|
|
|
struct adf_etr_ring_data *sym_rx;
|
|
|
|
|
struct adf_etr_ring_data *pke_tx;
|
|
|
|
|
struct adf_etr_ring_data *pke_rx;
|
|
|
|
|
struct adf_accel_dev *accel_dev;
|
|
|
|
|
struct list_head list;
|
|
|
|
|
unsigned long state;
|
|
|
|
|
int id;
|
|
|
|
|
atomic_t refctr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct qat_crypto_request_buffs {
|
|
|
|
|
struct qat_alg_buf_list *bl;
|
|
|
|
|
dma_addr_t blp;
|
|
|
|
|
struct qat_alg_buf_list *blout;
|
|
|
|
|
dma_addr_t bloutp;
|
|
|
|
|
size_t sz;
|
2014-12-08 20:05:42 +00:00
|
|
|
size_t sz_out;
|
2014-06-05 20:43:32 +00:00
|
|
|
};
|
|
|
|
|
|
2014-12-08 20:08:49 +00:00
|
|
|
struct qat_crypto_request;
|
|
|
|
|
|
2014-06-05 20:43:32 +00:00
|
|
|
struct qat_crypto_request {
|
|
|
|
|
struct icp_qat_fw_la_bulk_req req;
|
2014-12-08 20:08:49 +00:00
|
|
|
union {
|
|
|
|
|
struct qat_alg_aead_ctx *aead_ctx;
|
2019-11-09 17:09:50 +00:00
|
|
|
struct qat_alg_skcipher_ctx *skcipher_ctx;
|
2014-12-08 20:08:49 +00:00
|
|
|
};
|
|
|
|
|
union {
|
|
|
|
|
struct aead_request *aead_req;
|
2019-11-09 17:09:50 +00:00
|
|
|
struct skcipher_request *skcipher_req;
|
2014-12-08 20:08:49 +00:00
|
|
|
};
|
2014-06-05 20:43:32 +00:00
|
|
|
struct qat_crypto_request_buffs buf;
|
2014-12-08 20:08:49 +00:00
|
|
|
void (*cb)(struct icp_qat_fw_la_resp *resp,
|
|
|
|
|
struct qat_crypto_request *req);
|
2019-04-29 15:43:17 +00:00
|
|
|
void *iv;
|
|
|
|
|
dma_addr_t iv_paddr;
|
2014-06-05 20:43:32 +00:00
|
|
|
};
|
2014-12-08 20:08:49 +00:00
|
|
|
|
2014-06-05 20:43:32 +00:00
|
|
|
#endif
|