drivers/s390/net/smsgiucv_app.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/smsgiucv_app.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/smsgiucv_app.c- Extension
.c- Size
- 5250 bytes
- Lines
- 210
- 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/ctype.hlinux/err.hlinux/device.hlinux/list.hlinux/kobject.hlinux/module.hlinux/slab.hlinux/spinlock.hlinux/workqueue.hnet/iucv/iucv.hasm/machine.hsmsgiucv.h
Detected Declarations
struct smsg_app_eventfunction smsg_app_event_freefunction smsg_event_work_fnfunction list_for_each_entry_safefunction smsg_app_callbackfunction smsgiucv_app_initfunction smsgiucv_app_exitmodule init smsgiucv_app_init
Annotated Snippet
struct device_driver *smsgiucv_drv;
int rc;
if (!machine_is_vm())
return -ENODEV;
smsgiucv_drv = driver_find(SMSGIUCV_DRV_NAME, &iucv_bus);
if (!smsgiucv_drv)
return -ENODEV;
smsg_app_dev = iucv_alloc_device(NULL, smsgiucv_drv, NULL, "smsgiucv_app");
if (!smsg_app_dev)
return -ENOMEM;
rc = device_register(smsg_app_dev);
if (rc) {
put_device(smsg_app_dev);
goto fail;
}
/* convert sender to uppercase characters */
if (sender) {
int len = strlen(sender);
while (len--)
sender[len] = toupper(sender[len]);
}
/* register with the smsgiucv device driver */
rc = smsg_register_callback(SMSG_PREFIX, smsg_app_callback);
if (rc) {
device_unregister(smsg_app_dev);
goto fail;
}
rc = 0;
fail:
return rc;
}
module_init(smsgiucv_app_init);
static void __exit smsgiucv_app_exit(void)
{
/* unregister callback */
smsg_unregister_callback(SMSG_PREFIX, smsg_app_callback);
/* cancel pending work and flush any queued event work */
cancel_work_sync(&smsg_event_work);
smsg_event_work_fn(&smsg_event_work);
device_unregister(smsg_app_dev);
}
module_exit(smsgiucv_app_exit);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Deliver z/VM CP SMSG as uevents");
MODULE_AUTHOR("Hendrik Brueckner <brueckner@linux.vnet.ibm.com>");
Annotation
- Immediate include surface: `linux/ctype.h`, `linux/err.h`, `linux/device.h`, `linux/list.h`, `linux/kobject.h`, `linux/module.h`, `linux/slab.h`, `linux/spinlock.h`.
- Detected declarations: `struct smsg_app_event`, `function smsg_app_event_free`, `function smsg_event_work_fn`, `function list_for_each_entry_safe`, `function smsg_app_callback`, `function smsgiucv_app_init`, `function smsgiucv_app_exit`, `module init smsgiucv_app_init`.
- 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.