static void ambauart_tx_chars(struct uart_info *info) { struct uart_port *port = info->port; int count; if (port->x_char) { UART_PUT_CHAR(port, port->x_char); port->icount.tx++; port->x_char = 0; return; } if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { ambauart_stop_tx(port, 0); return; } count = port->fifosize >> 1; do { UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; if (info->xmit.head == info->xmit.tail) break; } while (--count > 0); if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); if (info->xmit.head == info->xmit.tail) ambauart_stop_tx(info->port, 0); }
static int plser_tx_chars(struct uart_info *info) { struct uart_port *port = info->port; if (port->x_char) { if (! plser_tx_available(port)) { return 1; } plser_writeb(port, port->x_char, SER_DATA); port->icount.tx++; port->x_char = 0; return 0; } if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { plser_stop_tx(info->port, 0); return 0; } /* * Tried using FIFO (not checking TNF) for fifo fill: * still had the '4 bytes repeated' problem. */ while (plser_tx_available(port)) { plser_writeb(port, info->xmit.buf[info->xmit.tail], SER_DATA); info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; if (info->xmit.head == info->xmit.tail) break; } if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); if (info->xmit.head == info->xmit.tail) plser_stop_tx(info->port, 0); else return 1; return 0; }
static inline void anakin_tx_chars(struct uart_info *info) { if (info->x_char) { anakin_transmit_x_char(info); return; } if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { anakin_stop_tx(info->port, 0); return; } anakin_transmit_buffer(info); if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); }
static void omahauart_tx_chars(struct uart_info *info) { struct uart_port *port = info->port; volatile unsigned int status; if (port->x_char) { UART_PUT_CHAR(port, port->x_char); port->icount.tx++; port->x_char = 0; return; } if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { omahauart_stop_tx(port, 0); return; } status = UART_FIFO_STATUS(info->port); // FIll FIFO as far as possible while(UART_TX_DATA(UART_FIFO_STATUS(info->port))) { UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; if (info->xmit.head == info->xmit.tail) break; } if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); if (info->xmit.head == info->xmit.tail) omahauart_stop_tx(info->port, 0); }
static void clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs) { struct uart_info *info = dev_id; struct uart_port *port = info->port; int count; if (port->x_char) { clps_writel(port->x_char, UARTDR(port)); port->icount.tx++; port->x_char = 0; return; } if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { clps711xuart_stop_tx(info->port, 0); return; } count = port->fifosize >> 1; do { clps_writel(info->xmit.buf[info->xmit.tail], UARTDR(port)); info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; if (info->xmit.head == info->xmit.tail) break; } while (--count > 0); if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); if (info->xmit.head == info->xmit.tail) clps711xuart_stop_tx(info->port, 0); }
static void sa1100_tx_chars(struct uart_info *info) { struct uart_port *port = info->port; if (port->x_char) { UART_PUT_CHAR(port, port->x_char); port->icount.tx++; port->x_char = 0; return; } if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { sa1100_stop_tx(info->port, 0); return; } /* * Tried using FIFO (not checking TNF) for fifo fill: * still had the '4 bytes repeated' problem. */ while (UART_GET_UTSR1(port) & UTSR1_TNF) { UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; if (info->xmit.head == info->xmit.tail) break; } if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); if (info->xmit.head == info->xmit.tail) sa1100_stop_tx(info->port, 0); }
static inline void main_event(void) { uart_event(); }