drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c- Extension
.c- Size
- 41062 bytes
- Lines
- 1609
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/dma-mapping.hlinux/dmapool.hlinux/crypto.hlinux/kernel.hlinux/rtnetlink.hlinux/interrupt.hlinux/spinlock.hlinux/gfp.hlinux/module.hlinux/of.hcrypto/ctr.hcrypto/internal/des.hcrypto/aes.hcrypto/hmac.hcrypto/sha1.hcrypto/algapi.hcrypto/internal/aead.hcrypto/internal/skcipher.hcrypto/authenc.hcrypto/scatterwalk.hlinux/soc/ixp4xx/npe.hlinux/soc/ixp4xx/qmgr.hlinux/soc/ixp4xx/cpu.h
Detected Declarations
struct buffer_descstruct crypt_ctlstruct ablk_ctxstruct aead_ctxstruct ix_hash_algostruct ix_sa_dirstruct ixp_ctxstruct ixp_algstruct ixp_aead_algfunction crypt_virt2physfunction cipher_cfg_encfunction cipher_cfg_decfunction setup_crypt_descfunction free_buf_chainfunction finish_scattered_hmacfunction one_packetfunction irqhandlerfunction crypto_done_actionfunction init_ixp_cryptofunction release_ixp_cryptofunction reset_sa_dirfunction init_sa_dirfunction free_sa_dirfunction init_tfmfunction init_tfm_ablkfunction init_tfm_aeadfunction exit_tfmfunction exit_tfm_ablkfunction exit_tfm_aeadfunction register_chain_varfunction setup_authfunction gen_rev_aes_keyfunction setup_cipherfunction ablk_setkeyfunction ablk_des3_setkeyfunction ablk_rfc3686_setkeyfunction ixp4xx_cipher_fallbackfunction ablk_performfunction ablk_encryptfunction ablk_decryptfunction ablk_rfc3686_cryptfunction aead_performfunction aead_setupfunction aead_setauthsizefunction aead_setkeyfunction des3_aead_setkeyfunction aead_encryptfunction aead_decrypt
Annotated Snippet
struct buffer_desc {
u32 phys_next;
#ifdef __ARMEB__
u16 buf_len;
u16 pkt_len;
#else
u16 pkt_len;
u16 buf_len;
#endif
dma_addr_t phys_addr;
u32 __reserved[4];
struct buffer_desc *next;
enum dma_data_direction dir;
};
struct crypt_ctl {
#ifdef __ARMEB__
u8 mode; /* NPE_OP_* operation mode */
u8 init_len;
u16 reserved;
#else
u16 reserved;
u8 init_len;
u8 mode; /* NPE_OP_* operation mode */
#endif
u8 iv[MAX_IVLEN]; /* IV for CBC mode or CTR IV for CTR mode */
u32 icv_rev_aes; /* icv or rev aes */
u32 src_buf;
u32 dst_buf;
#ifdef __ARMEB__
u16 auth_offs; /* Authentication start offset */
u16 auth_len; /* Authentication data length */
u16 crypt_offs; /* Cryption start offset */
u16 crypt_len; /* Cryption data length */
#else
u16 auth_len; /* Authentication data length */
u16 auth_offs; /* Authentication start offset */
u16 crypt_len; /* Cryption data length */
u16 crypt_offs; /* Cryption start offset */
#endif
u32 aadAddr; /* Additional Auth Data Addr for CCM mode */
u32 crypto_ctx; /* NPE Crypto Param structure address */
/* Used by Host: 4*4 bytes*/
unsigned int ctl_flags;
union {
struct skcipher_request *ablk_req;
struct aead_request *aead_req;
struct crypto_tfm *tfm;
} data;
struct buffer_desc *regist_buf;
u8 *regist_ptr;
};
struct ablk_ctx {
struct buffer_desc *src;
struct buffer_desc *dst;
u8 iv[MAX_IVLEN];
bool encrypt;
struct skcipher_request fallback_req; // keep at the end
};
struct aead_ctx {
struct buffer_desc *src;
struct buffer_desc *dst;
struct scatterlist ivlist;
/* used when the hmac is not on one sg entry */
u8 *hmac_virt;
int encrypt;
};
struct ix_hash_algo {
u32 cfgword;
unsigned char *icv;
};
struct ix_sa_dir {
unsigned char *npe_ctx;
dma_addr_t npe_ctx_phys;
int npe_ctx_idx;
u8 npe_mode;
};
struct ixp_ctx {
struct ix_sa_dir encrypt;
struct ix_sa_dir decrypt;
int authkey_len;
u8 authkey[MAX_KEYLEN];
int enckey_len;
u8 enckey[MAX_KEYLEN];
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/dmapool.h`, `linux/crypto.h`, `linux/kernel.h`, `linux/rtnetlink.h`, `linux/interrupt.h`, `linux/spinlock.h`.
- Detected declarations: `struct buffer_desc`, `struct crypt_ctl`, `struct ablk_ctx`, `struct aead_ctx`, `struct ix_hash_algo`, `struct ix_sa_dir`, `struct ixp_ctx`, `struct ixp_alg`, `struct ixp_aead_alg`, `function crypt_virt2phys`.
- 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.