drivers/crypto/marvell/octeontx2/otx2_cptlf.h
Source file repositories/reference/linux-study-clean/drivers/crypto/marvell/octeontx2/otx2_cptlf.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/marvell/octeontx2/otx2_cptlf.h- Extension
.h- Size
- 13260 bytes
- Lines
- 449
- 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/soc/marvell/octeontx2/asm.hlinux/bitfield.hmbox.hrvu.hotx2_cpt_common.hotx2_cpt_reqmgr.h
Detected Declarations
struct otx2_cpt_inst_queuestruct otx2_cptlfs_infostruct otx2_cptlf_wqestruct otx2_cptlf_infostruct cpt_hw_opsstruct otx2_lmt_infostruct otx2_cptlfs_infoenum otx2_cptlf_statefunction otx2_cpt_free_instruction_queuesfunction otx2_cpt_alloc_instruction_queuesfunction otx2_cptlf_set_iqueues_base_addrfunction otx2_cptlf_do_set_iqueue_sizefunction otx2_cptlf_set_iqueues_sizefunction otx2_cptlf_do_disable_iqueuefunction otx2_cptlf_disable_iqueuesfunction otx2_cptlf_set_iqueue_enqfunction otx2_cptlf_enable_iqueue_enqfunction otx2_cptlf_set_iqueue_execfunction otx2_cptlf_set_ctx_flr_flushfunction otx2_cptlf_enable_iqueue_execfunction otx2_cptlf_disable_iqueue_execfunction otx2_cptlf_enable_iqueuesfunction otx2_cpt_fill_instfunction otx2_cpt_send_cmdfunction otx2_cptlf_startedfunction otx2_cptlf_set_dev_info
Annotated Snippet
struct otx2_cpt_inst_queue {
u8 *vaddr;
u8 *real_vaddr;
dma_addr_t dma_addr;
dma_addr_t real_dma_addr;
u32 size;
};
struct otx2_cptlfs_info;
struct otx2_cptlf_wqe {
struct tasklet_struct work;
struct otx2_cptlfs_info *lfs;
u8 lf_num;
};
struct otx2_cptlf_info {
struct otx2_cptlfs_info *lfs; /* Ptr to cptlfs_info struct */
void __iomem *lmtline; /* Address of LMTLINE */
void __iomem *ioreg; /* LMTLINE send register */
int msix_offset; /* MSI-X interrupts offset */
cpumask_var_t affinity_mask; /* IRQs affinity mask */
u8 irq_name[OTX2_CPT_LF_MSIX_VECTORS][32];/* Interrupts name */
u8 is_irq_reg[OTX2_CPT_LF_MSIX_VECTORS]; /* Is interrupt registered */
u8 slot; /* Slot number of this LF */
struct otx2_cpt_inst_queue iqueue;/* Instruction queue */
struct otx2_cpt_pending_queue pqueue; /* Pending queue */
struct otx2_cptlf_wqe *wqe; /* Tasklet work info */
};
struct cpt_hw_ops {
void (*send_cmd)(union otx2_cpt_inst_s *cptinst, u32 insts_num,
struct otx2_cptlf_info *lf);
u8 (*cpt_get_compcode)(union otx2_cpt_res_s *result);
u8 (*cpt_get_uc_compcode)(union otx2_cpt_res_s *result);
struct otx2_cpt_inst_info *
(*cpt_sg_info_create)(struct pci_dev *pdev, struct otx2_cpt_req_info *req,
gfp_t gfp);
};
#define LMTLINE_SIZE 128
#define LMTLINE_ALIGN 128
struct otx2_lmt_info {
void *base;
dma_addr_t iova;
u32 size;
u8 align;
};
struct otx2_cptlfs_info {
/* Registers start address of VF/PF LFs are attached to */
void __iomem *reg_base;
struct otx2_lmt_info lmt_info;
struct pci_dev *pdev; /* Device LFs are attached to */
struct otx2_cptlf_info lf[OTX2_CPT_MAX_LFS_NUM];
struct otx2_mbox *mbox;
struct cpt_hw_ops *ops;
u8 are_lfs_attached; /* Whether CPT LFs are attached */
u8 lfs_num; /* Number of CPT LFs */
u8 kcrypto_se_eng_grp_num; /* Crypto symmetric engine group number */
u8 kcrypto_ae_eng_grp_num; /* Crypto asymmetric engine group number */
u8 kvf_limits; /* Kernel crypto limits */
atomic_t state; /* LF's state. started/reset */
int blkaddr; /* CPT blkaddr: BLKADDR_CPT0/BLKADDR_CPT1 */
int global_slot; /* Global slot across the blocks */
u8 ctx_ilen;
u8 ctx_ilen_ovrd;
};
static inline void otx2_cpt_free_instruction_queues(
struct otx2_cptlfs_info *lfs)
{
struct otx2_cpt_inst_queue *iq;
int i;
for (i = 0; i < lfs->lfs_num; i++) {
iq = &lfs->lf[i].iqueue;
if (iq->real_vaddr)
dma_free_coherent(&lfs->pdev->dev,
iq->size,
iq->real_vaddr,
iq->real_dma_addr);
iq->real_vaddr = NULL;
iq->vaddr = NULL;
}
}
static inline int otx2_cpt_alloc_instruction_queues(
struct otx2_cptlfs_info *lfs)
{
Annotation
- Immediate include surface: `linux/soc/marvell/octeontx2/asm.h`, `linux/bitfield.h`, `mbox.h`, `rvu.h`, `otx2_cpt_common.h`, `otx2_cpt_reqmgr.h`.
- Detected declarations: `struct otx2_cpt_inst_queue`, `struct otx2_cptlfs_info`, `struct otx2_cptlf_wqe`, `struct otx2_cptlf_info`, `struct cpt_hw_ops`, `struct otx2_lmt_info`, `struct otx2_cptlfs_info`, `enum otx2_cptlf_state`, `function otx2_cpt_free_instruction_queues`, `function otx2_cpt_alloc_instruction_queues`.
- 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.