drivers/s390/cio/chsc_sch.c
Source file repositories/reference/linux-study-clean/drivers/s390/cio/chsc_sch.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/cio/chsc_sch.c- Extension
.c- Size
- 22487 bytes
- Lines
- 973
- Domain
- Driver Families
- Bucket
- drivers/s390
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/slab.hlinux/device.hlinux/io.hlinux/module.hlinux/uaccess.hlinux/miscdevice.hlinux/kernel_stat.hasm/cio.hasm/chsc.hasm/isc.hcio.hcio_debug.hcss.hchsc_sch.hioasm.h
Detected Declarations
function CHSC_LOG_HEXfunction chsc_subchannel_irqfunction chsc_subchannel_probefunction chsc_subchannel_removefunction chsc_subchannel_shutdownfunction chsc_init_dbfsfunction chsc_remove_dbfsfunction chsc_init_sch_driverfunction chsc_cleanup_sch_driverfunction chsc_subchannel_match_next_freefunction chsc_asyncfunction chsc_log_commandfunction chsc_examine_irbfunction chsc_ioctl_startfunction chsc_ioctl_on_close_setfunction chsc_ioctl_on_close_removefunction chsc_ioctl_start_syncfunction chsc_ioctl_info_channel_pathfunction chsc_ioctl_info_cufunction chsc_ioctl_info_sch_cufunction chsc_ioctl_conf_infofunction chsc_ioctl_conf_comp_listfunction chsc_ioctl_chpdfunction chsc_ioctl_dcalfunction chsc_ioctlfunction chsc_openfunction chsc_releasefunction chsc_misc_initfunction chsc_misc_cleanupfunction chsc_sch_initfunction chsc_sch_exitmodule init chsc_sch_init
Annotated Snippet
static const struct file_operations chsc_fops = {
.owner = THIS_MODULE,
.open = chsc_open,
.release = chsc_release,
.unlocked_ioctl = chsc_ioctl,
};
static struct miscdevice chsc_misc_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = "chsc",
.fops = &chsc_fops,
};
static int __init chsc_misc_init(void)
{
return misc_register(&chsc_misc_device);
}
static void chsc_misc_cleanup(void)
{
misc_deregister(&chsc_misc_device);
}
static int __init chsc_sch_init(void)
{
int ret;
ret = chsc_init_dbfs();
if (ret)
return ret;
isc_register(CHSC_SCH_ISC);
ret = chsc_init_sch_driver();
if (ret)
goto out_dbf;
ret = chsc_misc_init();
if (ret)
goto out_driver;
return ret;
out_driver:
chsc_cleanup_sch_driver();
out_dbf:
isc_unregister(CHSC_SCH_ISC);
chsc_remove_dbfs();
return ret;
}
static void __exit chsc_sch_exit(void)
{
chsc_misc_cleanup();
chsc_cleanup_sch_driver();
isc_unregister(CHSC_SCH_ISC);
chsc_remove_dbfs();
}
module_init(chsc_sch_init);
module_exit(chsc_sch_exit);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/device.h`, `linux/io.h`, `linux/module.h`, `linux/uaccess.h`, `linux/miscdevice.h`, `linux/kernel_stat.h`, `asm/cio.h`.
- Detected declarations: `function CHSC_LOG_HEX`, `function chsc_subchannel_irq`, `function chsc_subchannel_probe`, `function chsc_subchannel_remove`, `function chsc_subchannel_shutdown`, `function chsc_init_dbfs`, `function chsc_remove_dbfs`, `function chsc_init_sch_driver`, `function chsc_cleanup_sch_driver`, `function chsc_subchannel_match_next_free`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.