drivers/crypto/ti/dthev2-common.h

Source file repositories/reference/linux-study-clean/drivers/crypto/ti/dthev2-common.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/ti/dthev2-common.h
Extension
.h
Size
3335 bytes
Lines
135
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 dthe_data {
	struct device *dev;
	void __iomem *regs;
	struct list_head list;
	struct crypto_engine *engine;

	struct dma_chan *dma_aes_rx;
	struct dma_chan *dma_aes_tx;

	struct dma_chan *dma_sha_tx;
};

/**
 * struct dthe_list - device data list head
 * @dev_list: linked list head
 * @lock: Spinlock protecting accesses to the list
 */
struct dthe_list {
	struct list_head dev_list;
	spinlock_t lock;
};

/**
 * struct dthe_tfm_ctx - Transform ctx struct containing ctx for all sub-components of DTHE V2
 * @dev_data: Device data struct pointer
 * @keylen: AES key length
 * @authsize: Authentication size for modes with authentication
 * @key: AES key
 * @aes_mode: AES mode
 * @aead_fb: Fallback crypto aead handle
 * @skcipher_fb: Fallback crypto skcipher handle for AES-XTS mode
 */
struct dthe_tfm_ctx {
	struct dthe_data *dev_data;
	unsigned int keylen;
	unsigned int authsize;
	u32 key[DTHE_MAX_KEYSIZE / sizeof(u32)];
	enum dthe_aes_mode aes_mode;
	union {
		struct crypto_sync_aead *aead_fb;
		struct crypto_sync_skcipher *skcipher_fb;
	};
};

/**
 * struct dthe_aes_req_ctx - AES engine req ctx struct
 * @enc: flag indicating encryption or decryption operation
 * @padding: padding buffer for handling unaligned data
 * @aes_compl: Completion variable for use in manual completion in case of DMA callback failure
 */
struct dthe_aes_req_ctx {
	int enc;
	u8 padding[2 * AES_BLOCK_SIZE];
	struct completion aes_compl;
};

/* Struct definitions end */

struct dthe_data *dthe_get_dev(struct dthe_tfm_ctx *ctx);

/**
 * dthe_copy_sg - Copy sg entries from src to dst
 * @dst: Destination sg to be filled
 * @src: Source sg to be copied from
 * @buflen: Number of bytes to be copied
 *
 * Description:
 *   Copy buflen bytes of data from src to dst.
 *
 **/
struct scatterlist *dthe_copy_sg(struct scatterlist *dst,
				 struct scatterlist *src,
				 int buflen);

int dthe_register_aes_algs(void);
void dthe_unregister_aes_algs(void);

#endif

Annotation

Implementation Notes