drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.h- Extension
.h- Size
- 3023 bytes
- Lines
- 122
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
cxgb4.ht4_msg.ht4_tcb.hl2t.hchcr_common.hcxgb4_uld.hclip_tbl.h
Detected Declarations
struct chcr_ktls_infostruct chcr_ktls_ctx_txstruct chcr_ktls_uld_ctxenum ch_ktls_open_statefunction __chcr_get_ktls_tx_infofunction chcr_get_ktls_tx_infofunction chcr_set_ktls_tx_infofunction chcr_get_first_rx_qid
Annotated Snippet
struct chcr_ktls_info {
struct sock *sk;
spinlock_t lock; /* lock for pending_close */
struct ktls_key_ctx key_ctx;
struct adapter *adap;
struct l2t_entry *l2te;
struct net_device *netdev;
struct completion completion;
u64 iv;
u64 record_no;
int tid;
int atid;
int rx_qid;
u32 iv_size;
u32 prev_seq;
u32 prev_ack;
u32 salt_size;
u32 key_ctx_len;
u32 scmd0_seqno_numivs;
u32 scmd0_ivgen_hdrlen;
u32 tcp_start_seq_number;
u32 scmd0_short_seqno_numivs;
u32 scmd0_short_ivgen_hdrlen;
u16 prev_win;
u8 tx_chan;
u8 smt_idx;
u8 port_id;
u8 ip_family;
u8 first_qset;
enum ch_ktls_open_state open_state;
bool pending_close;
};
struct chcr_ktls_ctx_tx {
struct chcr_ktls_info *chcr_info;
};
struct chcr_ktls_uld_ctx {
struct list_head entry;
struct cxgb4_lld_info lldi;
struct xarray tid_list;
bool detach;
};
static inline struct chcr_ktls_info *
__chcr_get_ktls_tx_info(struct tls_offload_context_tx *octx)
{
struct chcr_ktls_ctx_tx *priv_ctx;
BUILD_BUG_ON(sizeof(struct chcr_ktls_ctx_tx) > TLS_DRIVER_STATE_SIZE_TX);
priv_ctx = (struct chcr_ktls_ctx_tx *)octx->driver_state;
return priv_ctx->chcr_info;
}
static inline struct chcr_ktls_info *
chcr_get_ktls_tx_info(struct tls_context *tls_ctx)
{
struct chcr_ktls_ctx_tx *priv_ctx;
BUILD_BUG_ON(sizeof(struct chcr_ktls_ctx_tx) > TLS_DRIVER_STATE_SIZE_TX);
priv_ctx = (struct chcr_ktls_ctx_tx *)__tls_driver_ctx(tls_ctx, TLS_OFFLOAD_CTX_DIR_TX);
return priv_ctx->chcr_info;
}
static inline void
chcr_set_ktls_tx_info(struct tls_context *tls_ctx, struct chcr_ktls_info *chcr_info)
{
struct chcr_ktls_ctx_tx *priv_ctx;
priv_ctx = __tls_driver_ctx(tls_ctx, TLS_OFFLOAD_CTX_DIR_TX);
priv_ctx->chcr_info = chcr_info;
}
static inline int chcr_get_first_rx_qid(struct adapter *adap)
{
/* u_ctx is saved in adap, fetch it */
struct chcr_ktls_uld_ctx *u_ctx = adap->uld[CXGB4_ULD_KTLS].handle;
if (!u_ctx)
return -1;
return u_ctx->lldi.rxq_ids[0];
}
typedef int (*chcr_handler_func)(struct adapter *adap, unsigned char *input);
#endif /* __CHCR_KTLS_H__ */
Annotation
- Immediate include surface: `cxgb4.h`, `t4_msg.h`, `t4_tcb.h`, `l2t.h`, `chcr_common.h`, `cxgb4_uld.h`, `clip_tbl.h`.
- Detected declarations: `struct chcr_ktls_info`, `struct chcr_ktls_ctx_tx`, `struct chcr_ktls_uld_ctx`, `enum ch_ktls_open_state`, `function __chcr_get_ktls_tx_info`, `function chcr_get_ktls_tx_info`, `function chcr_set_ktls_tx_info`, `function chcr_get_first_rx_qid`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.