drivers/crypto/hisilicon/sec2/sec.h
Source file repositories/reference/linux-study-clean/drivers/crypto/hisilicon/sec2/sec.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/hisilicon/sec2/sec.h- Extension
.h- Size
- 6170 bytes
- Lines
- 290
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hisi_acc_qm.hsec_crypto.h
Detected Declarations
struct sec_alg_resstruct sec_hw_sgestruct sec_hw_sglstruct sec_src_dst_bufstruct sec_request_bufstruct sec_cipher_reqstruct sec_aead_reqstruct sec_reqstruct sec_req_opstruct sec_auth_ctxstruct sec_cipher_ctxstruct sec_qp_ctxstruct sec_ctxstruct sec_debug_filestruct sec_dfxstruct sec_debugstruct sec_devenum sec_alg_typeenum sec_debug_file_indexenum sec_cap_typeenum sec_cap_table_type
Annotated Snippet
struct sec_alg_res {
u8 *pbuf;
dma_addr_t pbuf_dma;
u8 *c_ivin;
dma_addr_t c_ivin_dma;
u8 *a_ivin;
dma_addr_t a_ivin_dma;
u8 *out_mac;
dma_addr_t out_mac_dma;
u16 depth;
};
struct sec_hw_sge {
dma_addr_t buf;
void *page_ctrl;
__le32 len;
__le32 pad;
__le32 pad0;
__le32 pad1;
};
struct sec_hw_sgl {
dma_addr_t next_dma;
__le16 entry_sum_in_chain;
__le16 entry_sum_in_sgl;
__le16 entry_length_in_sgl;
__le16 pad0;
__le64 pad1[5];
struct sec_hw_sgl *next;
struct sec_hw_sge sge_entries[SEC_SGE_NR_NUM];
} __aligned(SEC_SGL_ALIGN_SIZE);
struct sec_src_dst_buf {
struct sec_hw_sgl in;
struct sec_hw_sgl out;
};
struct sec_request_buf {
union {
struct sec_src_dst_buf data_buf;
__u8 pbuf[SEC_PBUF_SZ];
};
dma_addr_t in_dma;
dma_addr_t out_dma;
};
/* Cipher request of SEC private */
struct sec_cipher_req {
struct hisi_acc_hw_sgl *c_out;
dma_addr_t c_out_dma;
u8 *c_ivin;
dma_addr_t c_ivin_dma;
struct skcipher_request *sk_req;
u32 c_len;
bool encrypt;
__u8 c_ivin_buf[SEC_IV_SIZE];
};
struct sec_aead_req {
u8 *out_mac;
dma_addr_t out_mac_dma;
u8 *a_ivin;
dma_addr_t a_ivin_dma;
struct aead_request *aead_req;
__u8 a_ivin_buf[SEC_IV_SIZE];
__u8 out_mac_buf[SEC_MAX_MAC_LEN];
};
/* SEC request of Crypto */
struct sec_req {
union {
struct sec_sqe sec_sqe;
struct sec_sqe3 sec_sqe3;
};
struct sec_ctx *ctx;
struct sec_qp_ctx *qp_ctx;
/**
* Common parameter of the SEC request.
*/
struct hisi_acc_hw_sgl *in;
dma_addr_t in_dma;
struct sec_cipher_req c_req;
struct sec_aead_req aead_req;
struct crypto_async_request *base;
int err_type;
int req_id;
u32 flag;
Annotation
- Immediate include surface: `linux/hisi_acc_qm.h`, `sec_crypto.h`.
- Detected declarations: `struct sec_alg_res`, `struct sec_hw_sge`, `struct sec_hw_sgl`, `struct sec_src_dst_buf`, `struct sec_request_buf`, `struct sec_cipher_req`, `struct sec_aead_req`, `struct sec_req`, `struct sec_req_op`, `struct sec_auth_ctx`.
- 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.
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.