drivers/tty/serial/serial_txx9.c
Source file repositories/reference/linux-study-clean/drivers/tty/serial/serial_txx9.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/serial_txx9.c- Extension
.c- Size
- 30913 bytes
- Lines
- 1269
- Domain
- Driver Families
- Bucket
- drivers/tty
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/ioport.hlinux/init.hlinux/console.hlinux/delay.hlinux/platform_device.hlinux/pci.hlinux/serial_core.hlinux/serial.hlinux/tty.hlinux/tty_flip.hlinux/io.hasm/txx9/generic.h
Detected Declarations
function Copyrightfunction sio_outfunction sio_maskfunction sio_setfunction sio_quot_setfunction serial_txx9_stop_txfunction serial_txx9_start_txfunction serial_txx9_stop_rxfunction serial_txx9_initializefunction receive_charsfunction transmit_charsfunction serial_txx9_interruptfunction serial_txx9_tx_emptyfunction serial_txx9_get_mctrlfunction serial_txx9_set_mctrlfunction serial_txx9_break_ctlfunction wait_for_xmitrfunction serial_txx9_get_poll_charfunction serial_txx9_put_poll_charfunction serial_txx9_startupfunction serial_txx9_shutdownfunction serial_txx9_set_termiosfunction serial_txx9_pmfunction serial_txx9_request_resourcefunction serial_txx9_release_resourcefunction serial_txx9_release_portfunction serial_txx9_request_portfunction serial_txx9_config_portfunction serial_txx9_typefunction serial_txx9_register_portsfunction serial_txx9_console_putcharfunction serial_txx9_console_writefunction serial_txx9_console_setupfunction serial_txx9_console_initfunction early_serial_txx9_setupfunction serial_txx9_register_portfunction serial_txx9_unregister_portfunction serial_txx9_probefunction serial_txx9_removefunction serial_txx9_suspendfunction serial_txx9_resumefunction pciserial_txx9_init_onefunction pciserial_txx9_remove_onefunction pciserial_txx9_suspend_onefunction pciserial_txx9_resume_onefunction serial_txx9_initfunction serial_txx9_exitmodule init serial_txx9_init
Annotated Snippet
static struct pci_driver serial_txx9_pci_driver = {
.name = "serial_txx9",
.probe = pciserial_txx9_init_one,
.remove = pciserial_txx9_remove_one,
#ifdef CONFIG_PM
.suspend = pciserial_txx9_suspend_one,
.resume = pciserial_txx9_resume_one,
#endif
.id_table = serial_txx9_pci_tbl,
};
MODULE_DEVICE_TABLE(pci, serial_txx9_pci_tbl);
#endif /* ENABLE_SERIAL_TXX9_PCI */
static struct platform_device *serial_txx9_plat_devs;
static int __init serial_txx9_init(void)
{
int ret;
ret = uart_register_driver(&serial_txx9_reg);
if (ret)
goto out;
serial_txx9_plat_devs = platform_device_alloc("serial_txx9", -1);
if (!serial_txx9_plat_devs) {
ret = -ENOMEM;
goto unreg_uart_drv;
}
ret = platform_device_add(serial_txx9_plat_devs);
if (ret)
goto put_dev;
serial_txx9_register_ports(&serial_txx9_reg,
&serial_txx9_plat_devs->dev);
ret = platform_driver_register(&serial_txx9_plat_driver);
if (ret)
goto del_dev;
#ifdef ENABLE_SERIAL_TXX9_PCI
ret = pci_register_driver(&serial_txx9_pci_driver);
if (ret) {
platform_driver_unregister(&serial_txx9_plat_driver);
}
#endif
if (ret == 0)
goto out;
del_dev:
platform_device_del(serial_txx9_plat_devs);
put_dev:
platform_device_put(serial_txx9_plat_devs);
unreg_uart_drv:
uart_unregister_driver(&serial_txx9_reg);
out:
return ret;
}
static void __exit serial_txx9_exit(void)
{
int i;
#ifdef ENABLE_SERIAL_TXX9_PCI
pci_unregister_driver(&serial_txx9_pci_driver);
#endif
platform_driver_unregister(&serial_txx9_plat_driver);
platform_device_unregister(serial_txx9_plat_devs);
for (i = 0; i < UART_NR; i++) {
struct uart_port *up = &serial_txx9_ports[i];
if (up->iobase || up->mapbase)
uart_remove_one_port(&serial_txx9_reg, up);
}
uart_unregister_driver(&serial_txx9_reg);
}
module_init(serial_txx9_init);
module_exit(serial_txx9_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TX39/49 serial driver");
MODULE_ALIAS_CHARDEV_MAJOR(TXX9_TTY_MAJOR);
Annotation
- Immediate include surface: `linux/module.h`, `linux/ioport.h`, `linux/init.h`, `linux/console.h`, `linux/delay.h`, `linux/platform_device.h`, `linux/pci.h`, `linux/serial_core.h`.
- Detected declarations: `function Copyright`, `function sio_out`, `function sio_mask`, `function sio_set`, `function sio_quot_set`, `function serial_txx9_stop_tx`, `function serial_txx9_start_tx`, `function serial_txx9_stop_rx`, `function serial_txx9_initialize`, `function receive_chars`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.