drivers/crypto/omap-des.c
Source file repositories/reference/linux-study-clean/drivers/crypto/omap-des.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/omap-des.c- Extension
.c- Size
- 26659 bytes
- Lines
- 1129
- 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
crypto/engine.hcrypto/internal/des.hcrypto/internal/skcipher.hlinux/dma-mapping.hlinux/dmaengine.hlinux/err.hlinux/init.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/scatterlist.hlinux/string.hlinux/workqueue.homap-crypto.h
Detected Declarations
struct omap_des_ctxstruct omap_des_reqctxstruct omap_des_algs_infostruct omap_des_pdatastruct omap_des_devfunction omap_des_readfunction omap_des_writefunction omap_des_write_maskfunction omap_des_write_nfunction omap_des_hw_initfunction omap_des_write_ctrlfunction omap_des_dma_trigger_omap4function omap_des_dma_stopfunction list_for_each_entryfunction omap_des_dma_out_callbackfunction omap_des_dma_initfunction omap_des_dma_cleanupfunction omap_des_crypt_dmafunction omap_des_crypt_dma_startfunction omap_des_finish_reqfunction omap_des_crypt_dma_stopfunction omap_des_handle_queuefunction omap_des_prepare_reqfunction omap_des_crypt_reqfunction omap_des_done_taskfunction omap_des_cryptfunction omap_des_setkeyfunction omap_des3_setkeyfunction omap_des_ecb_encryptfunction omap_des_ecb_decryptfunction omap_des_cbc_encryptfunction omap_des_cbc_decryptfunction omap_des_init_tfmfunction omap_des_irqfunction omap_des_get_offunction omap_des_get_offunction omap_des_get_pdevfunction omap_des_unregister_algsfunction omap_des_probefunction omap_des_removefunction omap_des_suspendfunction omap_des_resume
Annotated Snippet
struct omap_des_ctx {
struct omap_des_dev *dd;
int keylen;
__le32 key[(3 * DES_KEY_SIZE) / sizeof(u32)];
unsigned long flags;
};
struct omap_des_reqctx {
unsigned long mode;
};
#define OMAP_DES_QUEUE_LENGTH 1
#define OMAP_DES_CACHE_SIZE 0
struct omap_des_algs_info {
struct skcipher_engine_alg *algs_list;
unsigned int size;
unsigned int registered;
};
struct omap_des_pdata {
struct omap_des_algs_info *algs_info;
unsigned int algs_info_size;
void (*trigger)(struct omap_des_dev *dd, int length);
u32 key_ofs;
u32 iv_ofs;
u32 ctrl_ofs;
u32 data_ofs;
u32 rev_ofs;
u32 mask_ofs;
u32 irq_enable_ofs;
u32 irq_status_ofs;
u32 dma_enable_in;
u32 dma_enable_out;
u32 dma_start;
u32 major_mask;
u32 major_shift;
u32 minor_mask;
u32 minor_shift;
};
struct omap_des_dev {
struct list_head list;
unsigned long phys_base;
void __iomem *io_base;
struct omap_des_ctx *ctx;
struct device *dev;
unsigned long flags;
int err;
struct work_struct done_task;
struct skcipher_request *req;
struct crypto_engine *engine;
/*
* total is used by PIO mode for book keeping so introduce
* variable total_save as need it to calc page_order
*/
size_t total;
size_t total_save;
struct scatterlist *in_sg;
struct scatterlist *out_sg;
/* Buffers for copying for unaligned cases */
struct scatterlist in_sgl;
struct scatterlist out_sgl;
struct scatterlist *orig_out;
unsigned int in_sg_offset;
unsigned int out_sg_offset;
struct dma_chan *dma_lch_in;
struct dma_chan *dma_lch_out;
int in_sg_len;
int out_sg_len;
int pio_only;
const struct omap_des_pdata *pdata;
};
/* keep registered devices data here */
static LIST_HEAD(dev_list);
static DEFINE_SPINLOCK(list_lock);
#ifdef DEBUG
#define omap_des_read(dd, offset) \
Annotation
- Immediate include surface: `crypto/engine.h`, `crypto/internal/des.h`, `crypto/internal/skcipher.h`, `linux/dma-mapping.h`, `linux/dmaengine.h`, `linux/err.h`, `linux/init.h`, `linux/interrupt.h`.
- Detected declarations: `struct omap_des_ctx`, `struct omap_des_reqctx`, `struct omap_des_algs_info`, `struct omap_des_pdata`, `struct omap_des_dev`, `function omap_des_read`, `function omap_des_write`, `function omap_des_write_mask`, `function omap_des_write_n`, `function omap_des_hw_init`.
- 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.