drivers/crypto/atmel-aes.c
Source file repositories/reference/linux-study-clean/drivers/crypto/atmel-aes.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/atmel-aes.c- Extension
.c- Size
- 62551 bytes
- Lines
- 2467
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/slab.hlinux/err.hlinux/clk.hlinux/io.hlinux/hw_random.hlinux/platform_device.hlinux/device.hlinux/dmaengine.hlinux/init.hlinux/errno.hlinux/interrupt.hlinux/irq.hlinux/scatterlist.hlinux/dma-mapping.hlinux/mod_devicetable.hlinux/delay.hlinux/crypto.hcrypto/scatterwalk.hcrypto/algapi.hcrypto/aes.hcrypto/gcm.hcrypto/xts.hcrypto/internal/aead.hcrypto/internal/skcipher.hatmel-aes-regs.hatmel-authenc.h
Detected Declarations
struct atmel_aes_capsstruct atmel_aes_devstruct atmel_aes_base_ctxstruct atmel_aes_ctxstruct atmel_aes_ctr_ctxstruct atmel_aes_gcm_ctxstruct atmel_aes_xts_ctxstruct atmel_aes_authenc_ctxstruct atmel_aes_reqctxstruct atmel_aes_authenc_reqctxstruct atmel_aes_dmastruct atmel_aes_devstruct atmel_aes_drvfunction atmel_aes_readfunction atmel_aes_writefunction atmel_aes_read_nfunction atmel_aes_write_nfunction atmel_aes_read_blockfunction atmel_aes_write_blockfunction atmel_aes_wait_for_data_readyfunction atmel_aes_padlenfunction atmel_aes_hw_initfunction atmel_aes_get_versionfunction atmel_aes_hw_version_initfunction atmel_aes_set_modefunction atmel_aes_is_encryptfunction atmel_aes_set_iv_as_last_ciphertext_blockfunction atmel_aes_ctr_ctx_castfunction atmel_aes_ctr_update_req_ivfunction atmel_aes_completefunction atmel_aes_write_ctrl_keyfunction atmel_aes_write_ctrlfunction atmel_aes_cpu_transferfunction atmel_aes_cpu_startfunction atmel_aes_check_alignedfunction atmel_aes_restore_sgfunction atmel_aes_mapfunction atmel_aes_unmapfunction atmel_aes_dma_transfer_startfunction atmel_aes_dma_startfunction atmel_aes_dma_callbackfunction atmel_aes_handle_queuefunction atmel_aes_transfer_completefunction atmel_aes_startfunction atmel_aes_ctr_transferfunction atmel_aes_ctr_startfunction atmel_aes_xts_fallbackfunction atmel_aes_crypt
Annotated Snippet
struct atmel_aes_caps {
bool has_dualbuff;
bool has_gcm;
bool has_xts;
bool has_authenc;
u32 max_burst_size;
};
struct atmel_aes_dev;
typedef int (*atmel_aes_fn_t)(struct atmel_aes_dev *);
struct atmel_aes_base_ctx {
struct atmel_aes_dev *dd;
atmel_aes_fn_t start;
int keylen;
u32 key[AES_KEYSIZE_256 / sizeof(u32)];
u16 block_size;
bool is_aead;
};
struct atmel_aes_ctx {
struct atmel_aes_base_ctx base;
};
struct atmel_aes_ctr_ctx {
struct atmel_aes_base_ctx base;
__be32 iv[AES_BLOCK_SIZE / sizeof(u32)];
size_t offset;
struct scatterlist src[2];
struct scatterlist dst[2];
u32 blocks;
};
struct atmel_aes_gcm_ctx {
struct atmel_aes_base_ctx base;
struct scatterlist src[2];
struct scatterlist dst[2];
__be32 j0[AES_BLOCK_SIZE / sizeof(u32)];
u32 tag[AES_BLOCK_SIZE / sizeof(u32)];
__be32 ghash[AES_BLOCK_SIZE / sizeof(u32)];
size_t textlen;
const __be32 *ghash_in;
__be32 *ghash_out;
atmel_aes_fn_t ghash_resume;
};
struct atmel_aes_xts_ctx {
struct atmel_aes_base_ctx base;
u32 key2[AES_KEYSIZE_256 / sizeof(u32)];
struct crypto_skcipher *fallback_tfm;
};
#if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC)
struct atmel_aes_authenc_ctx {
struct atmel_aes_base_ctx base;
struct atmel_sha_authenc_ctx *auth;
};
#endif
struct atmel_aes_reqctx {
unsigned long mode;
u8 lastc[AES_BLOCK_SIZE];
struct skcipher_request fallback_req;
};
#if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC)
struct atmel_aes_authenc_reqctx {
struct atmel_aes_reqctx base;
struct scatterlist src[2];
struct scatterlist dst[2];
size_t textlen;
u32 digest[SHA512_DIGEST_SIZE / sizeof(u32)];
/* auth_req MUST be place last. */
struct ahash_request auth_req;
};
#endif
struct atmel_aes_dma {
struct dma_chan *chan;
struct scatterlist *sg;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/err.h`, `linux/clk.h`, `linux/io.h`, `linux/hw_random.h`, `linux/platform_device.h`.
- Detected declarations: `struct atmel_aes_caps`, `struct atmel_aes_dev`, `struct atmel_aes_base_ctx`, `struct atmel_aes_ctx`, `struct atmel_aes_ctr_ctx`, `struct atmel_aes_gcm_ctx`, `struct atmel_aes_xts_ctx`, `struct atmel_aes_authenc_ctx`, `struct atmel_aes_reqctx`, `struct atmel_aes_authenc_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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.