drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h

Source file repositories/reference/linux-study-clean/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h
Extension
.h
Size
9121 bytes
Lines
321
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 ss_clock {
	const char *name;
	unsigned long freq;
	unsigned long max_freq;
};

/*
 * struct ss_variant - Describe SS capability for each variant hardware
 * @alg_cipher:	list of supported ciphers. for each SS_ID_ this will give the
 *              coresponding SS_ALG_XXX value
 * @alg_hash:	list of supported hashes. for each SS_ID_ this will give the
 *              corresponding SS_ALG_XXX value
 * @op_mode:	list of supported block modes
 * @ss_clks:	list of clock needed by this variant
 */
struct ss_variant {
	char alg_cipher[SS_ID_CIPHER_MAX];
	char alg_hash[SS_ID_HASH_MAX];
	u32 op_mode[SS_ID_OP_MAX];
	struct ss_clock ss_clks[SS_MAX_CLOCKS];
};

struct sginfo {
	u32 addr;
	u32 len;
};

/*
 * struct sun8i_ss_flow - Information used by each flow
 * @engine:	ptr to the crypto_engine for this flow
 * @complete:	completion for the current task on this flow
 * @status:	set to 1 by interrupt if task is done
 * @stat_req:	number of request done by this flow
 * @iv:		list of IV to use for each step
 * @biv:	buffer which contain the backuped IV
 * @pad:	padding buffer for hash operations
 * @result:	buffer for storing the result of hash operations
 */
struct sun8i_ss_flow {
	struct crypto_engine *engine;
	struct completion complete;
	int status;
	u8 *iv[MAX_SG];
	u8 *biv;
	void *pad;
	void *result;
#ifdef CONFIG_CRYPTO_DEV_SUN8I_SS_DEBUG
	unsigned long stat_req;
#endif
};

/*
 * struct sun8i_ss_dev - main container for all this driver information
 * @base:	base address of SS
 * @ssclks:	clocks used by SS
 * @reset:	pointer to reset controller
 * @dev:	the platform device
 * @mlock:	Control access to device registers
 * @flows:	array of all flow
 * @flow:	flow to use in next request
 * @variant:	pointer to variant specific data
 * @dbgfs_dir:	Debugfs dentry for statistic directory
 * @dbgfs_stats: Debugfs dentry for statistic counters
 */
struct sun8i_ss_dev {
	void __iomem *base;
	struct clk *ssclks[SS_MAX_CLOCKS];
	struct reset_control *reset;
	struct device *dev;
	struct mutex mlock;
	struct sun8i_ss_flow *flows;
	atomic_t flow;
	const struct ss_variant *variant;
#ifdef CONFIG_CRYPTO_DEV_SUN8I_SS_DEBUG
	struct dentry *dbgfs_dir;
	struct dentry *dbgfs_stats;
#endif
};

/*
 * struct sun8i_cipher_req_ctx - context for a skcipher request
 * @t_src:		list of mapped SGs with their size
 * @t_dst:		list of mapped SGs with their size
 * @p_key:		DMA address of the key
 * @p_iv:		DMA address of the IVs
 * @niv:		Number of IVs DMA mapped
 * @method:		current algorithm for this request
 * @op_mode:		op_mode for this request
 * @op_dir:		direction (encrypt vs decrypt) for this request
 * @flow:		the flow to use for this request

Annotation

Implementation Notes