drivers/crypto/marvell/octeontx/otx_cptvf_algs.h

Source file repositories/reference/linux-study-clean/drivers/crypto/marvell/octeontx/otx_cptvf_algs.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/marvell/octeontx/otx_cptvf_algs.h
Extension
.h
Size
3825 bytes
Lines
190
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 otx_cpt_cipher {
	const char *name;
	u8 value;
};

struct otx_cpt_enc_context {
	union otx_cpt_encr_ctrl enc_ctrl;
	u8 encr_key[32];
	u8 encr_iv[16];
};

union otx_cpt_fchmac_ctx {
	struct {
		u8 ipad[64];
		u8 opad[64];
	} e;
	struct {
		u8 hmac_calc[64]; /* HMAC calculated */
		u8 hmac_recv[64]; /* HMAC received */
	} s;
};

struct otx_cpt_fc_ctx {
	struct otx_cpt_enc_context enc;
	union otx_cpt_fchmac_ctx hmac;
};

struct otx_cpt_enc_ctx {
	u32 key_len;
	u8 enc_key[OTX_CPT_MAX_KEY_SIZE];
	u8 cipher_type;
	u8 key_type;
};

struct otx_cpt_des3_ctx {
	u32 key_len;
	u8 des3_key[OTX_CPT_MAX_KEY_SIZE];
};

union otx_cpt_offset_ctrl_word {
	__be64 flags;
	u64 cflags;
	struct {
#if defined(__BIG_ENDIAN_BITFIELD)
		u64 reserved:32;
		u64 enc_data_offset:16;
		u64 iv_offset:8;
		u64 auth_offset:8;
#else
		u64 auth_offset:8;
		u64 iv_offset:8;
		u64 enc_data_offset:16;
		u64 reserved:32;
#endif
	} e;
};

struct otx_cpt_req_ctx {
	struct otx_cpt_req_info cpt_req;
	union otx_cpt_offset_ctrl_word ctrl_word;
	struct otx_cpt_fc_ctx fctx;
};

struct otx_cpt_sdesc {
	struct shash_desc shash;
};

struct otx_cpt_aead_ctx {
	u8 key[OTX_CPT_MAX_KEY_SIZE];
	struct crypto_shash *hashalg;
	struct otx_cpt_sdesc *sdesc;
	u8 *ipad;
	u8 *opad;
	u32 enc_key_len;
	u32 auth_key_len;
	u8 cipher_type;
	u8 mac_type;
	u8 key_type;
	u8 is_trunc_hmac;
};
int otx_cpt_crypto_init(struct pci_dev *pdev, struct module *mod,
			enum otx_cptpf_type pf_type,
			enum otx_cptvf_type engine_type,
			int num_queues, int num_devices);
void otx_cpt_crypto_exit(struct pci_dev *pdev, struct module *mod,
			 enum otx_cptvf_type engine_type);

#endif /* __OTX_CPT_ALGS_H */

Annotation

Implementation Notes