lantiq.c (92a19f9cec9a80ad93c06e115822deb729e2c6ad) | lantiq.c (2e124b4a390ca85325fae75764bef92f0547fa25) |
---|---|
1/* 2 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 as published 6 * by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, --- 149 unchanged lines hidden (view full) --- 158lqasc_enable_ms(struct uart_port *port) 159{ 160} 161 162static int 163lqasc_rx_chars(struct uart_port *port) 164{ 165 struct tty_port *tport = &port->state->port; | 1/* 2 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 as published 6 * by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, --- 149 unchanged lines hidden (view full) --- 158lqasc_enable_ms(struct uart_port *port) 159{ 160} 161 162static int 163lqasc_rx_chars(struct uart_port *port) 164{ 165 struct tty_port *tport = &port->state->port; |
166 struct tty_struct *tty = tty_port_tty_get(tport); | |
167 unsigned int ch = 0, rsr = 0, fifocnt; 168 | 166 unsigned int ch = 0, rsr = 0, fifocnt; 167 |
169 if (!tty) { 170 dev_dbg(port->dev, "%s:tty is busy now", __func__); 171 return -EBUSY; 172 } 173 fifocnt = 174 ltq_r32(port->membase + LTQ_ASC_FSTAT) & ASCFSTAT_RXFFLMASK; | 168 fifocnt = ltq_r32(port->membase + LTQ_ASC_FSTAT) & ASCFSTAT_RXFFLMASK; |
175 while (fifocnt--) { 176 u8 flag = TTY_NORMAL; 177 ch = ltq_r8(port->membase + LTQ_ASC_RBUF); 178 rsr = (ltq_r32(port->membase + LTQ_ASC_STATE) 179 & ASCSTATE_ANY) | UART_DUMMY_UER_RX; | 169 while (fifocnt--) { 170 u8 flag = TTY_NORMAL; 171 ch = ltq_r8(port->membase + LTQ_ASC_RBUF); 172 rsr = (ltq_r32(port->membase + LTQ_ASC_STATE) 173 & ASCSTATE_ANY) | UART_DUMMY_UER_RX; |
180 tty_flip_buffer_push(tty); | 174 tty_flip_buffer_push(tport); |
181 port->icount.rx++; 182 183 /* 184 * Note that the error handling code is 185 * out of the main execution path 186 */ 187 if (rsr & ASCSTATE_ANY) { 188 if (rsr & ASCSTATE_PE) { --- 25 unchanged lines hidden (view full) --- 214 if (rsr & ASCSTATE_ROE) 215 /* 216 * Overrun is special, since it's reported 217 * immediately, and doesn't affect the current 218 * character 219 */ 220 tty_insert_flip_char(tport, 0, TTY_OVERRUN); 221 } | 175 port->icount.rx++; 176 177 /* 178 * Note that the error handling code is 179 * out of the main execution path 180 */ 181 if (rsr & ASCSTATE_ANY) { 182 if (rsr & ASCSTATE_PE) { --- 25 unchanged lines hidden (view full) --- 208 if (rsr & ASCSTATE_ROE) 209 /* 210 * Overrun is special, since it's reported 211 * immediately, and doesn't affect the current 212 * character 213 */ 214 tty_insert_flip_char(tport, 0, TTY_OVERRUN); 215 } |
216 |
|
222 if (ch != 0) | 217 if (ch != 0) |
223 tty_flip_buffer_push(tty); 224 tty_kref_put(tty); | 218 tty_flip_buffer_push(tport); 219 |
225 return 0; 226} 227 228static void 229lqasc_tx_chars(struct uart_port *port) 230{ 231 struct circ_buf *xmit = &port->state->xmit; 232 if (uart_tx_stopped(port)) { --- 546 unchanged lines hidden --- | 220 return 0; 221} 222 223static void 224lqasc_tx_chars(struct uart_port *port) 225{ 226 struct circ_buf *xmit = &port->state->xmit; 227 if (uart_tx_stopped(port)) { --- 546 unchanged lines hidden --- |