Commit ebd2c8f6 authored by Alan Cox's avatar Alan Cox Committed by Live-CD User
Browse files

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: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment