#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/major.h>#include <linux/string.h>#include <linux/fcntl.h>#include <linux/ptrace.h>#include <linux/mm.h>#include <linux/malloc.h>#include <linux/init.h>#include <linux/delay.h>#include <asm/uaccess.h>#include <asm/8xx_immap.h>#include "commproc.h"Include dependency graph for uart.c:

Go to the source code of this file.
Defines | |
| #define | TX_WAKEUP ASYNC_SHARE_IRQ |
| #define | SERIAL_PARANOIA_CHECK |
| #define | CONFIG_SERIAL_NOPAUSE_IO |
| #define | SERIAL_DO_RESTART |
| #define | _INLINE_ inline |
| #define | DBG_CNT(s) |
| #define | smc_scc_num hub6 |
| #define | SCC_NUM_BASE 2 |
| #define | SCC_IDX_BASE 1 |
| #define | NR_PORTS (sizeof(rs_table)/sizeof(struct serial_state)) |
| #define | RX_NUM_FIFO 4 |
| #define | RX_BUF_SIZE 32 |
| #define | TX_NUM_FIFO 4 |
| #define | TX_BUF_SIZE 32 |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
Typedefs | |
| typedef serial_info | ser_info_t |
Functions | |
| static | DECLARE_TASK_QUEUE (tq_serial) |
| static int | serial_console_setup (struct console *co, char *options) |
| static void | change_speed (ser_info_t *info) |
| static void | rs_8xx_wait_until_sent (struct tty_struct *tty, int timeout) |
| static int | serial_paranoia_check (ser_info_t *info, kdev_t device, const char *routine) |
| static void | rs_8xx_stop (struct tty_struct *tty) |
| static void | rs_8xx_start (struct tty_struct *tty) |
| static _INLINE_ void | rs_sched_event (ser_info_t *info, int event) |
| static _INLINE_ void | receive_chars (ser_info_t *info) |
| static _INLINE_ void | transmit_chars (ser_info_t *info) |
| static void | rs_8xx_interrupt (void *dev_id) |
| static void | do_serial_bh (void) |
| static void | do_softint (void *private_) |
| static void | do_serial_hangup (void *private_) |
| static int | startup (ser_info_t *info) |
| static void | shutdown (ser_info_t *info) |
| static void | rs_8xx_put_char (struct tty_struct *tty, unsigned char ch) |
| static int | rs_8xx_write (struct tty_struct *tty, int from_user, const unsigned char *buf, int count) |
| static int | rs_8xx_write_room (struct tty_struct *tty) |
| static int | rs_8xx_chars_in_buffer (struct tty_struct *tty) |
| static void | rs_8xx_flush_buffer (struct tty_struct *tty) |
| static void | rs_8xx_send_xchar (struct tty_struct *tty, char ch) |
| static void | rs_8xx_throttle (struct tty_struct *tty) |
| static void | rs_8xx_unthrottle (struct tty_struct *tty) |
| static int | get_modem_info (ser_info_t *info, unsigned int *value) |
| static int | set_modem_info (ser_info_t *info, unsigned int cmd, unsigned int *value) |
| static void | begin_break (ser_info_t *info) |
| static void | end_break (ser_info_t *info) |
| static void | send_break (ser_info_t *info, int duration) |
| static int | rs_8xx_ioctl (struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) |
| static void | rs_8xx_set_termios (struct tty_struct *tty, struct termios *old_termios) |
| static void | rs_8xx_close (struct tty_struct *tty, struct file *filp) |
| static void | rs_8xx_hangup (struct tty_struct *tty) |
| static int | block_til_ready (struct tty_struct *tty, struct file *filp, ser_info_t *info) |
| static int | get_async_struct (int line, ser_info_t **ret_info) |
| static int | rs_8xx_open (struct tty_struct *tty, struct file *filp) |
| static int | line_info (char *buf, struct serial_state *state) |
| int | rs_8xx_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data) |
| static _INLINE_ void | show_serial_version (void) |
| __initfunc (int rs_8xx_init(void)) | |
| __initfunc (static int serial_console_setup(struct console *co, char *options)) | |
Variables | |
| static char * | serial_name = "CPM UART driver" |
| static char * | serial_version = "0.02" |
| static struct tty_driver serial_driver | callout_driver |
| static int | serial_refcount |
| 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 int | baud_table [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 127 of file uart.c. Referenced by __initfunc(), dma_init(), eexp_hw_rxinit(), hardware_init(), init_rx_bufs(), receive_special_dma(), rxdma_to_tty(), sis900_init_rx_ring(), sis900_rx(), startup(), and znet_rx(). |
|
|
Definition at line 126 of file uart.c. Referenced by __initfunc(). |
|
|
Definition at line 108 of file uart.c. Referenced by __initfunc(), change_speed(), rs_8xx_close(), rs_8xx_interrupt(), rs_8xx_start(), rs_8xx_stop(), shutdown(), and startup(). |
|
|
Definition at line 104 of file uart.c. Referenced by __initfunc(), begin_break(), block_til_ready(), change_speed(), end_break(), line_info(), rs_8xx_close(), rs_8xx_interrupt(), rs_8xx_start(), rs_8xx_stop(), shutdown(), and startup(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 129 of file uart.c. Referenced by __initfunc(), change_speed(), eexp_hw_lasttxstat(), eexp_hw_tx_pio(), eexp_hw_txinit(), el16_interrupt(), hardware_send_packet(), rs_8xx_write(), rs_8xx_write_room(), rtl8129_init_ring(), rtl8129_open(), and rtl8139_init_ring(). |
|
|
Definition at line 128 of file uart.c. Referenced by __initfunc(). |
|
|
Definition at line 60 of file uart.c. Referenced by rs_8xx_flush_buffer(), rs_8xx_write(), rs_8xx_write_room(), and transmit_chars(). |
|
|
|
|
|
Definition at line 2599 of file uart.c. References __pa, B9600, BD_SC_WRAP, cpm_buf_desc::cbd_bufaddr, cpm_buf_desc::cbd_sc, CLOCAL, comm_proc::cp_cpcr, comm_proc::cp_dparam, comm_proc::cp_dpmem, comm_proc::cp_pbpar, comm_proc::cp_smc, CPM_CR_CH_SMC1, CPM_CR_FLG, CPM_CR_INIT_TRX, cpmp, CREAD, CS8, m8xx_cpm_dpalloc(), m8xx_cpm_hostalloc(), m8xx_cpm_setbrg(), mk_cr_cmd, serial_state::port, printk, SMC_EB, smc_uart::smc_maxidl, smc_uart::smc_mrblr, smc_uart::smc_rbase, smc_uart::smc_rfcr, smc::smc_smcmr, smc_uart::smc_tbase, smc_uart::smc_tfcr, SMCMR_REN, SMCMR_SM_UART, SMCMR_TEN, smcr_mk_clen, sp, and uint. Here is the call graph for this function: ![]() |
|
|
|
Definition at line 1255 of file uart.c. References chan(), comm_proc::cp_cpcr, CPM_CR_CH_SCC1, CPM_CR_CH_SCC2, CPM_CR_CH_SCC3, CPM_CR_CH_SCC4, CPM_CR_CH_SMC1, CPM_CR_CH_SMC2, CPM_CR_FLG, CPM_CR_STOP_TX, cpmp, mk_cr_cmd, num, SCC_NUM_BASE, serial_info::state, and ushort. Referenced by rs_8xx_ioctl(), and send_break(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 1732 of file uart.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_CLOSING, ASYNC_HUP_NOTIFY, ASYNC_INITIALIZED, ASYNC_NORMAL_ACTIVE, ASYNC_PGRP_LOCKOUT, ASYNC_SESSION_LOCKOUT, serial_info::blocked_open, termios::c_cflag, CBAUD, cli, CLOCAL, serial_info::close_wait, serial_state::count, current, EAGAIN, EBUSY, ERESTARTSYS, serial_info::flags, interruptible_sleep_on(), serial_info::line, serial_state::line, serial_state::normal_termios, NULL, O_NONBLOCK, serial_info::open_wait, serial_info::pgrp, printk, SCC_NUM_BASE, schedule(), serial_in, serial_inp, serial_out, SERIAL_TYPE_CALLOUT, serial_info::session, signal_pending, serial_info::state, state, sti, TASK_INTERRUPTIBLE, TASK_RUNNING, tty_hung_up_p(), UART_MCR, UART_MCR_DTR, UART_MCR_RTS, and UART_MSR. Here is the call graph for this function: ![]() |
|
|
Definition at line 774 of file uart.c. References ASYNC_CHECK_CD, ASYNC_CTS_FLOW, ASYNC_HARDPPS_CD, baud_table, BD_SC_BR, BD_SC_EMPTY, BD_SC_FR, BD_SC_OV, BD_SC_PR, CBAUD, CBAUDEX, cli, CLOCAL, comm_proc::cp_scc, comm_proc::cp_smc, cpmp, CREAD, CRTSCTS, CS5, CS6, CS7, CS8, CSIZE, CSTOPB, serial_info::flags, HZ, i, m8xx_cpm_setbrg(), PARENB, PARODD, restore_flags, save_flags, SCC_IDX_BASE, SCC_NUM_BASE, scc::scc_pmsr, SCU_PMSR_PEN, SCU_PMSR_REVP, SCU_PMSR_SL, SCU_PMSR_TEVP, serial_out, smc::smc_smcmr, SMCMR_PEN, SMCMR_PM_EVEN, SMCMR_REN, SMCMR_SL, SMCMR_SM_UART, SMCMR_TEN, smcr_mk_clen, serial_info::timeout, serial_info::tty, TX_BUF_SIZE, UART_IER, and UART_IER_MSI. Here is the call graph for this function: ![]() |
|
|
|
|
|
Definition at line 575 of file uart.c. References run_task_queue(). Here is the call graph for this function: ![]() |
|
|
Definition at line 606 of file uart.c. References async_struct::tty, tty, and tty_hangup(). Referenced by __initfunc(), change_speed(), and rs_init(). Here is the call graph for this function: ![]() |
|
|
Definition at line 580 of file uart.c. References serial_info::event, RS_EVENT_WRITE_WAKEUP, test_and_clear_bit, serial_info::tty, and tty. |
|
|
Definition at line 1283 of file uart.c. References chan(), comm_proc::cp_cpcr, CPM_CR_CH_SCC1, CPM_CR_CH_SCC2, CPM_CR_CH_SCC3, CPM_CR_CH_SCC4, CPM_CR_CH_SMC1, CPM_CR_CH_SMC2, CPM_CR_FLG, CPM_CR_RESTART_TX, cpmp, mk_cr_cmd, num, SCC_NUM_BASE, and ushort. Referenced by rs_8xx_ioctl(), and send_break(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 1873 of file uart.c. References serial_state::count, ENOMEM, and serial_state::info. |
|
||||||||||||
|
Definition at line 1167 of file uart.c. References cli, put_user, result, serial_in, sti, 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_DSR, and UART_MSR_RI. |
|
||||||||||||
|
Definition at line 1954 of file uart.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, ret, async_icount::rx, SCC_NUM_BASE, serial_in, SERIAL_MAGIC, sprintf(), sti, 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_DSR, and UART_MSR_RI. Here is the call graph for this function: ![]() |
|
|
Definition at line 290 of file uart.c. References __va, ASYNC_SAK, BD_SC_BR, BD_SC_EMPTY, BD_SC_FR, BD_SC_OV, BD_SC_PR, BD_SC_WRAP, async_icount::brk, cpm_buf_desc::cbd_bufaddr, cpm_buf_desc::cbd_datlen, cpm_buf_desc::cbd_sc, do_SAK(), serial_info::flags, async_icount::frame, i, serial_state::icount, async_icount::overrun, async_icount::parity, printk, queue_task, serial_info::read_status_mask, async_icount::rx, serial_info::rx_bd_base, serial_info::rx_cur, serial_info::state, status, tq_timer, serial_info::tty, tty, and ushort. Here is the call graph for this function: ![]() |
|
|
Definition at line 1019 of file uart.c. References serial_paranoia_check(). Referenced by __initfunc(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
|
Definition at line 1028 of file uart.c. References serial_info::flags, serial_paranoia_check(), and TX_WAKEUP. Referenced by __initfunc(), and rs_8xx_hangup(). Here is the call graph for this function: ![]() |
|
|
Definition at line 1708 of file uart.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_NORMAL_ACTIVE, serial_state::count, serial_info::event, serial_info::flags, serial_info::open_wait, rs_8xx_flush_buffer(), serial_paranoia_check(), shutdown(), serial_info::state, state, and serial_info::tty. Referenced by __initfunc(). Here is the call graph for this function: ![]() |
|
|
Definition at line 517 of file uart.c. References check_modem_status(), comm_proc::cp_scc, comm_proc::cp_smc, cpmp, events, jiffies, serial_info::last_active, printk, receive_chars(), SCC_IDX_BASE, SCC_NUM_BASE, scc::scc_scce, SCCM_RX, SCCM_TX, smc::smc_smce, SMCM_RX, SMCM_TX, serial_info::state, transmit_chars(), and u_char. Referenced by __initfunc(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||
|
Definition at line 1329 of file uart.c. References begin_break(), cli, CLOCAL, serial_icounter_struct::cts, async_icount::cts, current, serial_icounter_struct::dcd, async_icount::dcd, serial_icounter_struct::dsr, async_icount::dsr, EINTR, EIO, end_break(), ENODEV, ENOIOCTLCMD, ERESTARTSYS, error, get_lsr_info(), get_modem_info(), get_user, HZ, interruptible_sleep_on(), put_user, serial_icounter_struct::rng, async_icount::rng, send_break(), serial_paranoia_check(), set_modem_info(), signal_pending, sti, TCSBRK, TCSBRKP, TIOCCBRK, TIOCGICOUNT, TIOCGSOFTCAR, TIOCM_CD, TIOCM_CTS, TIOCM_DSR, TIOCM_RNG, TIOCMBIC, TIOCMBIS, TIOCMGET, TIOCMIWAIT, TIOCMSET, TIOCSBRK, TIOCSERGETLSR, TIOCSSOFTCAR, tty_check_change(), and tty_wait_until_sent(). Referenced by __initfunc(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 1894 of file uart.c. References ASYNC_SPLIT_TERMIOS, block_til_ready(), change_speed(), current, ENODEV, get_async_struct(), line, MINOR, MOD_INC_USE_COUNT, NR_PORTS, printk, serial_paranoia_check(), SERIAL_TYPE_NORMAL, and startup(). Referenced by __initfunc(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 914 of file uart.c. References __va, BD_SC_READY, BD_SC_WRAP, cpm_buf_desc::cbd_bufaddr, cpm_buf_desc::cbd_datlen, cpm_buf_desc::cbd_sc, serial_paranoia_check(), serial_info::tx_bd_base, and serial_info::tx_cur. Referenced by __initfunc(). Here is the call graph for this function: ![]() |
|