drivers/s390/net/smsgiucv.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/smsgiucv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/smsgiucv.c- Extension
.c- Size
- 4188 bytes
- Lines
- 183
- 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.
- 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/export.hlinux/module.hlinux/init.hlinux/errno.hlinux/device.hlinux/slab.hnet/iucv/iucv.hasm/machine.hasm/cpcmd.hasm/ebcdic.hsmsgiucv.h
Detected Declarations
struct smsg_callbackfunction smsg_path_pendingfunction smsg_message_pendingfunction list_for_each_entryfunction smsg_register_callbackfunction smsg_unregister_callbackfunction smsg_exitfunction smsg_initmodule init smsg_initexport smsg_register_callbackexport smsg_unregister_callback
Annotated Snippet
static struct device_driver smsg_driver = {
.owner = THIS_MODULE,
.name = SMSGIUCV_DRV_NAME,
.bus = &iucv_bus,
};
static void __exit smsg_exit(void)
{
cpcmd("SET SMSG OFF", NULL, 0, NULL);
iucv_unregister(&smsg_handler, 1);
driver_unregister(&smsg_driver);
}
static int __init smsg_init(void)
{
int rc;
if (!machine_is_vm()) {
rc = -EPROTONOSUPPORT;
goto out;
}
rc = driver_register(&smsg_driver);
if (rc != 0)
goto out;
rc = iucv_register(&smsg_handler, 1);
if (rc)
goto out_driver;
smsg_path = iucv_path_alloc(255, 0, GFP_KERNEL);
if (!smsg_path) {
rc = -ENOMEM;
goto out_register;
}
rc = iucv_path_connect(smsg_path, &smsg_handler, "*MSG ",
NULL, NULL, NULL);
if (rc)
goto out_free_path;
cpcmd("SET SMSG IUCV", NULL, 0, NULL);
return 0;
out_free_path:
iucv_path_free(smsg_path);
smsg_path = NULL;
out_register:
iucv_unregister(&smsg_handler, 1);
out_driver:
driver_unregister(&smsg_driver);
out:
return rc;
}
module_init(smsg_init);
module_exit(smsg_exit);
MODULE_LICENSE("GPL");
EXPORT_SYMBOL(smsg_register_callback);
EXPORT_SYMBOL(smsg_unregister_callback);
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/init.h`, `linux/errno.h`, `linux/device.h`, `linux/slab.h`, `net/iucv/iucv.h`, `asm/machine.h`.
- Detected declarations: `struct smsg_callback`, `function smsg_path_pending`, `function smsg_message_pending`, `function list_for_each_entry`, `function smsg_register_callback`, `function smsg_unregister_callback`, `function smsg_exit`, `function smsg_init`, `module init smsg_init`, `export smsg_register_callback`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: pattern implementation candidate.
- 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.