#include <linux/config.h>#include <linux/module.h>#include <linux/errno.h>#include <linux/signal.h>#include <linux/sched.h>#include <linux/timer.h>#include <linux/interrupt.h>#include <linux/tty.h>#include <linux/tty_flip.h>#include <linux/serial.h>#include <linux/serial_reg.h>#include <linux/major.h>#include <linux/string.h>#include <linux/fcntl.h>#include <linux/ptrace.h>#include <linux/ioport.h>#include <linux/mm.h>#include <linux/malloc.h>#include <linux/init.h>#include <linux/delay.h>#include <asm/system.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/uaccess.h>#include <asm/bitops.h>#include <asm/serial.h>Include dependency graph for drivers/char/serial.c:

Go to the source code of this file.
Defines | |
| #define | CONFIG_SERIAL_NOPAUSE_IO |
| #define | SERIAL_DO_RESTART |
| #define | RS_STROBE_TIME (10*HZ) |
| #define | RS_ISR_PASS_LIMIT 256 |
| #define | IRQ_T(state) ((state->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) |
| #define | SERIAL_INLINE |
| #define | DBG_CNT(s) |
| #define | SERIAL_DEV_OFFSET 0 |
| #define | _INLINE_ inline |
| #define | WAKEUP_CHARS 256 |
| #define | NR_PORTS (sizeof(rs_table)/sizeof(struct serial_state)) |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
Functions | |
| static | DECLARE_TASK_QUEUE (tq_serial) |
| static unsigned | detect_uart_irq (struct serial_state *state) |
| static void | autoconfig (struct serial_state *info) |
| static void | change_speed (struct async_struct *info, struct termios *old) |
| static void | rs_wait_until_sent (struct tty_struct *tty, int timeout) |
| static int | serial_paranoia_check (struct async_struct *info, kdev_t device, const char *routine) |
| static unsigned int | serial_in (struct async_struct *info, int offset) |
| static unsigned int | serial_inp (struct async_struct *info, int offset) |
| static void | serial_out (struct async_struct *info, int offset, int value) |
| static void | serial_outp (struct async_struct *info, int offset, int value) |
| static void | rs_stop (struct tty_struct *tty) |
| static void | rs_start (struct tty_struct *tty) |
| static _INLINE_ void | rs_sched_event (struct async_struct *info, int event) |
| static _INLINE_ void | receive_chars (struct async_struct *info, int *status) |
| static _INLINE_ void | transmit_chars (struct async_struct *info, int *intr_done) |
| static _INLINE_ void | check_modem_status (struct async_struct *info) |
| static void | rs_interrupt_single (int irq, void *dev_id, struct pt_regs *regs) |
| static void | do_serial_bh (void) |
| static void | do_softint (void *private_) |
| static void | rs_timer (void) |
| static void | figure_IRQ_timeout (int irq) |
| static int | startup (struct async_struct *info) |
| static void | shutdown (struct async_struct *info) |
| static void | rs_put_char (struct tty_struct *tty, unsigned char ch) |
| static void | rs_flush_chars (struct tty_struct *tty) |
| static int | rs_write (struct tty_struct *tty, int from_user, const unsigned char *buf, int count) |
| static int | rs_write_room (struct tty_struct *tty) |
| static int | rs_chars_in_buffer (struct tty_struct *tty) |
| static void | rs_flush_buffer (struct tty_struct *tty) |
| static void | rs_send_xchar (struct tty_struct *tty, char ch) |
| static void | rs_throttle (struct tty_struct *tty) |
| static void | rs_unthrottle (struct tty_struct *tty) |
| static int | get_serial_info (struct async_struct *info, struct serial_struct *retinfo) |
| static int | set_serial_info (struct async_struct *info, struct serial_struct *new_info) |
| static int | get_lsr_info (struct async_struct *info, unsigned int *value) |
| static int | get_modem_info (struct async_struct *info, unsigned int *value) |
| static int | set_modem_info (struct async_struct *info, unsigned int cmd, unsigned int *value) |
| static int | do_autoconfig (struct async_struct *info) |
| static void | rs_break (struct tty_struct *tty, int break_state) |
| static int | rs_ioctl (struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) |
| static void | rs_set_termios (struct tty_struct *tty, struct termios *old_termios) |
| static void | rs_close (struct tty_struct *tty, struct file *filp) |
| static void | rs_hangup (struct tty_struct *tty) |
| static int | block_til_ready (struct tty_struct *tty, struct file *filp, struct async_struct *info) |
| static int | get_async_struct (int line, struct async_struct **ret_info) |
| static int | rs_open (struct tty_struct *tty, struct file *filp) |
| static int | line_info (char *buf, struct serial_state *state) |
| int | rs_read_proc (char *page, char **start, off_t idx, ssize_t count, int *eof, void *data) |
| static _INLINE_ void | show_serial_version (void) |
| int | register_serial (struct serial_struct *req) |
| void | unregister_serial (int line) |
| EXPORT_SYMBOL (register_serial) | |
| EXPORT_SYMBOL (unregister_serial) | |
| __initfunc (int rs_init(void)) | |
Variables | |
| static char * | serial_name = "Serial driver" |
| static char * | serial_version = "4.27" |
| static struct tty_driver serial_driver | callout_driver |
| static int | serial_refcount |
| static struct async_struct * | IRQ_ports [NR_IRQS] |
| static int | IRQ_timeout [NR_IRQS] |
| static struct serial_uart_config | uart_config [] |
| static struct serial_state | rs_table [] |
| static struct tty_struct * | serial_table [NR_PORTS] |
| static struct termios * | serial_termios [NR_PORTS] |
| static struct termios * | serial_termios_locked [NR_PORTS] |
| static unsigned char * | tmp_buf |
| static struct semaphore | tmp_buf_sem = MUTEX |
|
|
Definition at line 160 of file drivers/char/serial.c. |
|
|
Definition at line 67 of file drivers/char/serial.c. |
|
|
Definition at line 116 of file drivers/char/serial.c. |
|
|
Definition at line 107 of file drivers/char/serial.c. |
|
|
Definition at line 222 of file drivers/char/serial.c. |
|
|
Definition at line 215 of file drivers/char/serial.c. |
|
|
|
|
|
Definition at line 105 of file drivers/char/serial.c. |
|
|
Definition at line 104 of file drivers/char/serial.c. |
|
|
Definition at line 156 of file drivers/char/serial.c. Referenced by __initfunc(). |
|
|
Definition at line 68 of file drivers/char/serial.c. |
|
|
Definition at line 110 of file drivers/char/serial.c. |
|
|
Definition at line 172 of file drivers/char/serial.c. |
|
|
|
Definition at line 2935 of file drivers/char/serial.c. References ASYNC_SKIP_TEST, cli, serial_uart_config::dfl_xmit_fifo_size, serial_state::flags, async_struct::flags, serial_state::hub6, async_struct::hub6, async_struct::magic, outb, async_struct::port, serial_state::port, PORT_16450, PORT_16550, PORT_16550A, PORT_16650, PORT_16650V2, PORT_16750, PORT_8250, PORT_UNKNOWN, request_region, restore_flags, save_flags, serial_in, serial_inp, SERIAL_MAGIC, serial_outp, serial_state::type, UART_EFR, UART_FCR, UART_FCR7_64BYTE, UART_FCR_CLEAR_RCVR, UART_FCR_CLEAR_XMIT, UART_FCR_ENABLE_FIFO, UART_IER, UART_IIR, UART_LCR, UART_LCR_DLAB, UART_MCR, UART_MCR_LOOP, UART_MSR, UART_RX, UART_SCR, x00, x0c(), xBF, xff, and serial_state::xmit_fifo_size. Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 2436 of file drivers/char/serial.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_CLOSING, ASYNC_HUP_NOTIFY, ASYNC_INITIALIZED, ASYNC_NORMAL_ACTIVE, ASYNC_PGRP_LOCKOUT, ASYNC_SESSION_LOCKOUT, async_struct::blocked_open, termios::c_cflag, CBAUD, cli, CLOCAL, async_struct::close_wait, serial_state::count, current, EAGAIN, EBUSY, ERESTARTSYS, async_struct::flags, interruptible_sleep_on(), async_struct::line, serial_state::line, serial_state::normal_termios, NULL, O_NONBLOCK, async_struct::open_wait, async_struct::pgrp, printk, restore_flags, save_flags, schedule(), serial_in, serial_inp, serial_out, SERIAL_TYPE_CALLOUT, async_struct::session, signal_pending, async_struct::state, TASK_INTERRUPTIBLE, TASK_RUNNING, tty_hung_up_p(), UART_MCR, UART_MCR_DTR, UART_MCR_RTS, UART_MSR, and UART_MSR_DCD. Here is the call graph for this function: ![]() |
|
||||||||||||
|
|
Definition at line 508 of file drivers/char/serial.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_CALLOUT_NOHUP, ASYNC_CHECK_CD, ASYNC_CTS_FLOW, ASYNC_HARDPPS_CD, async_icount::cts, async_icount::dcd, async_struct::delta_msr_wait, async_icount::dsr, async_struct::flags, serial_state::icount, async_struct::IER, async_struct::line, async_struct::open_wait, printk, async_icount::rng, RS_EVENT_WRITE_WAKEUP, rs_sched_event(), serial_in, serial_out, async_struct::state, status, async_struct::tty, tty_hangup(), UART_IER, UART_IER_THRI, UART_MSR, UART_MSR_ANY_DELTA, UART_MSR_CTS, UART_MSR_DCD, UART_MSR_DCTS, UART_MSR_DDCD, UART_MSR_DDSR, and UART_MSR_TERI. Here is the call graph for this function: ![]() |
|
|
|
|
|
Definition at line 2869 of file drivers/char/serial.c. References ASYNC_FOURPORT, async_struct::flags, serial_state::flags, serial_state::hub6, async_struct::hub6, inb_p, irqs, async_struct::magic, outb_p, async_struct::port, serial_state::port, probe_irq_off(), probe_irq_on(), serial_inp, SERIAL_MAGIC, serial_outp, UART_IER, UART_IIR, UART_LSR, UART_MCR, UART_MCR_DTR, UART_MCR_OUT1, UART_MCR_OUT2, UART_MCR_RTS, UART_MSR, UART_RX, UART_TX, udelay, x0f, x80, and xFF. Referenced by __initfunc(), and do_autoconfig(). Here is the call graph for this function: ![]() |
|
|
Definition at line 1884 of file drivers/char/serial.c. References ASYNC_AUTO_IRQ, autoconfig(), CAP_SYS_ADMIN, capable, serial_state::count, detect_uart_irq(), EBUSY, EPERM, serial_state::flags, serial_state::irq, serial_state::port, PORT_UNKNOWN, shutdown(), startup(), async_struct::state, and serial_state::type. Here is the call graph for this function: ![]() |
|
|
Definition at line 806 of file drivers/char/serial.c. References run_task_queue(). Here is the call graph for this function: ![]() |
|
|
Definition at line 811 of file drivers/char/serial.c. References async_struct::event, RS_EVENT_WRITE_WAKEUP, test_and_clear_bit, async_struct::tty, and tty. |
|
|
|
|
|
|
|
|
Definition at line 900 of file drivers/char/serial.c. References HZ, IRQ_timeout, and timeout. |
|
||||||||||||
|
Definition at line 2571 of file drivers/char/serial.c. References serial_state::count, do_softint(), ENOMEM, serial_state::flags, serial_state::info, kfree_s(), kmalloc(), memset, serial_state::port, SERIAL_MAGIC, and serial_state::xmit_fifo_size. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 1789 of file drivers/char/serial.c. References cli, put_user, restore_flags, result, save_flags, serial_in, TIOCSER_TEMT, UART_LSR, and UART_LSR_TEMT. |
|
||||||||||||
|
Definition at line 1803 of file drivers/char/serial.c. References cli, async_struct::MCR, put_user, restore_flags, result, save_flags, serial_in, TIOCM_CAR, TIOCM_CTS, TIOCM_DSR, TIOCM_DTR, TIOCM_OUT1, TIOCM_OUT2, TIOCM_RNG, TIOCM_RTS, UART_MCR_DTR, UART_MCR_OUT1, UART_MCR_OUT2, UART_MCR_RTS, UART_MSR, UART_MSR_CTS, UART_MSR_DCD, UART_MSR_DSR, and UART_MSR_RI. |
|
||||||||||||
|
||||||||||||
|
Definition at line 2716 of file drivers/char/serial.c. References serial_state::baud_base, async_icount::brk, cli, serial_state::flags, async_struct::flags, async_icount::frame, serial_state::icount, serial_state::info, serial_state::irq, serial_state::line, async_struct::magic, async_struct::MCR, async_icount::overrun, async_icount::parity, async_struct::port, serial_state::port, PORT_UNKNOWN, async_struct::quot, restore_flags, async_icount::rx, save_flags, serial_in, SERIAL_MAGIC, sprintf(), strcat, async_struct::tty, async_icount::tx, serial_state::type, UART_MCR, UART_MCR_DTR, UART_MCR_RTS, UART_MSR, UART_MSR_CTS, UART_MSR_DCD, UART_MSR_DSR, and UART_MSR_RI. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 384 of file drivers/char/serial.c. References ASYNC_SAK, async_icount::brk, do_SAK(), async_struct::flags, async_icount::frame, serial_state::icount, async_struct::ignore_status_mask, ignored, async_icount::overrun, async_icount::parity, printk, async_struct::read_status_mask, async_icount::rx, serial_inp, async_struct::state, async_struct::tty, tty, tty_flip_buffer_push, UART_LSR, UART_LSR_BI, UART_LSR_DR, UART_LSR_FE, UART_LSR_OE, UART_LSR_PE, and UART_RX. Here is the call graph for this function: ![]() |
|
|
Definition at line 89 of file sunserial.c. |
|
||||||||||||
|
Definition at line 1911 of file drivers/char/serial.c. References cli, async_struct::port, restore_flags, save_flags, serial_inp, serial_out, serial_paranoia_check(), UART_LCR, and UART_LCR_SBC. Here is the call graph for this function: ![]() |
|
|
Definition at line 1527 of file drivers/char/serial.c. References serial_paranoia_check(), and async_struct::xmit_cnt. Here is the call graph for this function: ![]() |
|
||||||||||||
|
|
Definition at line 1536 of file drivers/char/serial.c. References cli, restore_flags, save_flags, serial_paranoia_check(), async_struct::xmit_cnt, async_struct::xmit_head, and async_struct::xmit_tail. Here is the call graph for this function: ![]() |
|
|
Definition at line 1426 of file drivers/char/serial.c. References cli, async_struct::IER, restore_flags, save_flags, serial_out, serial_paranoia_check(), UART_IER, UART_IER_THRI, async_struct::xmit_buf, and async_struct::xmit_cnt. Here is the call graph for this function: ![]() |
|
|
Definition at line 2412 of file drivers/char/serial.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_NORMAL_ACTIVE, serial_state::count, async_struct::event, async_struct::flags, async_struct::open_wait, rs_flush_buffer(), serial_paranoia_check(), shutdown(), async_struct::state, and async_struct::tty. Here is the call graph for this function: ![]() |