drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.h

Source file repositories/reference/linux-study-clean/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.h
Extension
.h
Size
3752 bytes
Lines
184
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 otx2_cpt_cipher {
	const char *name;
	u8 value;
};

struct otx2_cpt_fc_enc_ctx {
	union otx2_cpt_encr_ctrl enc_ctrl;
	u8 encr_key[32];
	u8 encr_iv[16];
};

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

struct otx2_cpt_fc_ctx {
	struct otx2_cpt_fc_enc_ctx enc;
	union otx2_cpt_fc_hmac_ctx hmac;
};

struct otx2_cpt_enc_ctx {
	u32 key_len;
	u8 enc_key[OTX2_CPT_MAX_KEY_SIZE];
	u8 cipher_type;
	u8 key_type;
	u8 enc_align_len;
	struct crypto_skcipher *fbk_cipher;
	struct pci_dev *pdev;
	struct cn10k_cpt_errata_ctx er_ctx;
};

union otx2_cpt_offset_ctrl {
	u64 flags;
	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 otx2_cpt_req_ctx {
	struct otx2_cpt_req_info cpt_req;
	union otx2_cpt_offset_ctrl ctrl_word;
	struct otx2_cpt_fc_ctx fctx;
	union {
		struct skcipher_request sk_fbk_req;
		struct aead_request fbk_req;
	};
};

struct otx2_cpt_sdesc {
	struct shash_desc shash;
};

struct otx2_cpt_aead_ctx {
	u8 key[OTX2_CPT_MAX_KEY_SIZE];
	struct crypto_shash *hashalg;
	struct otx2_cpt_sdesc *sdesc;
	struct crypto_aead *fbk_cipher;
	struct cn10k_cpt_errata_ctx er_ctx;
	struct pci_dev *pdev;
	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;
	u8 enc_align_len;
};
int otx2_cpt_crypto_init(struct pci_dev *pdev, struct module *mod,
			 int num_queues, int num_devices);
void otx2_cpt_crypto_exit(struct pci_dev *pdev, struct module *mod);

Annotation

Implementation Notes