drivers/crypto/nx/nx-842.h
Source file repositories/reference/linux-study-clean/drivers/crypto/nx/nx-842.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/nx/nx-842.h- Extension
.h- Size
- 6350 bytes
- Lines
- 196
- 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.
- 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/kernel.hlinux/init.hlinux/module.hlinux/of.hlinux/slab.hlinux/io.hlinux/mm.hlinux/ratelimit.h
Detected Declarations
struct crypto_scompstruct nx842_constraintsstruct nx842_driverstruct nx842_crypto_header_groupstruct nx842_crypto_headerstruct nx842_crypto_ctxfunction nx842_get_pa
Annotated Snippet
struct nx842_constraints {
int alignment;
int multiple;
int minimum;
int maximum;
};
struct nx842_driver {
char *name;
struct module *owner;
size_t workmem_size;
struct nx842_constraints *constraints;
int (*compress)(const unsigned char *in, unsigned int in_len,
unsigned char *out, unsigned int *out_len,
void *wrkmem);
int (*decompress)(const unsigned char *in, unsigned int in_len,
unsigned char *out, unsigned int *out_len,
void *wrkmem);
};
struct nx842_crypto_header_group {
__be16 padding; /* unused bytes at start of group */
__be32 compressed_length; /* compressed bytes in group */
__be32 uncompressed_length; /* bytes after decompression */
} __packed;
struct nx842_crypto_header {
/* New members MUST be added within the struct_group() macro below. */
__struct_group(nx842_crypto_header_hdr, hdr, __packed,
__be16 magic; /* NX842_CRYPTO_MAGIC */
__be16 ignore; /* decompressed end bytes to ignore */
u8 groups; /* total groups in this header */
);
struct nx842_crypto_header_group group[] __counted_by(groups);
} __packed;
static_assert(offsetof(struct nx842_crypto_header, group) == sizeof(struct nx842_crypto_header_hdr),
"struct member likely outside of __struct_group()");
#define NX842_CRYPTO_GROUP_MAX (0x20)
struct nx842_crypto_ctx {
spinlock_t lock;
u8 *wmem;
u8 *sbounce, *dbounce;
struct nx842_crypto_header_hdr header;
struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
struct nx842_driver *driver;
};
void *nx842_crypto_alloc_ctx(struct nx842_driver *driver);
void nx842_crypto_free_ctx(void *ctx);
int nx842_crypto_compress(struct crypto_scomp *tfm,
const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen, void *ctx);
int nx842_crypto_decompress(struct crypto_scomp *tfm,
const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen, void *ctx);
#endif /* __NX_842_H__ */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/module.h`, `linux/of.h`, `linux/slab.h`, `linux/io.h`, `linux/mm.h`, `linux/ratelimit.h`.
- Detected declarations: `struct crypto_scomp`, `struct nx842_constraints`, `struct nx842_driver`, `struct nx842_crypto_header_group`, `struct nx842_crypto_header`, `struct nx842_crypto_ctx`, `function nx842_get_pa`.
- Atlas domain: Driver Families / drivers/crypto.
- 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.