drivers/crypto/inside-secure/safexcel.c
Source file repositories/reference/linux-study-clean/drivers/crypto/inside-secure/safexcel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/inside-secure/safexcel.c- Extension
.c- Size
- 61085 bytes
- Lines
- 2047
- Domain
- Driver Families
- Bucket
- drivers/crypto
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/clk.hlinux/device.hlinux/dma-mapping.hlinux/dmapool.hlinux/firmware.hlinux/interrupt.hlinux/module.hlinux/of_platform.hlinux/of_irq.hlinux/pci.hlinux/platform_device.hlinux/workqueue.hcrypto/internal/aead.hcrypto/internal/hash.hcrypto/internal/skcipher.hsafexcel.h
Detected Declarations
struct safexcel_ring_irq_datafunction eip197_trc_cache_setupvirtfunction eip197_trc_cache_bankselfunction eip197_trc_cache_probefunction eip197_trc_cache_clearfunction eip197_trc_cache_initfunction eip197_init_firmwarefunction eip197_write_firmwarefunction poll_fw_readyfunction eip197_start_firmwarefunction eip197_load_firmwaresfunction safexcel_hw_setup_cdesc_ringsfunction safexcel_hw_setup_rdesc_ringsfunction safexcel_hw_initfunction safexcel_try_push_requestsfunction safexcel_dequeuefunction safexcel_rdesc_check_errorsfunction safexcel_rdr_req_setfunction safexcel_rdr_req_getfunction safexcel_completefunction safexcel_invalidate_cachefunction safexcel_handle_result_descriptorfunction safexcel_dequeue_workfunction safexcel_irq_ringfunction safexcel_irq_ring_threadfunction safexcel_request_ring_irqfunction safexcel_register_algorithmsfunction safexcel_unregister_algorithmsfunction safexcel_configurefunction safexcel_init_register_offsetsfunction safexcel_probe_genericfunction safexcel_hw_reset_ringsfunction safexcel_probefunction safexcel_removefunction safexcel_pci_probefunction safexcel_pci_removefunction safexcel_initfunction safexcel_exitmodule init safexcel_init
Annotated Snippet
static struct pci_driver safexcel_pci_driver = {
.name = "crypto-safexcel",
.id_table = safexcel_pci_ids,
.probe = safexcel_pci_probe,
.remove = safexcel_pci_remove,
};
static int __init safexcel_init(void)
{
int ret;
/* Register PCI driver */
ret = pci_register_driver(&safexcel_pci_driver);
/* Register platform driver */
if (IS_ENABLED(CONFIG_OF) && !ret) {
ret = platform_driver_register(&crypto_safexcel);
if (ret)
pci_unregister_driver(&safexcel_pci_driver);
}
return ret;
}
static void __exit safexcel_exit(void)
{
/* Unregister platform driver */
if (IS_ENABLED(CONFIG_OF))
platform_driver_unregister(&crypto_safexcel);
/* Unregister PCI driver if successfully registered before */
pci_unregister_driver(&safexcel_pci_driver);
}
module_init(safexcel_init);
module_exit(safexcel_exit);
MODULE_AUTHOR("Antoine Tenart <antoine.tenart@free-electrons.com>");
MODULE_AUTHOR("Ofer Heifetz <oferh@marvell.com>");
MODULE_AUTHOR("Igal Liberman <igall@marvell.com>");
MODULE_DESCRIPTION("Support for SafeXcel cryptographic engines: EIP97 & EIP197");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS("CRYPTO_INTERNAL");
MODULE_FIRMWARE("ifpp.bin");
MODULE_FIRMWARE("ipue.bin");
MODULE_FIRMWARE("inside-secure/eip197b/ifpp.bin");
MODULE_FIRMWARE("inside-secure/eip197b/ipue.bin");
MODULE_FIRMWARE("inside-secure/eip197d/ifpp.bin");
MODULE_FIRMWARE("inside-secure/eip197d/ipue.bin");
MODULE_FIRMWARE("inside-secure/eip197_minifw/ifpp.bin");
MODULE_FIRMWARE("inside-secure/eip197_minifw/ipue.bin");
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/dmapool.h`, `linux/firmware.h`, `linux/interrupt.h`, `linux/module.h`, `linux/of_platform.h`.
- Detected declarations: `struct safexcel_ring_irq_data`, `function eip197_trc_cache_setupvirt`, `function eip197_trc_cache_banksel`, `function eip197_trc_cache_probe`, `function eip197_trc_cache_clear`, `function eip197_trc_cache_init`, `function eip197_init_firmware`, `function eip197_write_firmware`, `function poll_fw_ready`, `function eip197_start_firmware`.
- Atlas domain: Driver Families / drivers/crypto.
- Implementation status: pattern 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.