drivers/tty/serial/8250/8250_rsa.c
Source file repositories/reference/linux-study-clean/drivers/tty/serial/8250/8250_rsa.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/8250/8250_rsa.c- Extension
.c- Size
- 5248 bytes
- Lines
- 212
- Domain
- Driver Families
- Bucket
- drivers/tty
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/ioport.hlinux/module.hlinux/moduleparam.hlinux/serial.hlinux/serial_8250.h8250.h
Detected Declarations
function rsa8250_request_resourcefunction rsa8250_release_resourcefunction univ8250_config_portfunction univ8250_request_portfunction univ8250_release_portfunction univ8250_rsa_supportfunction __rsa_enablefunction rsa_enablefunction rsa_disablefunction rsa_autoconfigfunction rsa_reset
Annotated Snippet
if (probe_rsa[i] == up->port.iobase) {
if (rsa8250_request_resource(up) == 0)
up->probe |= UART_PROBE_RSA;
break;
}
}
}
core_port_base_ops->config_port(port, flags);
if (port->type != PORT_RSA && up->probe & UART_PROBE_RSA)
rsa8250_release_resource(up);
}
static int univ8250_request_port(struct uart_port *port)
{
struct uart_8250_port *up = up_to_u8250p(port);
int ret;
ret = core_port_base_ops->request_port(port);
if (ret == 0 && port->type == PORT_RSA) {
ret = rsa8250_request_resource(up);
if (ret < 0)
core_port_base_ops->release_port(port);
}
return ret;
}
static void univ8250_release_port(struct uart_port *port)
{
struct uart_8250_port *up = up_to_u8250p(port);
if (port->type == PORT_RSA)
rsa8250_release_resource(up);
core_port_base_ops->release_port(port);
}
/*
* It is not allowed to directly reference any symbols from 8250.ko here as
* that would result in a dependency loop between the 8250.ko and
* 8250_base.ko modules. This function is called from 8250.ko and is used to
* break the symbolic dependency cycle. Anything that is needed from 8250.ko
* has to be passed as pointers to this function which then can adjust those
* variables on 8250.ko side or store them locally as needed.
*/
void univ8250_rsa_support(struct uart_ops *ops, const struct uart_ops *core_ops)
{
core_port_base_ops = core_ops;
ops->config_port = univ8250_config_port;
ops->request_port = univ8250_request_port;
ops->release_port = univ8250_release_port;
}
EXPORT_SYMBOL_FOR_MODULES(univ8250_rsa_support, "8250");
module_param_hw_array(probe_rsa, ulong, ioport, &probe_rsa_count, 0444);
MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
/*
* Attempts to turn on the RSA FIFO. Returns zero on failure.
* We set the port uart clock rate if we succeed.
*/
static int __rsa_enable(struct uart_8250_port *up)
{
unsigned char mode;
int result;
mode = serial_in(up, UART_RSA_MSR);
result = mode & UART_RSA_MSR_FIFO;
if (!result) {
serial_out(up, UART_RSA_MSR, mode | UART_RSA_MSR_FIFO);
mode = serial_in(up, UART_RSA_MSR);
result = mode & UART_RSA_MSR_FIFO;
}
if (result)
up->port.uartclk = SERIAL_RSA_BAUD_BASE * 16;
return result;
}
/*
* If this is an RSA port, see if we can kick it up to the higher speed clock.
*/
void rsa_enable(struct uart_8250_port *up)
{
if (up->port.type != PORT_RSA)
return;
Annotation
- Immediate include surface: `linux/errno.h`, `linux/ioport.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/serial.h`, `linux/serial_8250.h`, `8250.h`.
- Detected declarations: `function rsa8250_request_resource`, `function rsa8250_release_resource`, `function univ8250_config_port`, `function univ8250_request_port`, `function univ8250_release_port`, `function univ8250_rsa_support`, `function __rsa_enable`, `function rsa_enable`, `function rsa_disable`, `function rsa_autoconfig`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: integration implementation candidate.
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.