drivers/crypto/ccp/sev-dev-tsm.c
Source file repositories/reference/linux-study-clean/drivers/crypto/ccp/sev-dev-tsm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/ccp/sev-dev-tsm.c- Extension
.c- Size
- 8704 bytes
- Lines
- 400
- 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/pci.hlinux/device.hlinux/tsm.hlinux/iommu.hlinux/pci-doe.hlinux/bitfield.hlinux/module.hasm/sev-common.hasm/sev.hpsp-dev.hsev-dev.hsev-dev-tio.h
Detected Declarations
function sev_tio_spdm_cmdfunction stream_enablefunction streams_enablefunction stream_disablefunction streams_disablefunction stream_setupfunction streams_setupfunction streams_registerfunction streams_unregisterfunction stream_teardownfunction streams_teardownfunction stream_allocfunction dsm_removefunction dsm_createfunction dsm_connectfunction dsm_disconnectfunction sev_tsm_init_lockedfunction sev_tsm_uninit
Annotated Snippet
if (ide[i]) {
ret = stream_enable(ide[i]);
if (ret)
break;
}
}
return ret;
}
static void stream_disable(struct pci_ide *ide)
{
pci_ide_stream_disable(ide->pdev, ide);
pci_ide_stream_disable(pcie_find_root_port(ide->pdev), ide);
}
static void streams_disable(struct pci_ide **ide)
{
for (int i = 0; i < TIO_IDE_MAX_TC; ++i)
if (ide[i])
stream_disable(ide[i]);
}
static void stream_setup(struct pci_ide *ide)
{
struct pci_dev *rp = pcie_find_root_port(ide->pdev);
ide->partner[PCI_IDE_EP].rid_start = 0;
ide->partner[PCI_IDE_EP].rid_end = 0xffff;
ide->partner[PCI_IDE_RP].rid_start = 0;
ide->partner[PCI_IDE_RP].rid_end = 0xffff;
ide->pdev->ide_cfg = 0;
ide->pdev->ide_tee_limit = 1;
rp->ide_cfg = 1;
rp->ide_tee_limit = 0;
pci_warn(ide->pdev, "Forcing CFG/TEE for %s", pci_name(rp));
pci_ide_stream_setup(ide->pdev, ide);
pci_ide_stream_setup(rp, ide);
}
static u8 streams_setup(struct pci_ide **ide, u8 *ids)
{
bool def = false;
u8 tc_mask = 0;
int i;
for (i = 0; i < TIO_IDE_MAX_TC; ++i) {
if (!ide[i]) {
ids[i] = 0xFF;
continue;
}
tc_mask |= BIT(i);
ids[i] = ide[i]->stream_id;
if (!def) {
struct pci_ide_partner *settings;
settings = pci_ide_to_settings(ide[i]->pdev, ide[i]);
settings->default_stream = 1;
def = true;
}
stream_setup(ide[i]);
}
return tc_mask;
}
static int streams_register(struct pci_ide **ide)
{
int ret = 0, i;
for (i = 0; i < TIO_IDE_MAX_TC; ++i) {
if (ide[i]) {
ret = pci_ide_stream_register(ide[i]);
if (ret)
break;
}
}
return ret;
}
static void streams_unregister(struct pci_ide **ide)
{
for (int i = 0; i < TIO_IDE_MAX_TC; ++i)
if (ide[i])
Annotation
- Immediate include surface: `linux/pci.h`, `linux/device.h`, `linux/tsm.h`, `linux/iommu.h`, `linux/pci-doe.h`, `linux/bitfield.h`, `linux/module.h`, `asm/sev-common.h`.
- Detected declarations: `function sev_tio_spdm_cmd`, `function stream_enable`, `function streams_enable`, `function stream_disable`, `function streams_disable`, `function stream_setup`, `function streams_setup`, `function streams_register`, `function streams_unregister`, `function stream_teardown`.
- 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.