drivers/crypto/bcm/spu.c
Source file repositories/reference/linux-study-clean/drivers/crypto/bcm/spu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/bcm/spu.c- Extension
.c- Size
- 36571 bytes
- Lines
- 1210
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/string.hutil.hspu.hspum.hcipher.h
Detected Declarations
function spum_dump_msg_hdrfunction spum_ns2_ctx_max_payloadfunction spum_nsp_ctx_max_payloadfunction spum_payload_lengthfunction spum_response_hdr_lenfunction spum_hash_pad_lenfunction spum_gcm_ccm_pad_lenfunction spum_assoc_resp_lenfunction spum_aead_ivlenfunction spum_hash_typefunction spum_digest_sizefunction spum_create_requestfunction RFC4543function spum_cipher_req_initfunction spum_cipher_req_finishfunction spum_request_padfunction spum_xts_tweak_in_payloadfunction spum_tx_status_lenfunction spum_rx_status_lenfunction spum_status_processfunction spum_ccm_update_ivfunction spum_wordalign_padlen
Annotated Snippet
if (hash_alg && hash_mode) {
char *name = "NONE";
switch (hash_alg) {
case HASH_ALG_MD5:
hash_key_len = 16;
name = "MD5";
break;
case HASH_ALG_SHA1:
hash_key_len = 20;
name = "SHA1";
break;
case HASH_ALG_SHA224:
hash_key_len = 28;
name = "SHA224";
break;
case HASH_ALG_SHA256:
hash_key_len = 32;
name = "SHA256";
break;
case HASH_ALG_SHA384:
hash_key_len = 48;
name = "SHA384";
break;
case HASH_ALG_SHA512:
hash_key_len = 64;
name = "SHA512";
break;
case HASH_ALG_AES:
hash_key_len = 0;
name = "AES";
break;
case HASH_ALG_NONE:
break;
}
packet_log(" Auth Key Type:%s Length:%u Bytes\n",
name, hash_key_len);
packet_dump(" KEY: ", ptr, hash_key_len);
ptr += hash_key_len;
} else if ((hash_alg == HASH_ALG_AES) &&
(hash_mode == HASH_MODE_XCBC)) {
char *name = "NONE";
switch (cipher_type) {
case CIPHER_TYPE_AES128:
hash_key_len = 16;
name = "AES128-XCBC";
break;
case CIPHER_TYPE_AES192:
hash_key_len = 24;
name = "AES192-XCBC";
break;
case CIPHER_TYPE_AES256:
hash_key_len = 32;
name = "AES256-XCBC";
break;
}
packet_log(" Auth Key Type:%s Length:%u Bytes\n",
name, hash_key_len);
packet_dump(" KEY: ", ptr, hash_key_len);
ptr += hash_key_len;
}
if (hash_alg && (hash_mode == HASH_MODE_NONE) &&
(hash_type == HASH_TYPE_UPDT)) {
char *name = "NONE";
switch (hash_alg) {
case HASH_ALG_MD5:
hash_state_len = 16;
name = "MD5";
break;
case HASH_ALG_SHA1:
hash_state_len = 20;
name = "SHA1";
break;
case HASH_ALG_SHA224:
hash_state_len = 32;
name = "SHA224";
break;
case HASH_ALG_SHA256:
hash_state_len = 32;
name = "SHA256";
break;
case HASH_ALG_SHA384:
hash_state_len = 48;
name = "SHA384";
break;
case HASH_ALG_SHA512:
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/string.h`, `util.h`, `spu.h`, `spum.h`, `cipher.h`.
- Detected declarations: `function spum_dump_msg_hdr`, `function spum_ns2_ctx_max_payload`, `function spum_nsp_ctx_max_payload`, `function spum_payload_length`, `function spum_response_hdr_len`, `function spum_hash_pad_len`, `function spum_gcm_ccm_pad_len`, `function spum_assoc_resp_len`, `function spum_aead_ivlen`, `function spum_hash_type`.
- 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.