drivers/crypto/hisilicon/sec2/sec.h

Source file repositories/reference/linux-study-clean/drivers/crypto/hisilicon/sec2/sec.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/hisilicon/sec2/sec.h
Extension
.h
Size
6170 bytes
Lines
290
Domain
Driver Families
Bucket
drivers/crypto
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sec_alg_res {
	u8 *pbuf;
	dma_addr_t pbuf_dma;
	u8 *c_ivin;
	dma_addr_t c_ivin_dma;
	u8 *a_ivin;
	dma_addr_t a_ivin_dma;
	u8 *out_mac;
	dma_addr_t out_mac_dma;
	u16 depth;
};

struct sec_hw_sge {
	dma_addr_t buf;
	void *page_ctrl;
	__le32 len;
	__le32 pad;
	__le32 pad0;
	__le32 pad1;
};

struct sec_hw_sgl {
	dma_addr_t next_dma;
	__le16 entry_sum_in_chain;
	__le16 entry_sum_in_sgl;
	__le16 entry_length_in_sgl;
	__le16 pad0;
	__le64 pad1[5];
	struct sec_hw_sgl *next;
	struct sec_hw_sge sge_entries[SEC_SGE_NR_NUM];
} __aligned(SEC_SGL_ALIGN_SIZE);

struct sec_src_dst_buf {
	struct sec_hw_sgl in;
	struct sec_hw_sgl out;
};

struct sec_request_buf {
	union {
		struct sec_src_dst_buf data_buf;
		__u8 pbuf[SEC_PBUF_SZ];
	};
	dma_addr_t in_dma;
	dma_addr_t out_dma;
};

/* Cipher request of SEC private */
struct sec_cipher_req {
	struct hisi_acc_hw_sgl *c_out;
	dma_addr_t c_out_dma;
	u8 *c_ivin;
	dma_addr_t c_ivin_dma;
	struct skcipher_request *sk_req;
	u32 c_len;
	bool encrypt;
	__u8 c_ivin_buf[SEC_IV_SIZE];
};

struct sec_aead_req {
	u8 *out_mac;
	dma_addr_t out_mac_dma;
	u8 *a_ivin;
	dma_addr_t a_ivin_dma;
	struct aead_request *aead_req;
	__u8 a_ivin_buf[SEC_IV_SIZE];
	__u8 out_mac_buf[SEC_MAX_MAC_LEN];
};

/* SEC request of Crypto */
struct sec_req {
	union {
		struct sec_sqe sec_sqe;
		struct sec_sqe3 sec_sqe3;
	};
	struct sec_ctx *ctx;
	struct sec_qp_ctx *qp_ctx;

	/**
	 * Common parameter of the SEC request.
	 */
	struct hisi_acc_hw_sgl *in;
	dma_addr_t in_dma;
	struct sec_cipher_req c_req;
	struct sec_aead_req aead_req;
	struct crypto_async_request *base;

	int err_type;
	int req_id;
	u32 flag;

Annotation

Implementation Notes