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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
crypto/aes.hcrypto/des.hcrypto/engine.hcrypto/rng.hcrypto/skcipher.hlinux/atomic.hlinux/debugfs.hlinux/crypto.hcrypto/internal/hash.hcrypto/md5.hcrypto/sha1.hcrypto/sha2.h
Detected Declarations
struct ss_clockstruct ss_variantstruct sginfostruct sun8i_ss_flowstruct sun8i_ss_devstruct sun8i_cipher_req_ctxstruct sun8i_cipher_tfm_ctxstruct sun8i_ss_rng_tfm_ctxstruct sun8i_ss_hash_tfm_ctxstruct sun8i_ss_hash_reqctxstruct sun8i_ss_alg_template
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
- Immediate include surface: `crypto/aes.h`, `crypto/des.h`, `crypto/engine.h`, `crypto/rng.h`, `crypto/skcipher.h`, `linux/atomic.h`, `linux/debugfs.h`, `linux/crypto.h`.
- Detected declarations: `struct ss_clock`, `struct ss_variant`, `struct sginfo`, `struct sun8i_ss_flow`, `struct sun8i_ss_dev`, `struct sun8i_cipher_req_ctx`, `struct sun8i_cipher_tfm_ctx`, `struct sun8i_ss_rng_tfm_ctx`, `struct sun8i_ss_hash_tfm_ctx`, `struct sun8i_ss_hash_reqctx`.
- Atlas domain: Driver Families / drivers/crypto.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.