drivers/tty/tty_baudrate.c
Source file repositories/reference/linux-study-clean/drivers/tty/tty_baudrate.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/tty_baudrate.c- Extension
.c- Size
- 6050 bytes
- Lines
- 216
- 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/types.hlinux/kernel.hlinux/termios.hlinux/tty.hlinux/export.htty.h
Detected Declarations
function tty_termios_baud_ratefunction tty_termios_input_baud_ratefunction tty_termios_encode_baud_ratefunction tty_encode_baud_rateexport tty_termios_baud_rateexport tty_termios_input_baud_rateexport tty_termios_encode_baud_rateexport tty_encode_baud_rate
Annotated Snippet
if (ofound == i && !ibinput) {
ifound = i;
} else {
ifound = i;
termios->c_cflag |= (baud_bits[i] << IBSHIFT);
}
}
} while (++i < n_baud_table);
/* If we found no match then use BOTHER. */
if (ofound == -1)
termios->c_cflag |= BOTHER;
/* Set exact input bits only if the input and output differ or the
* user already did.
*/
if (ifound == -1 && (ibaud != obaud || ibinput))
termios->c_cflag |= (BOTHER << IBSHIFT);
}
EXPORT_SYMBOL_GPL(tty_termios_encode_baud_rate);
/**
* tty_encode_baud_rate - set baud rate of the tty
* @tty: terminal device
* @ibaud: input baud rate
* @obaud: output baud rate
*
* Update the current termios data for the tty with the new speed
* settings. The caller must hold the termios_rwsem for the tty in
* question.
*/
void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud)
{
tty_termios_encode_baud_rate(&tty->termios, ibaud, obaud);
}
EXPORT_SYMBOL_GPL(tty_encode_baud_rate);
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/termios.h`, `linux/tty.h`, `linux/export.h`, `tty.h`.
- Detected declarations: `function tty_termios_baud_rate`, `function tty_termios_input_baud_rate`, `function tty_termios_encode_baud_rate`, `function tty_encode_baud_rate`, `export tty_termios_baud_rate`, `export tty_termios_input_baud_rate`, `export tty_termios_encode_baud_rate`, `export tty_encode_baud_rate`.
- 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.