#include <linux/config.h>#include <linux/module.h>#include <linux/version.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/smp_lock.h>#include <linux/pci.h>#include <asm/system.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/segment.h>#include <asm/bitops.h>#include <asm/uaccess.h>Include dependency graph for mxser.c:

Go to the source code of this file.
Data Structures | |
| struct | mxser_mstatus |
Defines | |
| #define | MXSER_VERSION "1.1kern" |
| #define | MXSERMAJOR 174 |
| #define | MXSERCUMAJOR 175 |
| #define | MXSER_EVENT_TXLOW 1 |
| #define | MXSER_EVENT_HANGUP 2 |
| #define | SERIAL_DO_RESTART |
| #define | MXSER_BOARDS 4 |
| #define | MXSER_PORTS 32 |
| #define | MXSER_PORTS_PER_BOARD 8 |
| #define | MXSER_ISR_PASS_LIMIT 256 |
| #define | MXSER_ERR_IOADDR -1 |
| #define | MXSER_ERR_IRQ -2 |
| #define | MXSER_ERR_IRQ_CONFLIT -3 |
| #define | MXSER_ERR_VECTOR -4 |
| #define | SERIAL_TYPE_NORMAL 1 |
| #define | SERIAL_TYPE_CALLOUT 2 |
| #define | WAKEUP_CHARS 256 |
| #define | UART_MCR_AFE 0x20 |
| #define | UART_LSR_SPECIAL 0x1E |
| #define | PORTNO(x) (MINOR((x)->device) - (x)->driver.minor_start) |
| #define | RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
| #define | IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | PCI_VENDOR_ID_MOXA 0x1393 |
| #define | PCI_DEVICE_ID_C168 0x1680 |
| #define | PCI_DEVICE_ID_C104 0x1040 |
| #define | C168_ASIC_ID 1 |
| #define | C104_ASIC_ID 2 |
| #define | CI104J_ASIC_ID 5 |
| #define | MOXA 0x400 |
| #define | MOXA_GETDATACOUNT (MOXA + 23) |
| #define | MOXA_GET_CONF (MOXA + 35) |
| #define | MOXA_DIAGNOSE (MOXA + 50) |
| #define | MOXA_CHKPORTENABLE (MOXA + 60) |
| #define | MOXA_HighSpeedOn (MOXA + 61) |
| #define | MOXA_GET_MAJOR (MOXA + 63) |
| #define | MOXA_GET_CUMAJOR (MOXA + 64) |
| #define | MOXA_GETMSTATUS (MOXA + 65) |
| #define | B921600 (B460800 +1) |
| #define | CHIP_SK 0x01 |
| #define | CHIP_DO 0x02 |
| #define | CHIP_CS 0x04 |
| #define | CHIP_DI 0x08 |
| #define | EN_CCMD 0x000 |
| #define | EN0_RSARLO 0x008 |
| #define | EN0_RSARHI 0x009 |
| #define | EN0_RCNTLO 0x00A |
| #define | EN0_RCNTHI 0x00B |
| #define | EN0_DCFG 0x00E |
| #define | EN0_PORT 0x010 |
| #define | ENC_PAGE0 0x000 |
| #define | ENC_PAGE3 0x0C0 |
Typedefs | |
| typedef _moxa_pci_info | moxa_pci_info |
Enumerations | |
| enum | { MXSER_BOARD_C168_ISA = 1, MXSER_BOARD_C104_ISA, MXSER_BOARD_CI104J, MXSER_BOARD_C168_PCI, MXSER_BOARD_C104_PCI } |
Functions | |
| static void | mxser_getcfg (int board, struct mxser_hwconf *hwconf) |
| int | mxser_init (void) |
| static int | mxser_get_ISA_conf (int, struct mxser_hwconf *) |
| static int | mxser_get_PCI_conf (int, int, int, struct mxser_hwconf *) |
| static void | mxser_do_softint (void *) |
| static int | mxser_open (struct tty_struct *, struct file *) |
| static void | mxser_close (struct tty_struct *, struct file *) |
| static int | mxser_write (struct tty_struct *, int, const unsigned char *, int) |
| static int | mxser_write_room (struct tty_struct *) |
| static void | mxser_flush_buffer (struct tty_struct *) |
| static int | mxser_chars_in_buffer (struct tty_struct *) |
| static void | mxser_flush_chars (struct tty_struct *) |
| static void | mxser_put_char (struct tty_struct *, unsigned char) |
| static int | mxser_ioctl (struct tty_struct *, struct file *, uint, ulong) |
| static int | mxser_ioctl_special (unsigned int, unsigned long) |
| static void | mxser_throttle (struct tty_struct *) |
| static void | mxser_unthrottle (struct tty_struct *) |
| static void | mxser_set_termios (struct tty_struct *, struct termios *) |
| static void | mxser_stop (struct tty_struct *) |
| static void | mxser_start (struct tty_struct *) |
| static void | mxser_hangup (struct tty_struct *) |
| static void | mxser_interrupt (int, void *, struct pt_regs *) |
| static void | mxser_receive_chars (struct mxser_struct *, int *) |
| static void | mxser_transmit_chars (struct mxser_struct *) |
| static void | mxser_check_modem_status (struct mxser_struct *, int) |
| static int | mxser_block_til_ready (struct tty_struct *, struct file *, struct mxser_struct *) |
| static int | mxser_startup (struct mxser_struct *) |
| static void | mxser_shutdown (struct mxser_struct *) |
| static int | mxser_change_speed (struct mxser_struct *, struct termios *old_termios) |
| static int | mxser_get_serial_info (struct mxser_struct *, struct serial_struct *) |
| static int | mxser_set_serial_info (struct mxser_struct *, struct serial_struct *) |
| static int | mxser_get_lsr_info (struct mxser_struct *, unsigned int *) |
| static void | mxser_send_break (struct mxser_struct *, int) |
| static int | mxser_get_modem_info (struct mxser_struct *, unsigned int *) |
| static int | mxser_set_modem_info (struct mxser_struct *, unsigned int, unsigned int *) |
| int | mxser_initbrd (int board, struct mxser_hwconf *hwconf) |
| static int | mxser_ioctl (struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) |
| static int | mxser_read_register (int, unsigned short *) |
| static int | mxser_program_mode (int) |
| static void | mxser_normal_mode (int) |
Variables | |
| static char * | mxser_brdname [] |
| static int | mxser_numports [] |
| static mxser_pciinfo | mxser_pcibrds [] |
| static int | ioaddr [MXSER_BOARDS] = {0, 0, 0, 0} |
| static int | ttymajor = MXSERMAJOR |
| static int | calloutmajor = MXSERCUMAJOR |
| static int | verbose = 0 |
| static struct mxser_mstatus | GMStatus [MXSER_PORTS] |
| static int | mxserBoardCAP [MXSER_BOARDS] |
| static struct tty_driver mxvar_sdriver | mxvar_cdriver |
| static int | mxvar_refcount |
| static struct mxser_struct | mxvar_table [MXSER_PORTS] |
| static struct tty_struct * | mxvar_tty [MXSER_PORTS+1] |
| static struct termios * | mxvar_termios [MXSER_PORTS+1] |
| static struct termios * | mxvar_termios_locked [MXSER_PORTS+1] |
| static struct mxser_log | mxvar_log |
| static int | mxvar_diagflag |
| static unsigned char * | mxvar_tmp_buf = 0 |
| static struct semaphore | mxvar_tmp_buf_sem = MUTEX |
| static int | mxvar_baud_table [] |
| mxser_hwconf | mxsercfg [MXSER_BOARDS] |
|
|
|
|
|
Definition at line 119 of file mxser.c. Referenced by mxser_get_ISA_conf(), and mxser_program_mode(). |
|
|
Definition at line 118 of file mxser.c. Referenced by mxser_get_ISA_conf(), and mxser_program_mode(). |
|
|
Definition at line 2354 of file mxser.c. Referenced by mxser_read_register(). |
|
|
Definition at line 2355 of file mxser.c. Referenced by mxser_read_register(). |
|
|
Definition at line 2353 of file mxser.c. Referenced by mxser_read_register(). |
|
|
Definition at line 2352 of file mxser.c. Referenced by mxser_read_register(). |
|
|
Definition at line 120 of file mxser.c. Referenced by mxser_get_ISA_conf(), and mxser_program_mode(). |
|
|
Definition at line 2361 of file mxser.c. Referenced by __initfunc(), and NS8390_init(). |
|
|
|
|
|
Definition at line 2360 of file mxser.c. Referenced by __initfunc(), ei_rx_overrun(), etherh_block_input(), etherh_block_output(), etherh_get_header(), etherh_getifstat(), etherh_setif(), hp_block_input(), hp_block_output(), hp_get_8390_hdr(), ne2k_pci_block_input(), ne2k_pci_block_output(), ne2k_pci_get_8390_hdr(), ne_block_input(), ne_block_output(), ne_get_8390_hdr(), and NS8390_init(). |
|
|
Definition at line 2359 of file mxser.c. Referenced by __initfunc(), ei_rx_overrun(), etherh_block_input(), etherh_block_output(), etherh_get_header(), hp_block_input(), hp_block_output(), hp_get_8390_hdr(), ne2k_pci_block_input(), ne2k_pci_block_output(), ne2k_pci_get_8390_hdr(), ne_block_input(), ne_block_output(), ne_get_8390_hdr(), and NS8390_init(). |
|
|
Definition at line 2358 of file mxser.c. Referenced by __initfunc(), etherh_block_input(), etherh_block_output(), etherh_get_header(), hp_block_input(), hp_block_output(), hp_get_8390_hdr(), ne2k_pci_block_input(), ne2k_pci_block_output(), ne2k_pci_get_8390_hdr(), ne_block_input(), ne_block_output(), and ne_get_8390_hdr(). |
|
|
Definition at line 2357 of file mxser.c. Referenced by __initfunc(), etherh_block_input(), etherh_block_output(), etherh_get_header(), hp_block_input(), hp_block_output(), hp_get_8390_hdr(), ne2k_pci_block_input(), ne2k_pci_block_output(), ne2k_pci_get_8390_hdr(), ne_block_input(), ne_block_output(), and ne_get_8390_hdr(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 155 of file mxser.c. Referenced by mxser_ioctl_special(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 156 of file mxser.c. Referenced by mxser_ioctl(). |
|
|
|
|
|
Definition at line 81 of file mxser.c. Referenced by mxser_get_PCI_conf(), and mxser_init(). |
|
|
Definition at line 82 of file mxser.c. Referenced by mxser_get_ISA_conf(), mxser_get_PCI_conf(), and mxser_init(). |
|
|
Definition at line 83 of file mxser.c. Referenced by mxser_get_ISA_conf(), and mxser_init(). |
|
|
Definition at line 84 of file mxser.c. Referenced by mxser_get_ISA_conf(), mxser_get_PCI_conf(), and mxser_init(). |
|
|
Definition at line 71 of file mxser.c. Referenced by mxser_check_modem_status(), and mxser_do_softint(). |
|
|
Definition at line 70 of file mxser.c. Referenced by mxser_check_modem_status(), mxser_do_softint(), and mxser_transmit_chars(). |
|
|
Definition at line 79 of file mxser.c. Referenced by mxser_interrupt(). |
|
|
|
|
|
Definition at line 78 of file mxser.c. Referenced by mxser_init(), mxser_initbrd(), and mxser_interrupt(). |
|
|
Definition at line 64 of file mxser.c. Referenced by mxser_init(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 92 of file mxser.c. Referenced by mxser_receive_chars(). |
|
|
Definition at line 91 of file mxser.c. Referenced by mxser_change_speed(). |
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
Definition at line 1532 of file mxser.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_CLOSING, ASYNC_HUP_NOTIFY, ASYNC_INITIALIZED, ASYNC_NORMAL_ACTIVE, ASYNC_PGRP_LOCKOUT, ASYNC_SESSION_LOCKOUT, mxser_struct::base, mxser_struct::blocked_open, termios::c_cflag, cli, CLOCAL, mxser_struct::close_wait, mxser_struct::count, current, EAGAIN, EBUSY, ERESTARTSYS, mxser_struct::flags, inb, interruptible_sleep_on(), mxser_struct::normal_termios, NULL, O_NONBLOCK, mxser_struct::open_wait, outb, mxser_struct::pgrp, restore_flags, save_flags, schedule(), SERIAL_TYPE_CALLOUT, mxser_struct::session, signal_pending, TASK_INTERRUPTIBLE, TASK_RUNNING, tty_hung_up_p(), UART_MCR, UART_MCR_DTR, UART_MCR_RTS, UART_MSR, and UART_MSR_DCD. Referenced by mxser_open(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
|
Definition at line 998 of file mxser.c. References mxser_struct::xmit_cnt. Referenced by mxser_init(). |
|
||||||||||||
|
||||||||||||
|
Definition at line 794 of file mxser.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_CLOSING, ASYNC_CLOSING_WAIT_NONE, ASYNC_INITIALIZED, ASYNC_NORMAL_ACTIVE, mxser_struct::base, mxser_struct::callout_termios, cli, mxser_struct::closing_wait, mxser_struct::count, current, mxser_struct::flags, HZ, mxser_struct::IER, inb, jiffies, MOD_DEC_USE_COUNT, mxser_shutdown(), mxser_struct::normal_termios, outb, mxser_struct::port, PORTNO, printk, restore_flags, save_flags, schedule_timeout, TASK_INTERRUPTIBLE, timeout, tty_hung_up_p(), tty_wait_until_sent(), UART_IER, UART_IER_RLSI, UART_LSR, and UART_LSR_TEMT. Referenced by mxser_init(). Here is the call graph for this function: ![]() |
|
|
Definition at line 706 of file mxser.c. References mxser_struct::event, MXSER_EVENT_HANGUP, MXSER_EVENT_TXLOW, test_and_clear_bit, mxser_struct::tty, tty, and tty_hangup(). Referenced by mxser_initbrd(). Here is the call graph for this function: ![]() |
|
|
Definition at line 1005 of file mxser.c. References cli, restore_flags, save_flags, mxser_struct::xmit_cnt, mxser_struct::xmit_head, and mxser_struct::xmit_tail. Referenced by mxser_hangup(), and mxser_init(). |
|
|
Definition at line 971 of file mxser.c. References mxser_struct::base, cli, mxser_struct::IER, outb, restore_flags, save_flags, UART_IER, UART_IER_THRI, mxser_struct::xmit_buf, and mxser_struct::xmit_cnt. Referenced by mxser_init(). |
|
||||||||||||
|
Definition at line 2294 of file mxser.c. References mxser_hwconf::baud_base, mxser_hwconf::board_type, C104_ASIC_ID, C168_ASIC_ID, CI104J_ASIC_ID, id, inb, mxser_hwconf::ioaddr, mxser_hwconf::irq, irq, MXSER_BOARD_C104_ISA, MXSER_BOARD_C168_ISA, MXSER_BOARD_CI104J, MXSER_ERR_IRQ, MXSER_ERR_IRQ_CONFLIT, MXSER_ERR_VECTOR, mxser_read_register(), outb, PORT_16450, PORT_16550A, mxser_hwconf::ports, UART_EFR, UART_FCR, UART_FCR_ENABLE_FIFO, UART_IIR, UART_LCR, UART_LCR_DLAB, mxser_hwconf::uart_type, mxser_hwconf::vector, mxser_hwconf::vector_mask, and x80. Referenced by mxser_init(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 2198 of file mxser.c. References cli, inb, put_user, restore_flags, result, save_flags, status, TIOCSER_TEMT, UART_LSR, and UART_LSR_TEMT. Referenced by mxser_ioctl(). |
|
||||||||||||
|
Definition at line 2230 of file mxser.c. References mxser_struct::base, cli, inb, mxser_struct::MCR, mxser_check_modem_status(), put_user, restore_flags, result, save_flags, status, TIOCM_CAR, TIOCM_CTS, TIOCM_DSR, TIOCM_DTR, TIOCM_RNG, TIOCM_RTS, UART_MCR_DTR, UART_MCR_RTS, UART_MSR, UART_MSR_ANY_DELTA, UART_MSR_CTS, UART_MSR_DCD, UART_MSR_DSR, and UART_MSR_RI. Referenced by mxser_ioctl(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||
|
Definition at line 455 of file mxser.c. References mxser_hwconf::baud_base, mxser_hwconf::board_type, mxser_hwconf::ioaddr, mxser_hwconf::irq, MXSER_ERR_IOADDR, MXSER_ERR_IRQ, MXSER_ERR_VECTOR, mxser_numports, PCI_BASE_ADDRESS_2, PCI_BASE_ADDRESS_3, PCI_INTERRUPT_LINE, pcibios_read_config_dword(), PORT_16550A, ports, mxser_hwconf::ports, mxser_hwconf::uart_type, val, mxser_hwconf::vector, mxser_hwconf::vector_mask, and xffffffff. Referenced by mxser_init(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 2118 of file mxser.c. References mxser_struct::base, mxser_struct::baud_base, mxser_struct::close_delay, mxser_struct::closing_wait, copy_to_user, mxser_struct::custom_divisor, EFAULT, mxser_struct::flags, mxser_struct::irq, memset, mxser_struct::port, and mxser_struct::type. Referenced by mxser_ioctl(). |
|
||||||||||||
|
Definition at line 450 of file mxser.c. Referenced by mxser_init(). |
|
|
Definition at line 1337 of file mxser.c. References ASYNC_CALLOUT_ACTIVE, ASYNC_NORMAL_ACTIVE, mxser_struct::count, mxser_struct::event, mxser_struct::flags, mxser_flush_buffer(), mxser_shutdown(), mxser_struct::open_wait, and mxser_struct::tty. Referenced by mxser_init(). Here is the call graph for this function: ![]() |
|