提交 ebd2c8f6 编写于 作者: A Alan Cox 提交者: Live-CD User

serial: kill off uart_info

We moved this into uart_state, now move the fields out of the separate
structure and kill it off.
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 11d85d7b
......@@ -95,7 +95,7 @@ void foo(void)
OFFSET(__iobase, mn10300_serial_port, _iobase);
DEFINE(__UART_XMIT_SIZE, UART_XMIT_SIZE);
OFFSET(__xmit_buffer, uart_info, xmit.buf);
OFFSET(__xmit_head, uart_info, xmit.head);
OFFSET(__xmit_tail, uart_info, xmit.tail);
OFFSET(__xmit_buffer, uart_state, xmit.buf);
OFFSET(__xmit_head, uart_state, xmit.head);
OFFSET(__xmit_tail, uart_state, xmit.tail);
}
......@@ -86,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port)
static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int status, ch, flag, rxs, max_count = 256;
status = *CSR_UARTFLG;
......@@ -124,7 +124,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
static irqreturn_t serial21285_tx_chars(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
int count = 256;
if (port->x_char) {
......@@ -235,8 +235,8 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios,
baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
quot = uart_get_divisor(port, baud);
if (port->info && port->info->port.tty) {
struct tty_struct *tty = port->info->port.tty;
if (port->state && port->state->port.tty) {
struct tty_struct *tty = port->state->port.tty;
unsigned int b = port->uartclk / (16 * quot);
tty_encode_baud_rate(tty, b, b);
}
......
......@@ -1382,7 +1382,7 @@ static void serial8250_enable_ms(struct uart_port *port)
static void
receive_chars(struct uart_8250_port *up, unsigned int *status)
{
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned char ch, lsr = *status;
int max_count = 256;
char flag;
......@@ -1457,7 +1457,7 @@ receive_chars(struct uart_8250_port *up, unsigned int *status)
static void transmit_chars(struct uart_8250_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int count;
if (up->port.x_char) {
......@@ -1500,7 +1500,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
status |= up->msr_saved_flags;
up->msr_saved_flags = 0;
if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI &&
up->port.info != NULL) {
up->port.state != NULL) {
if (status & UART_MSR_TERI)
up->port.icount.rng++;
if (status & UART_MSR_DDSR)
......@@ -1510,7 +1510,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
if (status & UART_MSR_DCTS)
uart_handle_cts_change(&up->port, status & UART_MSR_CTS);
wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}
return status;
......@@ -1764,7 +1764,7 @@ static void serial8250_backup_timeout(unsigned long data)
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
spin_unlock_irqrestore(&up->port.lock, flags);
if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
(!uart_circ_empty(&up->port.info->xmit) || up->port.x_char) &&
(!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
(lsr & UART_LSR_THRE)) {
iir &= ~(UART_IIR_ID | UART_IIR_NO_INT);
iir |= UART_IIR_THRI;
......
......@@ -117,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port)
static void pl010_rx_chars(struct uart_amba_port *uap)
{
struct tty_struct *tty = uap->port.info->port.tty;
struct tty_struct *tty = uap->port.state->port.tty;
unsigned int status, ch, flag, rsr, max_count = 256;
status = readb(uap->port.membase + UART01x_FR);
......@@ -172,7 +172,7 @@ static void pl010_rx_chars(struct uart_amba_port *uap)
static void pl010_tx_chars(struct uart_amba_port *uap)
{
struct circ_buf *xmit = &uap->port.info->xmit;
struct circ_buf *xmit = &uap->port.state->xmit;
int count;
if (uap->port.x_char) {
......@@ -225,7 +225,7 @@ static void pl010_modem_status(struct uart_amba_port *uap)
if (delta & UART01x_FR_CTS)
uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS);
wake_up_interruptible(&uap->port.info->delta_msr_wait);
wake_up_interruptible(&uap->port.state->delta_msr_wait);
}
static irqreturn_t pl010_int(int irq, void *dev_id)
......
......@@ -124,7 +124,7 @@ static void pl011_enable_ms(struct uart_port *port)
static void pl011_rx_chars(struct uart_amba_port *uap)
{
struct tty_struct *tty = uap->port.info->port.tty;
struct tty_struct *tty = uap->port.state->port.tty;
unsigned int status, ch, flag, max_count = 256;
status = readw(uap->port.membase + UART01x_FR);
......@@ -175,7 +175,7 @@ static void pl011_rx_chars(struct uart_amba_port *uap)
static void pl011_tx_chars(struct uart_amba_port *uap)
{
struct circ_buf *xmit = &uap->port.info->xmit;
struct circ_buf *xmit = &uap->port.state->xmit;
int count;
if (uap->port.x_char) {
......@@ -226,7 +226,7 @@ static void pl011_modem_status(struct uart_amba_port *uap)
if (delta & UART01x_FR_CTS)
uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS);
wake_up_interruptible(&uap->port.info->delta_msr_wait);
wake_up_interruptible(&uap->port.state->delta_msr_wait);
}
static irqreturn_t pl011_int(int irq, void *dev_id)
......
......@@ -427,7 +427,7 @@ static void atmel_rx_chars(struct uart_port *port)
*/
static void atmel_tx_chars(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) {
UART_PUT_CHAR(port, port->x_char);
......@@ -560,7 +560,7 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id)
static void atmel_tx_dma(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
int count;
......@@ -663,14 +663,14 @@ static void atmel_rx_from_ring(struct uart_port *port)
* uart_start(), which takes the lock.
*/
spin_unlock(&port->lock);
tty_flip_buffer_push(port->info->port.tty);
tty_flip_buffer_push(port->state->port.tty);
spin_lock(&port->lock);
}
static void atmel_rx_from_dma(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
struct atmel_dma_buffer *pdc;
int rx_idx = atmel_port->pdc_rx_idx;
unsigned int head;
......@@ -776,7 +776,7 @@ static void atmel_tasklet_func(unsigned long data)
if (status_change & ATMEL_US_CTS)
uart_handle_cts_change(port, !(status & ATMEL_US_CTS));
wake_up_interruptible(&port->info->delta_msr_wait);
wake_up_interruptible(&port->state->delta_msr_wait);
atmel_port->irq_status_prev = status;
}
......@@ -795,7 +795,7 @@ static void atmel_tasklet_func(unsigned long data)
static int atmel_startup(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
int retval;
/*
......@@ -854,7 +854,7 @@ static int atmel_startup(struct uart_port *port)
}
if (atmel_use_dma_tx(port)) {
struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
pdc->buf = xmit->buf;
pdc->dma_addr = dma_map_single(port->dev,
......
......@@ -144,7 +144,7 @@ static void bfin_serial_stop_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
#ifdef CONFIG_SERIAL_BFIN_DMA
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;
#endif
while (!(UART_GET_LSR(uart) & TEMT))
......@@ -171,7 +171,7 @@ static void bfin_serial_stop_tx(struct uart_port *port)
static void bfin_serial_start_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
struct tty_struct *tty = uart->port.info->port.tty;
struct tty_struct *tty = uart->port.state->port.tty;
#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) {
......@@ -243,10 +243,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
return;
}
if (!uart->port.info || !uart->port.info->port.tty)
if (!uart->port.state || !uart->port.state->port.tty)
return;
#endif
tty = uart->port.info->port.tty;
tty = uart->port.state->port.tty;
if (ANOMALY_05000363) {
/* The BF533 (and BF561) family of processors have a nice anomaly
......@@ -331,7 +331,7 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
static void bfin_serial_tx_chars(struct bfin_serial_port *uart)
{
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;
if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) {
#ifdef CONFIG_BF54x
......@@ -398,7 +398,7 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
#ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
{
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;
uart->tx_done = 0;
......@@ -436,7 +436,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
{
struct tty_struct *tty = uart->port.info->port.tty;
struct tty_struct *tty = uart->port.state->port.tty;
int i, flg, status;
status = UART_GET_LSR(uart);
......@@ -529,7 +529,7 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id)
{
struct bfin_serial_port *uart = dev_id;
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;
#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->scts && !(bfin_serial_get_mctrl(&uart->port)&TIOCM_CTS)) {
......@@ -965,10 +965,10 @@ static void bfin_serial_set_ldisc(struct uart_port *port)
int line = port->line;
unsigned short val;
if (line >= port->info->port.tty->driver->num)
if (line >= port->state->port.tty->driver->num)
return;
switch (port->info->port.tty->termios->c_line) {
switch (port->state->port.tty->termios->c_line) {
case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC);
......
......@@ -178,7 +178,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate)
static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id)
{
struct sport_uart_port *up = dev_id;
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned int ch;
do {
......@@ -205,7 +205,7 @@ static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id)
static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
{
struct sport_uart_port *up = dev_id;
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned int stat = SPORT_GET_STAT(up);
/* Overflow in RX FIFO */
......@@ -290,7 +290,7 @@ static int sport_startup(struct uart_port *port)
static void sport_uart_tx_chars(struct sport_uart_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
if (SPORT_GET_STAT(up) & TXF)
return;
......
......@@ -93,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int status, ch, flg;
status = clps_readl(SYSFLG(port));
......@@ -147,7 +147,7 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
int count;
if (port->x_char) {
......
......@@ -244,7 +244,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
int i;
unsigned char ch;
u8 *cp;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
cbd_t __iomem *bdp;
u16 status;
......
......@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) {
dport = &mux->dport[LINE(status)];
uport = &dport->port;
tty = uport->info->port.tty; /* point to the proper dev */
tty = uport->state->port.tty; /* point to the proper dev */
ch = UCHAR(status); /* grab the char */
flag = TTY_NORMAL;
......@@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
}
for (i = 0; i < DZ_NB_PORT; i++)
if (lines_rx[i])
tty_flip_buffer_push(mux->dport[i].port.info->port.tty);
tty_flip_buffer_push(mux->dport[i].port.state->port.tty);
}
/*
......@@ -268,7 +268,7 @@ static inline void dz_transmit_chars(struct dz_mux *mux)
status = dz_in(dport, DZ_CSR);
dport = &mux->dport[LINE(status)];
xmit = &dport->port.info->xmit;
xmit = &dport->port.state->xmit;
if (dport->port.x_char) { /* XON/XOFF chars */
dz_out(dport, DZ_TDR, dport->port.x_char);
......
......@@ -627,7 +627,7 @@ static int icom_write(struct uart_port *port)
unsigned long data_count;
unsigned char cmdReg;
unsigned long offset;
int temp_tail = port->info->xmit.tail;
int temp_tail = port->state->xmit.tail;
trace(ICOM_PORT, "WRITE", 0);
......@@ -638,11 +638,11 @@ static int icom_write(struct uart_port *port)
}
data_count = 0;
while ((port->info->xmit.head != temp_tail) &&
while ((port->state->xmit.head != temp_tail) &&
(data_count <= XMIT_BUFF_SZ)) {
ICOM_PORT->xmit_buf[data_count++] =
port->info->xmit.buf[temp_tail];
port->state->xmit.buf[temp_tail];
temp_tail++;
temp_tail &= (UART_XMIT_SIZE - 1);
......@@ -694,7 +694,7 @@ static inline void check_modem_status(struct icom_port *icom_port)
uart_handle_cts_change(&icom_port->uart_port,
delta_status & ICOM_CTS);
wake_up_interruptible(&icom_port->uart_port.info->
wake_up_interruptible(&icom_port->uart_port.state->
delta_msr_wait);
old_status = status;
}
......@@ -718,10 +718,10 @@ static void xmit_interrupt(u16 port_int_reg, struct icom_port *icom_port)
icom_port->uart_port.icount.tx += count;
for (i=0; i<count &&
!uart_circ_empty(&icom_port->uart_port.info->xmit); i++) {
!uart_circ_empty(&icom_port->uart_port.state->xmit); i++) {
icom_port->uart_port.info->xmit.tail++;
icom_port->uart_port.info->xmit.tail &=
icom_port->uart_port.state->xmit.tail++;
icom_port->uart_port.state->xmit.tail &=
(UART_XMIT_SIZE - 1);
}
......@@ -735,7 +735,7 @@ static void xmit_interrupt(u16 port_int_reg, struct icom_port *icom_port)
static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port)
{
short int count, rcv_buff;
struct tty_struct *tty = icom_port->uart_port.info->port.tty;
struct tty_struct *tty = icom_port->uart_port.state->port.tty;
unsigned short int status;
struct uart_icount *icount;
unsigned long offset;
......
......@@ -224,7 +224,7 @@ static void imx_mctrl_check(struct imx_port *sport)
if (changed & TIOCM_CTS)
uart_handle_cts_change(&sport->port, status & TIOCM_CTS);
wake_up_interruptible(&sport->port.info->delta_msr_wait);
wake_up_interruptible(&sport->port.state->delta_msr_wait);
}
/*
......@@ -236,7 +236,7 @@ static void imx_timeout(unsigned long data)
struct imx_port *sport = (struct imx_port *)data;
unsigned long flags;
if (sport->port.info) {
if (sport->port.state) {
spin_lock_irqsave(&sport->port.lock, flags);
imx_mctrl_check(sport);
spin_unlock_irqrestore(&sport->port.lock, flags);
......@@ -323,7 +323,7 @@ static void imx_enable_ms(struct uart_port *port)
static inline void imx_transmit_buffer(struct imx_port *sport)
{
struct circ_buf *xmit = &sport->port.info->xmit;
struct circ_buf *xmit = &sport->port.state->xmit;
while (!(readl(sport->port.membase + UTS) & UTS_TXFULL)) {
/* send xmit->buf[xmit->tail]
......@@ -388,7 +388,7 @@ static irqreturn_t imx_rtsint(int irq, void *dev_id)
writel(USR1_RTSD, sport->port.membase + USR1);
uart_handle_cts_change(&sport->port, !!val);
wake_up_interruptible(&sport->port.info->delta_msr_wait);
wake_up_interruptible(&sport->port.state->delta_msr_wait);
spin_unlock_irqrestore(&sport->port.lock, flags);
return IRQ_HANDLED;
......@@ -397,7 +397,7 @@ static irqreturn_t imx_rtsint(int irq, void *dev_id)
static irqreturn_t imx_txint(int irq, void *dev_id)
{
struct imx_port *sport = dev_id;
struct circ_buf *xmit = &sport->port.info->xmit;
struct circ_buf *xmit = &sport->port.state->xmit;
unsigned long flags;
spin_lock_irqsave(&sport->port.lock,flags);
......@@ -427,7 +427,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
{
struct imx_port *sport = dev_id;
unsigned int rx,flg,ignored = 0;
struct tty_struct *tty = sport->port.info->port.tty;
struct tty_struct *tty = sport->port.state->port.tty;
unsigned long flags, temp;
spin_lock_irqsave(&sport->port.lock,flags);
......@@ -900,11 +900,11 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
rational_best_approximation(16 * div * baud, sport->port.uartclk,
1 << 16, 1 << 16, &num, &denom);
if (port->info && port->info->port.tty) {
if (port->state && port->state->port.tty) {
tdiv64 = sport->port.uartclk;
tdiv64 *= num;
do_div(tdiv64, denom * 16 * div);
tty_encode_baud_rate(sport->port.info->port.tty,
tty_encode_baud_rate(sport->port.state->port.tty,
(speed_t)tdiv64, (speed_t)tdiv64);
}
......
......@@ -897,25 +897,25 @@ static void transmit_chars(struct uart_port *the_port)
char *start;
struct tty_struct *tty;
struct ioc3_port *port = get_ioc3_port(the_port);
struct uart_info *info;
struct uart_state *state;
if (!the_port)
return;
if (!port)
return;
info = the_port->info;
tty = info->port.tty;
state = the_port->state;
tty = state->port.tty;
if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) {
if (uart_circ_empty(&state->xmit) || uart_tx_stopped(the_port)) {
/* Nothing to do or hw stopped */
set_notification(port, N_ALL_OUTPUT, 0);
return;
}
head = info->xmit.head;
tail = info->xmit.tail;
start = (char *)&info->xmit.buf[tail];
head = state->xmit.head;
tail = state->xmit.tail;
start = (char *)&state->xmit.buf[tail];
/* write out all the data or until the end of the buffer */
xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail);
......@@ -928,14 +928,14 @@ static void transmit_chars(struct uart_port *the_port)
/* advance the pointers */
tail += result;
tail &= UART_XMIT_SIZE - 1;
info->xmit.tail = tail;
start = (char *)&info->xmit.buf[tail];
state->xmit.tail = tail;
start = (char *)&state->xmit.buf[tail];
}
}
if (uart_circ_chars_pending(&info->xmit) < WAKEUP_CHARS)
if (uart_circ_chars_pending(&state->xmit) < WAKEUP_CHARS)
uart_write_wakeup(the_port);
if (uart_circ_empty(&info->xmit)) {
if (uart_circ_empty(&state->xmit)) {
set_notification(port, N_OUTPUT_LOWAT, 0);
} else {
set_notification(port, N_OUTPUT_LOWAT, 1);
......@@ -956,7 +956,7 @@ ioc3_change_speed(struct uart_port *the_port,
unsigned int cflag;
int baud;
int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8;
struct uart_info *info = the_port->info;
struct uart_state *state = the_port->state;
cflag = new_termios->c_cflag;
......@@ -997,14 +997,14 @@ ioc3_change_speed(struct uart_port *the_port,
the_port->ignore_status_mask = N_ALL_INPUT;
info->port.tty->low_latency = 1;
state->port.tty->low_latency = 1;
if (I_IGNPAR(info->port.tty))
if (I_IGNPAR(state->port.tty))
the_port->ignore_status_mask &= ~(N_PARITY_ERROR
| N_FRAMING_ERROR);
if (I_IGNBRK(info->port.tty)) {
if (I_IGNBRK(state->port.tty)) {
the_port->ignore_status_mask &= ~N_BREAK;
if (I_IGNPAR(info->port.tty))
if (I_IGNPAR(state->port.tty))
the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
}
if (!(cflag & CREAD)) {
......@@ -1286,7 +1286,7 @@ static inline int do_read(struct uart_port *the_port, char *buf, int len)
uart_handle_dcd_change
(port->ip_port, 0);
wake_up_interruptible
(&the_port->info->
(&the_port->state->
delta_msr_wait);
}
......@@ -1392,21 +1392,21 @@ static int receive_chars(struct uart_port *the_port)
struct tty_struct *tty;
unsigned char ch[MAX_CHARS];
int read_count = 0, read_room, flip = 0;
struct uart_info *info = the_port->info;
struct uart_state *state = the_port->state;
struct ioc3_port *port = get_ioc3_port(the_port);
unsigned long pflags;
/* Make sure all the pointers are "good" ones */
if (!info)
if (!state)
return 0;
if (!info->port.tty)
if (!state->port.tty)
return 0;
if (!(port->ip_flags & INPUT_ENABLE))
return 0;
spin_lock_irqsave(&the_port->lock, pflags);
tty = info->port.tty;
tty = state->port.tty;
read_count = do_read(the_port, ch, MAX_CHARS);
if (read_count > 0) {
......@@ -1491,7 +1491,7 @@ ioc3uart_intr_one(struct ioc3_submodule *is,
uart_handle_dcd_change(the_port,
shadow & SHADOW_DCD);
wake_up_interruptible
(&the_port->info->delta_msr_wait);
(&the_port->state->delta_msr_wait);
} else if ((port->ip_notify & N_DDCD)
&& !(shadow & SHADOW_DCD)) {
/* Flag delta DCD/no DCD */
......@@ -1511,7 +1511,7 @@ ioc3uart_intr_one(struct ioc3_submodule *is,
uart_handle_cts_change(the_port, shadow
& SHADOW_CTS);
wake_up_interruptible
(&the_port->info->delta_msr_wait);
(&the_port->state->delta_msr_wait);
}
}
......@@ -1721,14 +1721,14 @@ static void ic3_shutdown(struct uart_port *the_port)
{
unsigned long port_flags;
struct ioc3_port *port;
struct uart_info *info;
struct uart_state *state;
port = get_ioc3_port(the_port);
if (!port)
return;
info = the_port->info;
wake_up_interruptible(&info->delta_msr_wait);
state = the_port->state;
wake_up_interruptible(&state->delta_msr_wait);
spin_lock_irqsave(&the_port->lock, port_flags);
set_notification(port, N_ALL, 0);
......
......@@ -1627,25 +1627,25 @@ static void transmit_chars(struct uart_port *the_port)
char *start;
struct tty_struct *tty;
struct ioc4_port *port = get_ioc4_port(the_port, 0);
struct uart_info *info;
struct uart_state *state;
if (!the_port)
return;
if (!port)
return;
info = the_port->info;
tty = info->port.tty;
state = the_port->state;
tty = state->port.tty;
if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) {
if (uart_circ_empty(&state->xmit) || uart_tx_stopped(the_port)) {
/* Nothing to do or hw stopped */
set_notification(port, N_ALL_OUTPUT, 0);
return;
}
head = info->xmit.head;
tail = info->xmit.tail;
start = (char *)&info->xmit.buf[tail];
head = state->xmit.head;
tail = state->xmit.tail;
start = (char *)&state->xmit.buf[tail];
/* write out all the data or until the end of the buffer */
xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail);
......@@ -1658,14 +1658,14 @@ static void transmit_chars(struct uart_port *the_port)
/* advance the pointers */
tail += result;
tail &= UART_XMIT_SIZE - 1;
info->xmit.tail = tail;
start = (char *)&info->xmit.buf[tail];
state->xmit.tail = tail;
start = (char *)&state->xmit.buf[tail];
}
}
if (uart_circ_chars_pending(&info->xmit) < WAKEUP_CHARS)
if (uart_circ_chars_pending(&state->xmit) < WAKEUP_CHARS)
uart_write_wakeup(the_port);
if (uart_circ_empty(&info->xmit)) {
if (uart_circ_empty(&state->xmit)) {
set_notification(port, N_OUTPUT_LOWAT, 0);
} else {
set_notification(port, N_OUTPUT_LOWAT, 1);
......@@ -1686,7 +1686,7 @@ ioc4_change_speed(struct uart_port *the_port,
int baud, bits;
unsigned cflag;
int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8;
struct uart_info *info = the_port->info;
struct uart_state *state = the_port->state;
cflag = new_termios->c_cflag;
......@@ -1738,14 +1738,14 @@ ioc4_change_speed(struct uart_port *the_port,
the_port->ignore_status_mask = N_ALL_INPUT;
info->port.tty->low_latency = 1;
state->port.tty->low_latency = 1;
if (I_IGNPAR(info->port.tty))
if (I_IGNPAR(state->port.tty))
the_port->ignore_status_mask &= ~(N_PARITY_ERROR
| N_FRAMING_ERROR);
if (I_IGNBRK(info->port.tty)) {
if (I_IGNBRK(state->port.tty)) {
the_port->ignore_status_mask &= ~N_BREAK;
if (I_IGNPAR(info->port.tty))
if (I_IGNPAR(state->port.tty))
the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
}
if (!(cflag & CREAD)) {
......@@ -1784,7 +1784,7 @@ ioc4_change_speed(struct uart_port *the_port,
static inline int ic4_startup_local(struct uart_port *the_port)
{
struct ioc4_port *port;
struct uart_info *info;
struct uart_state *state;
if (!the_port)
return -1;
......@@ -1793,7 +1793,7 @@ static inline int ic4_startup_local(struct uart_port *the_port)
if (!port)
return -1;
info = the_port->info;
state = the_port->state;
local_open(port);
......@@ -1801,7 +1801,7 @@ static inline int ic4_startup_local(struct uart_port *the_port)
ioc4_set_proto(port, the_port->mapbase);
/* set the speed of the serial port */
ioc4_change_speed(the_port, info->port.tty->termios,
ioc4_change_speed(the_port, state->port.tty->termios,
(struct ktermios *)0);
return 0;
......@@ -1882,7 +1882,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
the_port = port->ip_port;
the_port->icount.dcd = 1;
wake_up_interruptible
(&the_port-> info->delta_msr_wait);
(&the_port->state->delta_msr_wait);
} else if ((port->ip_notify & N_DDCD)
&& !(shadow & IOC4_SHADOW_DCD)) {
/* Flag delta DCD/no DCD */
......@@ -1904,7 +1904,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
the_port->icount.cts =
(shadow & IOC4_SHADOW_CTS) ? 1 : 0;
wake_up_interruptible
(&the_port->info->delta_msr_wait);
(&the_port->state->delta_msr_wait);
}
}
......@@ -2236,7 +2236,7 @@ static inline int do_read(struct uart_port *the_port, unsigned char *buf,
&& port->ip_port) {
the_port->icount.dcd = 0;
wake_up_interruptible
(&the_port->info->
(&the_port->state->
delta_msr_wait);
}
......@@ -2341,17 +2341,17 @@ static void receive_chars(struct uart_port *the_port)
unsigned char ch[IOC4_MAX_CHARS];
int read_count, request_count = IOC4_MAX_CHARS;
struct uart_icount *icount;
struct uart_info *info = the_port->info;
struct uart_state *state = the_port->state;
unsigned long pflags;
/* Make sure all the pointers are "good" ones */
if (!info)
if (!state)
return;
if (!info->port.tty)
if (!state->port.tty)
return;
spin_lock_irqsave(&the_port->lock, pflags);
tty = info->port.tty;
tty = state->port.tty;
request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS);
......@@ -2430,19 +2430,19 @@ static void ic4_shutdown(struct uart_port *the_port)
{
unsigned long port_flags;
struct ioc4_port *port;
struct uart_info *info;
struct uart_state *state;
port = get_ioc4_port(the_port, 0);
if (!port)
return;
info = the_port->info;
state = the_port->state;
port->ip_port = NULL;
wake_up_interruptible(&info->delta_msr_wait);
wake_up_interruptible(&state->delta_msr_wait);
if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->port.tty->flags);
if (state->port.tty)
set_bit(TTY_IO_ERROR, &state->port.tty->flags);
spin_lock_irqsave(&the_port->lock, port_flags);
set_notification(port, N_ALL, 0);
......@@ -2538,7 +2538,7 @@ static int ic4_startup(struct uart_port *the_port)
int retval;
struct ioc4_port *port;
struct ioc4_control *control;
struct uart_info *info;
struct uart_state *state;
unsigned long port_flags;
if (!the_port)
......@@ -2546,7 +2546,7 @@ static int ic4_startup(struct uart_port *the_port)
port = get_ioc4_port(the_port, 1);
if (!port)
return -ENODEV;
info = the_port->info;
state = the_port->state;
control = port->ip_control;
if (!control) {
......
......@@ -256,9 +256,9 @@ static struct tty_struct *ip22zilog_receive_chars(struct uart_ip22zilog_port *up
unsigned int r1;
tty = NULL;
if (up->port.info != NULL &&
up->port.info->port.tty != NULL)
tty = up->port.info->port.tty;
if (up->port.state != NULL &&
up->port.state->port.tty != NULL)
tty = up->port.state->port.tty;
for (;;) {
ch = readb(&channel->control);
......@@ -354,7 +354,7 @@ static void ip22zilog_status_handle(struct uart_ip22zilog_port *up,
uart_handle_cts_change(&up->port,
(status & CTS));
wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}
up->prev_status = status;
......@@ -404,9 +404,9 @@ static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up,
return;
}
if (up->port.info == NULL)
if (up->port.state == NULL)
goto ack_tx_int;
xmit = &up->port.info->xmit;
xmit = &up->port.state->xmit;
if (uart_circ_empty(xmit))
goto ack_tx_int;
if (uart_tx_stopped(&up->port))
......@@ -607,7 +607,7 @@ static void ip22zilog_start_tx(struct uart_port *port)
port->icount.tx++;
port->x_char = 0;
} else {
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
writeb(xmit->buf[xmit->tail], &channel->data);
ZSDELAY();
......
......@@ -989,7 +989,7 @@ static void neo_param(struct jsm_channel *ch)
{ 50, B50 },
};
cflag = C_BAUD(ch->uart_port.info->port.tty);
cflag = C_BAUD(ch->uart_port.state->port.tty);
baud = 9600;
for (i = 0; i < ARRAY_SIZE(baud_rates); i++) {
if (baud_rates[i].cflag == cflag) {
......
......@@ -147,7 +147,7 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch)
struct ktermios *termios;
spin_lock_irqsave(&port->lock, lock_flags);
termios = port->info->port.tty->termios;
termios = port->state->port.tty->termios;
if (ch == termios->c_cc[VSTART])
channel->ch_bd->bd_ops->send_start_character(channel);
......@@ -245,7 +245,7 @@ static int jsm_tty_open(struct uart_port *port)
channel->ch_cached_lsr = 0;
channel->ch_stops_sent = 0;
termios = port->info->port.tty->termios;
termios = port->state->port.tty->termios;
channel->ch_c_cflag = termios->c_cflag;
channel->ch_c_iflag = termios->c_iflag;
channel->ch_c_oflag = termios->c_oflag;
......@@ -278,7 +278,7 @@ static void jsm_tty_close(struct uart_port *port)
jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n");
bd = channel->ch_bd;
ts = port->info->port.tty->termios;
ts = port->state->port.tty->termios;
channel->ch_flags &= ~(CH_STOPI);
......@@ -530,7 +530,7 @@ void jsm_input(struct jsm_channel *ch)
if (!ch)
return;
tp = ch->uart_port.info->port.tty;
tp = ch->uart_port.state->port.tty;
bd = ch->ch_bd;
if(!bd)
......@@ -849,7 +849,7 @@ int jsm_tty_write(struct uart_port *port)
u16 tail;
u16 tmask;
u32 remain;
int temp_tail = port->info->xmit.tail;
int temp_tail = port->state->xmit.tail;
struct jsm_channel *channel = (struct jsm_channel *)port;
tmask = WQUEUEMASK;
......@@ -865,10 +865,10 @@ int jsm_tty_write(struct uart_port *port)
data_count = 0;
if (bufcount >= remain) {
bufcount -= remain;
while ((port->info->xmit.head != temp_tail) &&
while ((port->state->xmit.head != temp_tail) &&
(data_count < remain)) {
channel->ch_wqueue[head++] =
port->info->xmit.buf[temp_tail];
port->state->xmit.buf[temp_tail];
temp_tail++;
temp_tail &= (UART_XMIT_SIZE - 1);
......@@ -880,10 +880,10 @@ int jsm_tty_write(struct uart_port *port)
data_count1 = 0;
if (bufcount > 0) {
remain = bufcount;
while ((port->info->xmit.head != temp_tail) &&
while ((port->state->xmit.head != temp_tail) &&
(data_count1 < remain)) {
channel->ch_wqueue[head++] =
port->info->xmit.buf[temp_tail];
port->state->xmit.buf[temp_tail];
temp_tail++;
temp_tail &= (UART_XMIT_SIZE - 1);
......@@ -892,7 +892,7 @@ int jsm_tty_write(struct uart_port *port)
}
}
port->info->xmit.tail = temp_tail;
port->state->xmit.tail = temp_tail;
data_count += data_count1;
if (data_count) {
......
......@@ -286,7 +286,7 @@ static void m32r_sio_start_tx(struct uart_port *port)
{
#ifdef CONFIG_SERIAL_M32R_PLDSIO
struct uart_sio_port *up = (struct uart_sio_port *)port;
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
if (!(up->ier & UART_IER_THRI)) {
up->ier |= UART_IER_THRI;
......@@ -325,7 +325,7 @@ static void m32r_sio_enable_ms(struct uart_port *port)
static void receive_chars(struct uart_sio_port *up, int *status)
{
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned char ch;
unsigned char flag;
int max_count = 256;
......@@ -398,7 +398,7 @@ static void receive_chars(struct uart_sio_port *up, int *status)
static void transmit_chars(struct uart_sio_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int count;
if (up->port.x_char) {
......
......@@ -184,7 +184,7 @@ static void max3100_timeout(unsigned long data)
{
struct max3100_port *s = (struct max3100_port *)data;
if (s->port.info) {
if (s->port.state) {
max3100_dowork(s);
mod_timer(&s->timer, jiffies + s->poll_time);
}
......@@ -261,7 +261,7 @@ static void max3100_work(struct work_struct *w)
int rxchars;
u16 tx, rx;
int conf, cconf, rts, crts;
struct circ_buf *xmit = &s->port.info->xmit;
struct circ_buf *xmit = &s->port.state->xmit;
dev_dbg(&s->spi->dev, "%s\n", __func__);
......@@ -307,8 +307,8 @@ static void max3100_work(struct work_struct *w)
}
}
if (rxchars > 16 && s->port.info->port.tty != NULL) {
tty_flip_buffer_push(s->port.info->port.tty);
if (rxchars > 16 && s->port.state->port.tty != NULL) {
tty_flip_buffer_push(s->port.state->port.tty);
rxchars = 0;
}
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
......@@ -320,8 +320,8 @@ static void max3100_work(struct work_struct *w)
(!uart_circ_empty(xmit) &&
!uart_tx_stopped(&s->port))));
if (rxchars > 0 && s->port.info->port.tty != NULL)
tty_flip_buffer_push(s->port.info->port.tty);
if (rxchars > 0 && s->port.state->port.tty != NULL)
tty_flip_buffer_push(s->port.state->port.tty);
}
static irqreturn_t max3100_irq(int irqno, void *dev_id)
......@@ -429,7 +429,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
int baud = 0;
unsigned cflag;
u32 param_new, param_mask, parity = 0;
struct tty_struct *tty = s->port.info->port.tty;
struct tty_struct *tty = s->port.state->port.tty;
dev_dbg(&s->spi->dev, "%s\n", __func__);
if (!tty)
......@@ -529,7 +529,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
MAX3100_STATUS_OE;
/* we are sending char from a workqueue so enable */
s->port.info->port.tty->low_latency = 1;
s->port.state->port.tty->low_latency = 1;
if (s->poll_time > 0)
del_timer_sync(&s->timer);
......
......@@ -323,7 +323,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag);
}
tty_flip_buffer_push(port->info->port.tty);
tty_flip_buffer_push(port->state->port.tty);
}
/****************************************************************************/
......@@ -331,7 +331,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
static void mcf_tx_chars(struct mcf_uart *pp)
{
struct uart_port *port = &pp->port;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if (port->x_char) {
/* Send special char - probably flow control */
......
......@@ -745,7 +745,7 @@ static struct uart_ops mpc52xx_uart_ops = {
static inline int
mpc52xx_uart_int_rx_chars(struct uart_port *port)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned char ch, flag;
unsigned short status;
......@@ -812,7 +812,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
static inline int
mpc52xx_uart_int_tx_chars(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
/* Process out of band chars */
if (port->x_char) {
......
......@@ -936,7 +936,7 @@ static int serial_polled;
static int mpsc_rx_intr(struct mpsc_port_info *pi)
{
struct mpsc_rx_desc *rxre;
struct tty_struct *tty = pi->port.info->port.tty;
struct tty_struct *tty = pi->port.state->port.tty;
u32 cmdstat, bytes_in, i;
int rc = 0;
u8 *bp;
......@@ -1109,7 +1109,7 @@ static void mpsc_setup_tx_desc(struct mpsc_port_info *pi, u32 count, u32 intr)
static void mpsc_copy_tx_data(struct mpsc_port_info *pi)
{
struct circ_buf *xmit = &pi->port.info->xmit;
struct circ_buf *xmit = &pi->port.state->xmit;
u8 *bp;
u32 i;
......
......@@ -88,7 +88,7 @@ static void msm_enable_ms(struct uart_port *port)
static void handle_rx(struct uart_port *port)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int sr;
/*
......@@ -136,7 +136,7 @@ static void handle_rx(struct uart_port *port)
static void handle_tx(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
struct msm_port *msm_port = UART_TO_MSM(port);
int sent_tx;
......@@ -169,7 +169,7 @@ static void handle_delta_cts(struct uart_port *port)
{
msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR);
port->icount.cts++;
wake_up_interruptible(&port->info->delta_msr_wait);
wake_up_interruptible(&port->state->delta_msr_wait);
}
static irqreturn_t msm_irq(int irq, void *dev_id)
......
......@@ -199,7 +199,7 @@ static void mux_break_ctl(struct uart_port *port, int break_state)
static void mux_write(struct uart_port *port)
{
int count;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if(port->x_char) {
UART_PUT_CHAR(port, port->x_char);
......@@ -243,7 +243,7 @@ static void mux_write(struct uart_port *port)
static void mux_read(struct uart_port *port)
{
int data;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
__u32 start_count = port->icount.rx;
while(1) {
......
......@@ -140,7 +140,7 @@ static void netx_enable_ms(struct uart_port *port)
static inline void netx_transmit_buffer(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if (port->x_char) {
writel(port->x_char, port->membase + UART_DR);
......@@ -185,7 +185,7 @@ static unsigned int netx_tx_empty(struct uart_port *port)
static void netx_txint(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
netx_stop_tx(port);
......@@ -201,7 +201,7 @@ static void netx_txint(struct uart_port *port)
static void netx_rxint(struct uart_port *port)
{
unsigned char rx, flg, status;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
while (!(readl(port->membase + UART_FR) & FR_RXFE)) {
rx = readl(port->membase + UART_DR);
......
......@@ -126,7 +126,7 @@ static void nwpserial_config_port(struct uart_port *port, int flags)
static irqreturn_t nwpserial_interrupt(int irq, void *dev_id)
{
struct nwpserial_port *up = dev_id;
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
irqreturn_t ret;
unsigned int iir;
unsigned char ch;
......@@ -261,7 +261,7 @@ static void nwpserial_start_tx(struct uart_port *port)
struct nwpserial_port *up;
struct circ_buf *xmit;
up = container_of(port, struct nwpserial_port, port);
xmit = &up->port.info->xmit;
xmit = &up->port.state->xmit;
if (port->x_char) {
nwpserial_putchar(up, up->port.x_char);
......
......@@ -242,12 +242,12 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
}
/* Sanity check, make sure the old bug is no longer happening */
if (uap->port.info == NULL || uap->port.info->port.tty == NULL) {
if (uap->port.state == NULL || uap->port.state->port.tty == NULL) {
WARN_ON(1);
(void)read_zsdata(uap);
return NULL;
}
tty = uap->port.info->port.tty;
tty = uap->port.state->port.tty;
while (1) {
error = 0;
......@@ -369,7 +369,7 @@ static void pmz_status_handle(struct uart_pmac_port *uap)
uart_handle_cts_change(&uap->port,
!(status & CTS));
wake_up_interruptible(&uap->port.info->delta_msr_wait);
wake_up_interruptible(&uap->port.state->delta_msr_wait);
}
if (status & BRK_ABRT)
......@@ -420,9 +420,9 @@ static void pmz_transmit_chars(struct uart_pmac_port *uap)
return;
}
if (uap->port.info == NULL)
if (uap->port.state == NULL)
goto ack_tx_int;
xmit = &uap->port.info->xmit;
xmit = &uap->port.state->xmit;
if (uart_circ_empty(xmit)) {
uart_write_wakeup(&uap->port);
goto ack_tx_int;
......@@ -655,7 +655,7 @@ static void pmz_start_tx(struct uart_port *port)
port->icount.tx++;
port->x_char = 0;
} else {
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
write_zsdata(uap, xmit->buf[xmit->tail]);
zssync(uap);
......
......@@ -100,7 +100,7 @@ static void pnx8xxx_mctrl_check(struct pnx8xxx_port *sport)
if (changed & TIOCM_CTS)
uart_handle_cts_change(&sport->port, status & TIOCM_CTS);
wake_up_interruptible(&sport->port.info->delta_msr_wait);
wake_up_interruptible(&sport->port.state->delta_msr_wait);
}
/*
......@@ -112,7 +112,7 @@ static void pnx8xxx_timeout(unsigned long data)
struct pnx8xxx_port *sport = (struct pnx8xxx_port *)data;
unsigned long flags;
if (sport->port.info) {
if (sport->port.state) {
spin_lock_irqsave(&sport->port.lock, flags);
pnx8xxx_mctrl_check(sport);
spin_unlock_irqrestore(&sport->port.lock, flags);
......@@ -181,7 +181,7 @@ static void pnx8xxx_enable_ms(struct uart_port *port)
static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
{
struct tty_struct *tty = sport->port.info->port.tty;
struct tty_struct *tty = sport->port.state->port.tty;
unsigned int status, ch, flg;
status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) |
......@@ -243,7 +243,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
static void pnx8xxx_tx_chars(struct pnx8xxx_port *sport)
{
struct circ_buf *xmit = &sport->port.info->xmit;
struct circ_buf *xmit = &sport->port.state->xmit;
if (sport->port.x_char) {
serial_out(sport, PNX8XXX_FIFO, sport->port.x_char);
......
......@@ -96,7 +96,7 @@ static void serial_pxa_stop_rx(struct uart_port *port)
static inline void receive_chars(struct uart_pxa_port *up, int *status)
{
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned int ch, flag;
int max_count = 256;
......@@ -161,7 +161,7 @@ static inline void receive_chars(struct uart_pxa_port *up, int *status)
static void transmit_chars(struct uart_pxa_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int count;
if (up->port.x_char) {
......@@ -220,7 +220,7 @@ static inline void check_modem_status(struct uart_pxa_port *up)
if (status & UART_MSR_DCTS)
uart_handle_cts_change(&up->port, status & UART_MSR_CTS);
wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}
/*
......
......@@ -117,7 +117,7 @@ static void sa1100_mctrl_check(struct sa1100_port *sport)
if (changed & TIOCM_CTS)
uart_handle_cts_change(&sport->port, status & TIOCM_CTS);
wake_up_interruptible(&sport->port.info->delta_msr_wait);
wake_up_interruptible(&sport->port.state->delta_msr_wait);
}
/*
......@@ -129,7 +129,7 @@ static void sa1100_timeout(unsigned long data)
struct sa1100_port *sport = (struct sa1100_port *)data;
unsigned long flags;
if (sport->port.info) {
if (sport->port.state) {
spin_lock_irqsave(&sport->port.lock, flags);
sa1100_mctrl_check(sport);
spin_unlock_irqrestore(&sport->port.lock, flags);
......@@ -189,7 +189,7 @@ static void sa1100_enable_ms(struct uart_port *port)
static void
sa1100_rx_chars(struct sa1100_port *sport)
{
struct tty_struct *tty = sport->port.info->port.tty;
struct tty_struct *tty = sport->port.state->port.tty;
unsigned int status, ch, flg;
status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
......@@ -239,7 +239,7 @@ sa1100_rx_chars(struct sa1100_port *sport)
static void sa1100_tx_chars(struct sa1100_port *sport)
{
struct circ_buf *xmit = &sport->port.info->xmit;
struct circ_buf *xmit = &sport->port.state->xmit;
if (sport->port.x_char) {
UART_PUT_CHAR(sport, sport->port.x_char);
......
......@@ -196,7 +196,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id)
{
struct s3c24xx_uart_port *ourport = dev_id;
struct uart_port *port = &ourport->port;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int ufcon, ch, flag, ufstat, uerstat;
int max_count = 64;
......@@ -281,7 +281,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
{
struct s3c24xx_uart_port *ourport = id;
struct uart_port *port = &ourport->port;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
int count = 256;
if (port->x_char) {
......@@ -992,10 +992,10 @@ static int s3c24xx_serial_cpufreq_transition(struct notifier_block *nb,
struct ktermios *termios;
struct tty_struct *tty;
if (uport->info == NULL)
if (uport->state == NULL)
goto exit;
tty = uport->info->port.tty;
tty = uport->state->port.tty;
if (tty == NULL)
goto exit;
......
......@@ -384,13 +384,13 @@ static void sbd_receive_chars(struct sbd_port *sport)
uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag);
}
tty_flip_buffer_push(uport->info->port.tty);
tty_flip_buffer_push(uport->state->port.tty);
}
static void sbd_transmit_chars(struct sbd_port *sport)
{
struct uart_port *uport = &sport->port;
struct circ_buf *xmit = &sport->port.info->xmit;
struct circ_buf *xmit = &sport->port.state->xmit;
unsigned int mask;
int stop_tx;
......@@ -440,7 +440,7 @@ static void sbd_status_handle(struct sbd_port *sport)
if (delta & ((M_DUART_IN_PIN2_VAL | M_DUART_IN_PIN0_VAL) <<
S_DUART_IN_PIN_CHNG))
wake_up_interruptible(&uport->info->delta_msr_wait);
wake_up_interruptible(&uport->state->delta_msr_wait);
}
static irqreturn_t sbd_interrupt(int irq, void *dev_id)
......
......@@ -140,8 +140,8 @@ static struct tty_struct *receive_chars(struct uart_port *port)
char flag;
u8 status;
if (port->info != NULL) /* Unopened serial console */
tty = port->info->port.tty;
if (port->state != NULL) /* Unopened serial console */
tty = port->state->port.tty;
while (limit-- > 0) {
status = READ_SC_PORT(port, SR);
......@@ -190,10 +190,10 @@ static void transmit_chars(struct uart_port *port)
{
struct circ_buf *xmit;
if (!port->info)
if (!port->state)
return;
xmit = &port->info->xmit;
xmit = &port->state->xmit;
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
sc26xx_disable_irq(port, IMR_TXRDY);
return;
......@@ -316,7 +316,7 @@ static void sc26xx_stop_tx(struct uart_port *port)
/* port->lock held by caller. */
static void sc26xx_start_tx(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
while (!uart_circ_empty(xmit)) {
if (!(READ_SC_PORT(port, SR) & SR_TXRDY)) {
......
此差异已折叠。
......@@ -154,7 +154,7 @@ static void ks8695uart_disable_ms(struct uart_port *port)
static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int status, ch, lsr, flg, max_count = 256;
status = UART_GET_LSR(port); /* clears pending LSR interrupts */
......@@ -210,7 +210,7 @@ static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id)
static irqreturn_t ks8695uart_tx_chars(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
unsigned int count;
if (port->x_char) {
......@@ -266,7 +266,7 @@ static irqreturn_t ks8695uart_modem_status(int irq, void *dev_id)
if (status & URMS_URTERI)
port->icount.rng++;
wake_up_interruptible(&port->info->delta_msr_wait);
wake_up_interruptible(&port->state->delta_msr_wait);
return IRQ_HANDLED;
}
......
......@@ -138,7 +138,7 @@ static void lh7a40xuart_enable_ms (struct uart_port* port)
static void lh7a40xuart_rx_chars (struct uart_port* port)
{
struct tty_struct* tty = port->info->port.tty;
struct tty_struct* tty = port->state->port.tty;
int cbRxMax = 256; /* (Gross) limit on receive */
unsigned int data; /* Received data and status */
unsigned int flag;
......@@ -184,7 +184,7 @@ static void lh7a40xuart_rx_chars (struct uart_port* port)
static void lh7a40xuart_tx_chars (struct uart_port* port)
{
struct circ_buf* xmit = &port->info->xmit;
struct circ_buf* xmit = &port->state->xmit;
int cbTxMax = port->fifosize;
if (port->x_char) {
......@@ -241,7 +241,7 @@ static void lh7a40xuart_modem_status (struct uart_port* port)
if (delta & CTS)
uart_handle_cts_change (port, status & CTS);
wake_up_interruptible (&port->info->delta_msr_wait);
wake_up_interruptible (&port->state->delta_msr_wait);
}
static irqreturn_t lh7a40xuart_int (int irq, void* dev_id)
......
......@@ -272,7 +272,7 @@ static void serial_txx9_initialize(struct uart_port *port)
static inline void
receive_chars(struct uart_txx9_port *up, unsigned int *status)
{
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned char ch;
unsigned int disr = *status;
int max_count = 256;
......@@ -348,7 +348,7 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status)
static inline void transmit_chars(struct uart_txx9_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int count;
if (up->port.x_char) {
......
......@@ -361,7 +361,7 @@ static inline int sci_rxroom(struct uart_port *port)
static void sci_transmit_chars(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
unsigned int stopped = uart_tx_stopped(port);
unsigned short status;
unsigned short ctrl;
......@@ -426,7 +426,7 @@ static void sci_transmit_chars(struct uart_port *port)
static inline void sci_receive_chars(struct uart_port *port)
{
struct sci_port *sci_port = to_sci_port(port);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
int i, count, copied = 0;
unsigned short status;
unsigned char flag;
......@@ -546,7 +546,7 @@ static inline int sci_handle_errors(struct uart_port *port)
{
int copied = 0;
unsigned short status = sci_in(port, SCxSR);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
if (status & SCxSR_ORER(port)) {
/* overrun error */
......@@ -600,7 +600,7 @@ static inline int sci_handle_errors(struct uart_port *port)
static inline int sci_handle_fifo_overrun(struct uart_port *port)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
int copied = 0;
if (port->type != PORT_SCIF)
......@@ -623,7 +623,7 @@ static inline int sci_handle_breaks(struct uart_port *port)
{
int copied = 0;
unsigned short status = sci_in(port, SCxSR);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
struct sci_port *s = to_sci_port(port);
if (uart_handle_break(port))
......
......@@ -469,9 +469,9 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
return;
}
if (port->sc_port.info) {
if (port->sc_port.state) {
/* The serial_core stuffs are initilized, use them */
tty = port->sc_port.info->port.tty;
tty = port->sc_port.state->port.tty;
}
else {
/* Not registered yet - can't pass to tty layer. */
......@@ -550,9 +550,9 @@ static void sn_transmit_chars(struct sn_cons_port *port, int raw)
BUG_ON(!port->sc_is_asynch);
if (port->sc_port.info) {
if (port->sc_port.state) {
/* We're initilized, using serial core infrastructure */
xmit = &port->sc_port.info->xmit;
xmit = &port->sc_port.state->xmit;
} else {
/* Probably sn_sal_switch_to_asynch has been run but serial core isn't
* initilized yet. Just return. Writes are going through
......@@ -927,7 +927,7 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count)
/* We can't look at the xmit buffer if we're not registered with serial core
* yet. So only do the fancy recovery after registering
*/
if (!port->sc_port.info) {
if (!port->sc_port.state) {
/* Not yet registered with serial core - simple case */
puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count);
return;
......@@ -936,8 +936,8 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count)
/* somebody really wants this output, might be an
* oops, kdb, panic, etc. make sure they get it. */
if (spin_is_locked(&port->sc_port.lock)) {
int lhead = port->sc_port.info->xmit.head;
int ltail = port->sc_port.info->xmit.tail;
int lhead = port->sc_port.state->xmit.head;
int ltail = port->sc_port.state->xmit.tail;
int counter, got_lock = 0;
/*
......@@ -962,13 +962,13 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count)
break;
} else {
/* still locked */
if ((lhead != port->sc_port.info->xmit.head)
if ((lhead != port->sc_port.state->xmit.head)
|| (ltail !=
port->sc_port.info->xmit.tail)) {
port->sc_port.state->xmit.tail)) {
lhead =
port->sc_port.info->xmit.head;
port->sc_port.state->xmit.head;
ltail =
port->sc_port.info->xmit.tail;
port->sc_port.state->xmit.tail;
counter = 0;
}
}
......
......@@ -184,8 +184,8 @@ static struct tty_struct *receive_chars(struct uart_port *port)
{
struct tty_struct *tty = NULL;
if (port->info != NULL) /* Unopened serial console */
tty = port->info->port.tty;
if (port->state != NULL) /* Unopened serial console */
tty = port->state->port.tty;
if (sunhv_ops->receive_chars(port, tty))
sun_do_break();
......@@ -197,10 +197,10 @@ static void transmit_chars(struct uart_port *port)
{
struct circ_buf *xmit;
if (!port->info)
if (!port->state)
return;
xmit = &port->info->xmit;
xmit = &port->state->xmit;
if (uart_circ_empty(xmit) || uart_tx_stopped(port))
return;
......
......@@ -117,8 +117,8 @@ receive_chars(struct uart_sunsab_port *up,
int count = 0;
int i;
if (up->port.info != NULL) /* Unopened serial console */
tty = up->port.info->port.tty;
if (up->port.state != NULL) /* Unopened serial console */
tty = up->port.state->port.tty;
/* Read number of BYTES (Character + Status) available. */
if (stat->sreg.isr0 & SAB82532_ISR0_RPF) {
......@@ -229,7 +229,7 @@ static void sunsab_tx_idle(struct uart_sunsab_port *);
static void transmit_chars(struct uart_sunsab_port *up,
union sab82532_irq_status *stat)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int i;
if (stat->sreg.isr1 & SAB82532_ISR1_ALLS) {
......@@ -297,7 +297,7 @@ static void check_status(struct uart_sunsab_port *up,
up->port.icount.dsr++;
}
wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}
static irqreturn_t sunsab_interrupt(int irq, void *dev_id)
......@@ -429,7 +429,7 @@ static void sunsab_tx_idle(struct uart_sunsab_port *up)
static void sunsab_start_tx(struct uart_port *port)
{
struct uart_sunsab_port *up = (struct uart_sunsab_port *) port;
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int i;
up->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS|SAB82532_IMR1_XPR);
......
......@@ -311,7 +311,7 @@ static void sunsu_enable_ms(struct uart_port *port)
static struct tty_struct *
receive_chars(struct uart_sunsu_port *up, unsigned char *status)
{
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned char ch, flag;
int max_count = 256;
int saw_console_brk = 0;
......@@ -389,7 +389,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status)
static void transmit_chars(struct uart_sunsu_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int count;
if (up->port.x_char) {
......@@ -441,7 +441,7 @@ static void check_modem_status(struct uart_sunsu_port *up)
if (status & UART_MSR_DCTS)
uart_handle_cts_change(&up->port, status & UART_MSR_CTS);
wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}
static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id)
......
......@@ -328,9 +328,9 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up,
unsigned char ch, r1, flag;
tty = NULL;
if (up->port.info != NULL && /* Unopened serial console */
up->port.info->port.tty != NULL) /* Keyboard || mouse */
tty = up->port.info->port.tty;
if (up->port.state != NULL && /* Unopened serial console */
up->port.state->port.tty != NULL) /* Keyboard || mouse */
tty = up->port.state->port.tty;
for (;;) {
......@@ -451,7 +451,7 @@ static void sunzilog_status_handle(struct uart_sunzilog_port *up,
uart_handle_cts_change(&up->port,
(status & CTS));
wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}
up->prev_status = status;
......@@ -501,9 +501,9 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
return;
}
if (up->port.info == NULL)
if (up->port.state == NULL)
goto ack_tx_int;
xmit = &up->port.info->xmit;
xmit = &up->port.state->xmit;
if (uart_circ_empty(xmit))
goto ack_tx_int;
......@@ -705,7 +705,7 @@ static void sunzilog_start_tx(struct uart_port *port)
port->icount.tx++;
port->x_char = 0;
} else {
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
writeb(xmit->buf[xmit->tail], &channel->data);
ZSDELAY();
......
......@@ -77,7 +77,7 @@ static void timbuart_flush_buffer(struct uart_port *port)
static void timbuart_rx_chars(struct uart_port *port)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
while (ioread32(port->membase + TIMBUART_ISR) & RXDP) {
u8 ch = ioread8(port->membase + TIMBUART_RXFIFO);
......@@ -86,7 +86,7 @@ static void timbuart_rx_chars(struct uart_port *port)
}
spin_unlock(&port->lock);
tty_flip_buffer_push(port->info->port.tty);
tty_flip_buffer_push(port->state->port.tty);
spin_lock(&port->lock);
dev_dbg(port->dev, "%s - total read %d bytes\n",
......@@ -95,7 +95,7 @@ static void timbuart_rx_chars(struct uart_port *port)
static void timbuart_tx_chars(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
while (!(ioread32(port->membase + TIMBUART_ISR) & TXBF) &&
!uart_circ_empty(xmit)) {
......@@ -118,7 +118,7 @@ static void timbuart_handle_tx_port(struct uart_port *port, u32 isr, u32 *ier)
{
struct timbuart_port *uart =
container_of(port, struct timbuart_port, port);
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if (uart_circ_empty(xmit) || uart_tx_stopped(port))
return;
......@@ -231,7 +231,7 @@ static void timbuart_mctrl_check(struct uart_port *port, u32 isr, u32 *ier)
iowrite32(CTS_DELTA, port->membase + TIMBUART_ISR);
cts = timbuart_get_mctrl(port);
uart_handle_cts_change(port, cts & TIOCM_CTS);
wake_up_interruptible(&port->info->delta_msr_wait);
wake_up_interruptible(&port->state->delta_msr_wait);
}
*ier |= CTS_DELTA;
......
......@@ -75,7 +75,7 @@ static struct uart_port ulite_ports[ULITE_NR_UARTS];
static int ulite_receive(struct uart_port *port, int stat)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned char ch = 0;
char flag = TTY_NORMAL;
......@@ -125,7 +125,7 @@ static int ulite_receive(struct uart_port *port, int stat)
static int ulite_transmit(struct uart_port *port, int stat)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
if (stat & ULITE_STATUS_TXFULL)
return 0;
......@@ -162,7 +162,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
busy |= ulite_transmit(port, stat);
} while (busy);
tty_flip_buffer_push(port->info->port.tty);
tty_flip_buffer_push(port->state->port.tty);
return IRQ_HANDLED;
}
......
......@@ -327,7 +327,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port)
unsigned char *p;
unsigned int count;
struct uart_port *port = &qe_port->port;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
bdp = qe_port->rx_cur;
......@@ -466,7 +466,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port)
int i;
unsigned char ch, *cp;
struct uart_port *port = &qe_port->port;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
struct qe_bd *bdp;
u16 status;
unsigned int flg;
......
......@@ -318,7 +318,7 @@ static inline void receive_chars(struct uart_port *port, uint8_t *status)
char flag;
int max_count = RX_MAX_COUNT;
tty = port->info->port.tty;
tty = port->state->port.tty;
lsr = *status;
do {
......@@ -386,7 +386,7 @@ static inline void check_modem_status(struct uart_port *port)
if (msr & UART_MSR_DCTS)
uart_handle_cts_change(port, msr & UART_MSR_CTS);
wake_up_interruptible(&port->info->delta_msr_wait);
wake_up_interruptible(&port->state->delta_msr_wait);
}
static inline void transmit_chars(struct uart_port *port)
......@@ -394,7 +394,7 @@ static inline void transmit_chars(struct uart_port *port)
struct circ_buf *xmit;
int max_count = TX_MAX_COUNT;
xmit = &port->info->xmit;
xmit = &port->state->xmit;
if (port->x_char) {
siu_write(port, UART_TX, port->x_char);
......
......@@ -602,12 +602,12 @@ static void zs_receive_chars(struct zs_port *zport)
uart_insert_char(uport, status, Rx_OVR, ch, flag);
}
tty_flip_buffer_push(uport->info->port.tty);
tty_flip_buffer_push(uport->state->port.tty);
}
static void zs_raw_transmit_chars(struct zs_port *zport)
{
struct circ_buf *xmit = &zport->port.info->xmit;
struct circ_buf *xmit = &zport->port.state->xmit;
/* XON/XOFF chars. */
if (zport->port.x_char) {
......@@ -686,7 +686,7 @@ static void zs_status_handle(struct zs_port *zport, struct zs_port *zport_a)
uport->icount.rng++;
if (delta)
wake_up_interruptible(&uport->info->delta_msr_wait);
wake_up_interruptible(&uport->state->delta_msr_wait);
spin_lock(&scc->zlock);
}
......
......@@ -186,7 +186,6 @@
#include <linux/sysrq.h>
struct uart_port;
struct uart_info;
struct serial_struct;
struct device;
......@@ -284,7 +283,7 @@ struct uart_port {
unsigned int read_status_mask; /* driver specific */
unsigned int ignore_status_mask; /* driver specific */
struct uart_info *info; /* pointer to parent info */
struct uart_state *state; /* pointer to parent state */
struct uart_icount icount; /* statistics */
struct console *cons; /* struct console, if any */
......@@ -343,8 +342,22 @@ struct uart_port {
*/
typedef unsigned int __bitwise__ uif_t;
struct uart_info {
/*
* This is the state information which is persistent across opens.
* The low level driver must not to touch any elements contained
* within.
*/
struct uart_state {
struct tty_port port;
unsigned int close_delay; /* msec */
unsigned int closing_wait; /* msec */
#define USF_CLOSING_WAIT_INF (0)
#define USF_CLOSING_WAIT_NONE (~0U)
int count;
int pm_state;
struct circ_buf xmit;
uif_t flags;
......@@ -362,24 +375,7 @@ struct uart_info {
struct tasklet_struct tlet;
wait_queue_head_t delta_msr_wait;
};
/*
* This is the state information which is persistent across opens.
* The low level driver must not to touch any elements contained
* within.
*/
struct uart_state {
unsigned int close_delay; /* msec */
unsigned int closing_wait; /* msec */
#define USF_CLOSING_WAIT_INF (0)
#define USF_CLOSING_WAIT_NONE (~0U)
int count;
int pm_state;
struct uart_info info;
struct uart_port *port;
struct uart_port *uart_port;
struct mutex mutex;
};
......@@ -462,7 +458,7 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
static inline int uart_tx_stopped(struct uart_port *port)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
if(tty->stopped || tty->hw_stopped)
return 1;
return 0;
......@@ -477,7 +473,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
#ifdef SUPPORT_SYSRQ
if (port->sysrq) {
if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, port->info->port.tty);
handle_sysrq(ch, port->state->port.tty);
port->sysrq = 0;
return 1;
}
......@@ -495,7 +491,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
*/
static inline int uart_handle_break(struct uart_port *port)
{
struct uart_info *info = port->info;
struct uart_state *state = port->state;
#ifdef SUPPORT_SYSRQ
if (port->cons && port->cons->index == port->line) {
if (!port->sysrq) {
......@@ -506,7 +502,7 @@ static inline int uart_handle_break(struct uart_port *port)
}
#endif
if (port->flags & UPF_SAK)
do_SAK(info->port.tty);
do_SAK(state->port.tty);
return 0;
}
......@@ -518,7 +514,7 @@ static inline int uart_handle_break(struct uart_port *port)
static inline void
uart_handle_dcd_change(struct uart_port *port, unsigned int status)
{
struct uart_info *info = port->info;
struct uart_state *state = port->state;
port->icount.dcd++;
......@@ -527,11 +523,11 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
hardpps();
#endif
if (info->flags & UIF_CHECK_CD) {
if (state->flags & UIF_CHECK_CD) {
if (status)
wake_up_interruptible(&info->port.open_wait);
else if (info->port.tty)
tty_hangup(info->port.tty);
wake_up_interruptible(&state->port.open_wait);
else if (state->port.tty)
tty_hangup(state->port.tty);
}
}
......@@ -543,12 +539,12 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
static inline void
uart_handle_cts_change(struct uart_port *port, unsigned int status)
{
struct uart_info *info = port->info;
struct tty_struct *tty = info->port.tty;
struct uart_state *state = port->state;
struct tty_struct *tty = state->port.tty;
port->icount.cts++;
if (info->flags & UIF_CTS_FLOW) {
if (state->flags & UIF_CTS_FLOW) {
if (tty->hw_stopped) {
if (status) {
tty->hw_stopped = 0;
......@@ -570,7 +566,7 @@ static inline void
uart_insert_char(struct uart_port *port, unsigned int status,
unsigned int overrun, unsigned int ch, unsigned int flag)
{
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
if ((status & port->ignore_status_mask & ~overrun) == 0)
tty_insert_flip_char(tty, ch, flag);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册