drivers/s390/char/fs3270.c
Source file repositories/reference/linux-study-clean/drivers/s390/char/fs3270.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/char/fs3270.c- Extension
.c- Size
- 13115 bytes
- Lines
- 562
- 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/memblock.hlinux/console.hlinux/init.hlinux/interrupt.hlinux/sched/signal.hlinux/module.hlinux/list.hlinux/slab.hlinux/types.huapi/asm/fs3270.hasm/ccwdev.hasm/cio.hasm/ebcdic.hasm/idals.hraw3270.hctrlchar.h
Detected Declarations
struct fs3270function fs3270_wake_upfunction fs3270_workingfunction fs3270_do_iofunction fs3270_reset_callbackfunction fs3270_restore_callbackfunction fs3270_activatefunction fs3270_save_callbackfunction fs3270_deactivatefunction fs3270_irqfunction fs3270_readfunction fs3270_writefunction fs3270_ioctlfunction fs3270_free_viewfunction fs3270_releasefunction fs3270_openfunction fs3270_closefunction fs3270_create_cbfunction fs3270_destroy_cbfunction fs3270_initfunction fs3270_exitmodule init fs3270_init
Annotated Snippet
static const struct file_operations fs3270_fops = {
.owner = THIS_MODULE, /* owner */
.read = fs3270_read, /* read */
.write = fs3270_write, /* write */
.unlocked_ioctl = fs3270_ioctl, /* ioctl */
.open = fs3270_open, /* open */
.release = fs3270_close, /* release */
};
static void fs3270_create_cb(int minor)
{
__register_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub", &fs3270_fops);
device_create(&class3270, NULL, MKDEV(IBM_FS3270_MAJOR, minor),
NULL, "3270/tub%d", minor);
}
static void fs3270_destroy_cb(int minor)
{
device_destroy(&class3270, MKDEV(IBM_FS3270_MAJOR, minor));
__unregister_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub");
}
static struct raw3270_notifier fs3270_notifier = {
.create = fs3270_create_cb,
.destroy = fs3270_destroy_cb,
};
/*
* 3270 fullscreen driver initialization.
*/
static int __init fs3270_init(void)
{
int rc;
rc = __register_chrdev(IBM_FS3270_MAJOR, 0, 1, "fs3270", &fs3270_fops);
if (rc)
return rc;
device_create(&class3270, NULL, MKDEV(IBM_FS3270_MAJOR, 0),
NULL, "3270/tub");
raw3270_register_notifier(&fs3270_notifier);
return 0;
}
static void __exit fs3270_exit(void)
{
raw3270_unregister_notifier(&fs3270_notifier);
device_destroy(&class3270, MKDEV(IBM_FS3270_MAJOR, 0));
__unregister_chrdev(IBM_FS3270_MAJOR, 0, 1, "fs3270");
}
MODULE_DESCRIPTION("IBM/3270 Driver - fullscreen driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_CHARDEV_MAJOR(IBM_FS3270_MAJOR);
module_init(fs3270_init);
module_exit(fs3270_exit);
Annotation
- Immediate include surface: `linux/memblock.h`, `linux/console.h`, `linux/init.h`, `linux/interrupt.h`, `linux/sched/signal.h`, `linux/module.h`, `linux/list.h`, `linux/slab.h`.
- Detected declarations: `struct fs3270`, `function fs3270_wake_up`, `function fs3270_working`, `function fs3270_do_io`, `function fs3270_reset_callback`, `function fs3270_restore_callback`, `function fs3270_activate`, `function fs3270_save_callback`, `function fs3270_deactivate`, `function fs3270_irq`.
- 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.