STRUCT BLK_CRYPTO_PROFILE(9)
π struct blk_crypto_profile(9) π
okay so bestie, welcome to the kernel API manual, and today's main character is struct blk_crypto_profile β literally the inline encryption profile for a device. yes. we're doing cryptography. put your hair up, we're getting into it π
β¨ NAME β¨
struct blk_crypto_profile β inline encryption profile for a device π
π¦ SYNOPSIS π¦
struct blk_crypto_profile {
struct blk_crypto_ll_ops ll_ops;
unsigned int max_dun_bytes_supported;
unsigned int key_types_supported;
unsigned int modes_supported[BLK_ENCRYPTION_MODE_MAX];
struct device *dev;
};
like, that's the whole vibe of it. five fields. she's compact. she's iconic. π
πΈ Members πΈ
ll_opsβ these are the driver-provided functions that control the inline encryption hardware β think programming keys and evicting keys. your driver brings the moves, this field holds them. π«Άmax_dun_bytes_supportedβ the maximum number of bytes supported for specifying the data unit number (DUN). and specifically, the range of supported DUNs is0through(1 << (8 * max_dun_bytes_supported)) - 1. math is math, bestie, don't fight it. π₯key_types_supportedβ a bitmask of the supported key types:BLK_CRYPTO_KEY_TYPE_RAWand/orBLK_CRYPTO_KEY_TYPE_HW_WRAPPED. bitmask girlies rise πmodes_supportedβ array of bitmasks that specifies whether each combination of crypto mode and data unit size is supported. specifically, thei'th bit ofmodes_supported[crypto_mode]is set ifcrypto_modecan be used with a data unit size of(1 << i). and note that only data unit sizes that are powers of 2 can be supported β¨ (so like, don't come at her with 3, she will not be entertaining it π)devβ an optional device for runtime power management. and if the driver provides this device, it will be runtime-resumed before any function inll_opsis called, and will remain resumed during the call. she wakes up for the function call and stays up through the whole thing β main character energy fr fr π
π Description π
so what's actually in here? this struct contains three-ish things, and they're all doing their own little job:
- a storage device's inline encryption capabilities (e.g. the supported crypto algorithms)
- driver-provided functions to control the inline encryption hardware (e.g. programming and evicting keys)
- optional device-independent keyslot management data
that's the whole package. capabilities, control functions, and the optional keyslot-management situation. slay π§
β SEE ALSO β
- Kernel file
./include/linux/blk-crypto-profile.h struct blk_crypto_ll_ops(9)
lowkey a reminder: keep the fields exactly as they are up there in the synopsis, BLK_ENCRYPTION_MODE_MAX included, because that array size is not vibes-based, it's real π
aaaand that's the page!! this whole thing lives in ./include/linux, from the October 2026 Kernel API Manual, and it's all about struct blk_crypto_profile(9). go forth and encrypt inline, bestie πππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms