drivers/ufs/core/ufs_bsg.c
Source file repositories/reference/linux-study-clean/drivers/ufs/core/ufs_bsg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ufs/core/ufs_bsg.c- Extension
.c- Size
- 6654 bytes
- Lines
- 276
- Domain
- Driver Families
- Bucket
- drivers/ufs
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/bsg-lib.hlinux/dma-mapping.hscsi/scsi.hscsi/scsi_host.hufs_bsg.hufs/ufshcd.hufshcd-priv.h
Detected Declarations
function Copyrightfunction ufs_bsg_alloc_desc_bufferfunction ufs_bsg_exec_advanced_rpmb_reqfunction ufs_bsg_requestfunction ufs_bsg_removefunction ufs_bsg_node_releasefunction ufs_bsg_probe
Annotated Snippet
ret = device_add(bsg_dev);
if (ret)
goto out;
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), NULL, ufs_bsg_request,
NULL, 0);
if (IS_ERR(q)) {
ret = PTR_ERR(q);
device_del(bsg_dev);
goto out;
}
hba->bsg_queue = q;
return 0;
out:
dev_err(bsg_dev, "fail to initialize a bsg dev %d\n", shost->host_no);
put_device(bsg_dev);
return ret;
}
Annotation
- Immediate include surface: `linux/bsg-lib.h`, `linux/dma-mapping.h`, `scsi/scsi.h`, `scsi/scsi_host.h`, `ufs_bsg.h`, `ufs/ufshcd.h`, `ufshcd-priv.h`.
- Detected declarations: `function Copyright`, `function ufs_bsg_alloc_desc_buffer`, `function ufs_bsg_exec_advanced_rpmb_req`, `function ufs_bsg_request`, `function ufs_bsg_remove`, `function ufs_bsg_node_release`, `function ufs_bsg_probe`.
- Atlas domain: Driver Families / drivers/ufs.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.