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: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Cox
2009-09-19 13:13:28 -07:00
committed by Live-CD User
parent 11d85d7b2e
commit ebd2c8f6d2
50 changed files with 422 additions and 432 deletions
+3 -3
View File
@@ -95,7 +95,7 @@ void foo(void)
OFFSET(__iobase, mn10300_serial_port, _iobase); OFFSET(__iobase, mn10300_serial_port, _iobase);
DEFINE(__UART_XMIT_SIZE, UART_XMIT_SIZE); DEFINE(__UART_XMIT_SIZE, UART_XMIT_SIZE);
OFFSET(__xmit_buffer, uart_info, xmit.buf); OFFSET(__xmit_buffer, uart_state, xmit.buf);
OFFSET(__xmit_head, uart_info, xmit.head); OFFSET(__xmit_head, uart_state, xmit.head);
OFFSET(__xmit_tail, uart_info, xmit.tail); OFFSET(__xmit_tail, uart_state, xmit.tail);
} }
+4 -4
View File
@@ -86,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port)
static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
{ {
struct uart_port *port = 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; unsigned int status, ch, flag, rxs, max_count = 256;
status = *CSR_UARTFLG; 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) static irqreturn_t serial21285_tx_chars(int irq, void *dev_id)
{ {
struct uart_port *port = 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; int count = 256;
if (port->x_char) { 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); baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
quot = uart_get_divisor(port, baud); quot = uart_get_divisor(port, baud);
if (port->info && port->info->port.tty) { if (port->state && port->state->port.tty) {
struct tty_struct *tty = port->info->port.tty; struct tty_struct *tty = port->state->port.tty;
unsigned int b = port->uartclk / (16 * quot); unsigned int b = port->uartclk / (16 * quot);
tty_encode_baud_rate(tty, b, b); tty_encode_baud_rate(tty, b, b);
} }
+5 -5
View File
@@ -1382,7 +1382,7 @@ static void serial8250_enable_ms(struct uart_port *port)
static void static void
receive_chars(struct uart_8250_port *up, unsigned int *status) 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; unsigned char ch, lsr = *status;
int max_count = 256; int max_count = 256;
char flag; char flag;
@@ -1457,7 +1457,7 @@ ignore_char:
static void transmit_chars(struct uart_8250_port *up) 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; int count;
if (up->port.x_char) { 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; status |= up->msr_saved_flags;
up->msr_saved_flags = 0; up->msr_saved_flags = 0;
if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI &&
up->port.info != NULL) { up->port.state != NULL) {
if (status & UART_MSR_TERI) if (status & UART_MSR_TERI)
up->port.icount.rng++; up->port.icount.rng++;
if (status & UART_MSR_DDSR) 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) if (status & UART_MSR_DCTS)
uart_handle_cts_change(&up->port, status & UART_MSR_CTS); 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; return status;
@@ -1764,7 +1764,7 @@ static void serial8250_backup_timeout(unsigned long data)
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
spin_unlock_irqrestore(&up->port.lock, flags); spin_unlock_irqrestore(&up->port.lock, flags);
if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && 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)) { (lsr & UART_LSR_THRE)) {
iir &= ~(UART_IIR_ID | UART_IIR_NO_INT); iir &= ~(UART_IIR_ID | UART_IIR_NO_INT);
iir |= UART_IIR_THRI; iir |= UART_IIR_THRI;
+3 -3
View File
@@ -117,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port)
static void pl010_rx_chars(struct uart_amba_port *uap) 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; unsigned int status, ch, flag, rsr, max_count = 256;
status = readb(uap->port.membase + UART01x_FR); 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) 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; int count;
if (uap->port.x_char) { if (uap->port.x_char) {
@@ -225,7 +225,7 @@ static void pl010_modem_status(struct uart_amba_port *uap)
if (delta & UART01x_FR_CTS) if (delta & UART01x_FR_CTS)
uart_handle_cts_change(&uap->port, status & 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) static irqreturn_t pl010_int(int irq, void *dev_id)
+3 -3
View File
@@ -124,7 +124,7 @@ static void pl011_enable_ms(struct uart_port *port)
static void pl011_rx_chars(struct uart_amba_port *uap) 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; unsigned int status, ch, flag, max_count = 256;
status = readw(uap->port.membase + UART01x_FR); 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) 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; int count;
if (uap->port.x_char) { if (uap->port.x_char) {
@@ -226,7 +226,7 @@ static void pl011_modem_status(struct uart_amba_port *uap)
if (delta & UART01x_FR_CTS) if (delta & UART01x_FR_CTS)
uart_handle_cts_change(&uap->port, status & 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) static irqreturn_t pl011_int(int irq, void *dev_id)
+7 -7
View File
@@ -427,7 +427,7 @@ static void atmel_rx_chars(struct uart_port *port)
*/ */
static void atmel_tx_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) { if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) {
UART_PUT_CHAR(port, port->x_char); 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) static void atmel_tx_dma(struct uart_port *port)
{ {
struct atmel_uart_port *atmel_port = to_atmel_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; struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
int count; int count;
@@ -663,14 +663,14 @@ static void atmel_rx_from_ring(struct uart_port *port)
* uart_start(), which takes the lock. * uart_start(), which takes the lock.
*/ */
spin_unlock(&port->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); spin_lock(&port->lock);
} }
static void atmel_rx_from_dma(struct uart_port *port) static void atmel_rx_from_dma(struct uart_port *port)
{ {
struct atmel_uart_port *atmel_port = to_atmel_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; struct atmel_dma_buffer *pdc;
int rx_idx = atmel_port->pdc_rx_idx; int rx_idx = atmel_port->pdc_rx_idx;
unsigned int head; unsigned int head;
@@ -776,7 +776,7 @@ static void atmel_tasklet_func(unsigned long data)
if (status_change & ATMEL_US_CTS) if (status_change & ATMEL_US_CTS)
uart_handle_cts_change(port, !(status & 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; 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) static int atmel_startup(struct uart_port *port)
{ {
struct atmel_uart_port *atmel_port = to_atmel_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; int retval;
/* /*
@@ -854,7 +854,7 @@ static int atmel_startup(struct uart_port *port)
} }
if (atmel_use_dma_tx(port)) { if (atmel_use_dma_tx(port)) {
struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; 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->buf = xmit->buf;
pdc->dma_addr = dma_map_single(port->dev, pdc->dma_addr = dma_map_single(port->dev,
+10 -10
View File
@@ -144,7 +144,7 @@ static void bfin_serial_stop_tx(struct uart_port *port)
{ {
struct bfin_serial_port *uart = (struct bfin_serial_port *)port; struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
#ifdef CONFIG_SERIAL_BFIN_DMA #ifdef CONFIG_SERIAL_BFIN_DMA
struct circ_buf *xmit = &uart->port.info->xmit; struct circ_buf *xmit = &uart->port.state->xmit;
#endif #endif
while (!(UART_GET_LSR(uart) & TEMT)) 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) static void bfin_serial_start_tx(struct uart_port *port)
{ {
struct bfin_serial_port *uart = (struct bfin_serial_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 #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) { 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; return;
} }
if (!uart->port.info || !uart->port.info->port.tty) if (!uart->port.state || !uart->port.state->port.tty)
return; return;
#endif #endif
tty = uart->port.info->port.tty; tty = uart->port.state->port.tty;
if (ANOMALY_05000363) { if (ANOMALY_05000363) {
/* The BF533 (and BF561) family of processors have a nice anomaly /* 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) 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)) { if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) {
#ifdef CONFIG_BF54x #ifdef CONFIG_BF54x
@@ -398,7 +398,7 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
#ifdef CONFIG_SERIAL_BFIN_DMA #ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) 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; 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) 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; int i, flg, status;
status = UART_GET_LSR(uart); 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) static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id)
{ {
struct bfin_serial_port *uart = 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 #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->scts && !(bfin_serial_get_mctrl(&uart->port)&TIOCM_CTS)) { 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; int line = port->line;
unsigned short val; unsigned short val;
if (line >= port->info->port.tty->driver->num) if (line >= port->state->port.tty->driver->num)
return; return;
switch (port->info->port.tty->termios->c_line) { switch (port->state->port.tty->termios->c_line) {
case N_IRDA: case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]); val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC); val |= (IREN | RPOLC);
+3 -3
View File
@@ -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) static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id)
{ {
struct sport_uart_port *up = 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; unsigned int ch;
do { 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) static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
{ {
struct sport_uart_port *up = 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); unsigned int stat = SPORT_GET_STAT(up);
/* Overflow in RX FIFO */ /* Overflow in RX FIFO */
@@ -290,7 +290,7 @@ fail1:
static void sport_uart_tx_chars(struct sport_uart_port *up) 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) if (SPORT_GET_STAT(up) & TXF)
return; return;
+2 -2
View File
@@ -93,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id) static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
{ {
struct uart_port *port = 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; unsigned int status, ch, flg;
status = clps_readl(SYSFLG(port)); 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) static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
{ {
struct uart_port *port = dev_id; struct uart_port *port = dev_id;
struct circ_buf *xmit = &port->info->xmit; struct circ_buf *xmit = &port->state->xmit;
int count; int count;
if (port->x_char) { if (port->x_char) {
+1 -1
View File
@@ -244,7 +244,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
int i; int i;
unsigned char ch; unsigned char ch;
u8 *cp; 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; struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
cbd_t __iomem *bdp; cbd_t __iomem *bdp;
u16 status; u16 status;
+3 -3
View File
@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) {
dport = &mux->dport[LINE(status)]; dport = &mux->dport[LINE(status)];
uport = &dport->port; 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 */ ch = UCHAR(status); /* grab the char */
flag = TTY_NORMAL; 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++) for (i = 0; i < DZ_NB_PORT; i++)
if (lines_rx[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); status = dz_in(dport, DZ_CSR);
dport = &mux->dport[LINE(status)]; dport = &mux->dport[LINE(status)];
xmit = &dport->port.info->xmit; xmit = &dport->port.state->xmit;
if (dport->port.x_char) { /* XON/XOFF chars */ if (dport->port.x_char) { /* XON/XOFF chars */
dz_out(dport, DZ_TDR, dport->port.x_char); dz_out(dport, DZ_TDR, dport->port.x_char);
+8 -8
View File
@@ -627,7 +627,7 @@ static int icom_write(struct uart_port *port)
unsigned long data_count; unsigned long data_count;
unsigned char cmdReg; unsigned char cmdReg;
unsigned long offset; unsigned long offset;
int temp_tail = port->info->xmit.tail; int temp_tail = port->state->xmit.tail;
trace(ICOM_PORT, "WRITE", 0); trace(ICOM_PORT, "WRITE", 0);
@@ -638,11 +638,11 @@ static int icom_write(struct uart_port *port)
} }
data_count = 0; data_count = 0;
while ((port->info->xmit.head != temp_tail) && while ((port->state->xmit.head != temp_tail) &&
(data_count <= XMIT_BUFF_SZ)) { (data_count <= XMIT_BUFF_SZ)) {
ICOM_PORT->xmit_buf[data_count++] = ICOM_PORT->xmit_buf[data_count++] =
port->info->xmit.buf[temp_tail]; port->state->xmit.buf[temp_tail];
temp_tail++; temp_tail++;
temp_tail &= (UART_XMIT_SIZE - 1); 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, uart_handle_cts_change(&icom_port->uart_port,
delta_status & ICOM_CTS); delta_status & ICOM_CTS);
wake_up_interruptible(&icom_port->uart_port.info-> wake_up_interruptible(&icom_port->uart_port.state->
delta_msr_wait); delta_msr_wait);
old_status = status; 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; icom_port->uart_port.icount.tx += count;
for (i=0; i<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.state->xmit.tail++;
icom_port->uart_port.info->xmit.tail &= icom_port->uart_port.state->xmit.tail &=
(UART_XMIT_SIZE - 1); (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) static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port)
{ {
short int count, rcv_buff; 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; unsigned short int status;
struct uart_icount *icount; struct uart_icount *icount;
unsigned long offset; unsigned long offset;
+8 -8
View File
@@ -224,7 +224,7 @@ static void imx_mctrl_check(struct imx_port *sport)
if (changed & TIOCM_CTS) if (changed & TIOCM_CTS)
uart_handle_cts_change(&sport->port, status & 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; struct imx_port *sport = (struct imx_port *)data;
unsigned long flags; unsigned long flags;
if (sport->port.info) { if (sport->port.state) {
spin_lock_irqsave(&sport->port.lock, flags); spin_lock_irqsave(&sport->port.lock, flags);
imx_mctrl_check(sport); imx_mctrl_check(sport);
spin_unlock_irqrestore(&sport->port.lock, flags); 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) 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)) { while (!(readl(sport->port.membase + UTS) & UTS_TXFULL)) {
/* send xmit->buf[xmit->tail] /* 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); writel(USR1_RTSD, sport->port.membase + USR1);
uart_handle_cts_change(&sport->port, !!val); 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); spin_unlock_irqrestore(&sport->port.lock, flags);
return IRQ_HANDLED; 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) static irqreturn_t imx_txint(int irq, void *dev_id)
{ {
struct imx_port *sport = 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; unsigned long flags;
spin_lock_irqsave(&sport->port.lock,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; struct imx_port *sport = dev_id;
unsigned int rx,flg,ignored = 0; 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; unsigned long flags, temp;
spin_lock_irqsave(&sport->port.lock,flags); 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, rational_best_approximation(16 * div * baud, sport->port.uartclk,
1 << 16, 1 << 16, &num, &denom); 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 = sport->port.uartclk;
tdiv64 *= num; tdiv64 *= num;
do_div(tdiv64, denom * 16 * div); 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); (speed_t)tdiv64, (speed_t)tdiv64);
} }
+26 -26
View File
@@ -897,25 +897,25 @@ static void transmit_chars(struct uart_port *the_port)
char *start; char *start;
struct tty_struct *tty; struct tty_struct *tty;
struct ioc3_port *port = get_ioc3_port(the_port); struct ioc3_port *port = get_ioc3_port(the_port);
struct uart_info *info; struct uart_state *state;
if (!the_port) if (!the_port)
return; return;
if (!port) if (!port)
return; return;
info = the_port->info; state = the_port->state;
tty = info->port.tty; 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 */ /* Nothing to do or hw stopped */
set_notification(port, N_ALL_OUTPUT, 0); set_notification(port, N_ALL_OUTPUT, 0);
return; return;
} }
head = info->xmit.head; head = state->xmit.head;
tail = info->xmit.tail; tail = state->xmit.tail;
start = (char *)&info->xmit.buf[tail]; start = (char *)&state->xmit.buf[tail];
/* write out all the data or until the end of the buffer */ /* write out all the data or until the end of the buffer */
xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); 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 */ /* advance the pointers */
tail += result; tail += result;
tail &= UART_XMIT_SIZE - 1; tail &= UART_XMIT_SIZE - 1;
info->xmit.tail = tail; state->xmit.tail = tail;
start = (char *)&info->xmit.buf[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); uart_write_wakeup(the_port);
if (uart_circ_empty(&info->xmit)) { if (uart_circ_empty(&state->xmit)) {
set_notification(port, N_OUTPUT_LOWAT, 0); set_notification(port, N_OUTPUT_LOWAT, 0);
} else { } else {
set_notification(port, N_OUTPUT_LOWAT, 1); set_notification(port, N_OUTPUT_LOWAT, 1);
@@ -956,7 +956,7 @@ ioc3_change_speed(struct uart_port *the_port,
unsigned int cflag; unsigned int cflag;
int baud; int baud;
int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; 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; 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; 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 the_port->ignore_status_mask &= ~(N_PARITY_ERROR
| N_FRAMING_ERROR); | N_FRAMING_ERROR);
if (I_IGNBRK(info->port.tty)) { if (I_IGNBRK(state->port.tty)) {
the_port->ignore_status_mask &= ~N_BREAK; 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; the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
} }
if (!(cflag & CREAD)) { 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 uart_handle_dcd_change
(port->ip_port, 0); (port->ip_port, 0);
wake_up_interruptible wake_up_interruptible
(&the_port->info-> (&the_port->state->
delta_msr_wait); delta_msr_wait);
} }
@@ -1392,21 +1392,21 @@ static int receive_chars(struct uart_port *the_port)
struct tty_struct *tty; struct tty_struct *tty;
unsigned char ch[MAX_CHARS]; unsigned char ch[MAX_CHARS];
int read_count = 0, read_room, flip = 0; 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); struct ioc3_port *port = get_ioc3_port(the_port);
unsigned long pflags; unsigned long pflags;
/* Make sure all the pointers are "good" ones */ /* Make sure all the pointers are "good" ones */
if (!info) if (!state)
return 0; return 0;
if (!info->port.tty) if (!state->port.tty)
return 0; return 0;
if (!(port->ip_flags & INPUT_ENABLE)) if (!(port->ip_flags & INPUT_ENABLE))
return 0; return 0;
spin_lock_irqsave(&the_port->lock, pflags); spin_lock_irqsave(&the_port->lock, pflags);
tty = info->port.tty; tty = state->port.tty;
read_count = do_read(the_port, ch, MAX_CHARS); read_count = do_read(the_port, ch, MAX_CHARS);
if (read_count > 0) { if (read_count > 0) {
@@ -1491,7 +1491,7 @@ ioc3uart_intr_one(struct ioc3_submodule *is,
uart_handle_dcd_change(the_port, uart_handle_dcd_change(the_port,
shadow & SHADOW_DCD); shadow & SHADOW_DCD);
wake_up_interruptible wake_up_interruptible
(&the_port->info->delta_msr_wait); (&the_port->state->delta_msr_wait);
} else if ((port->ip_notify & N_DDCD) } else if ((port->ip_notify & N_DDCD)
&& !(shadow & SHADOW_DCD)) { && !(shadow & SHADOW_DCD)) {
/* Flag delta DCD/no DCD */ /* Flag delta DCD/no DCD */
@@ -1511,7 +1511,7 @@ ioc3uart_intr_one(struct ioc3_submodule *is,
uart_handle_cts_change(the_port, shadow uart_handle_cts_change(the_port, shadow
& SHADOW_CTS); & SHADOW_CTS);
wake_up_interruptible 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; unsigned long port_flags;
struct ioc3_port *port; struct ioc3_port *port;
struct uart_info *info; struct uart_state *state;
port = get_ioc3_port(the_port); port = get_ioc3_port(the_port);
if (!port) if (!port)
return; return;
info = the_port->info; state = the_port->state;
wake_up_interruptible(&info->delta_msr_wait); wake_up_interruptible(&state->delta_msr_wait);
spin_lock_irqsave(&the_port->lock, port_flags); spin_lock_irqsave(&the_port->lock, port_flags);
set_notification(port, N_ALL, 0); set_notification(port, N_ALL, 0);
+33 -33
View File
@@ -1627,25 +1627,25 @@ static void transmit_chars(struct uart_port *the_port)
char *start; char *start;
struct tty_struct *tty; struct tty_struct *tty;
struct ioc4_port *port = get_ioc4_port(the_port, 0); struct ioc4_port *port = get_ioc4_port(the_port, 0);
struct uart_info *info; struct uart_state *state;
if (!the_port) if (!the_port)
return; return;
if (!port) if (!port)
return; return;
info = the_port->info; state = the_port->state;
tty = info->port.tty; 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 */ /* Nothing to do or hw stopped */
set_notification(port, N_ALL_OUTPUT, 0); set_notification(port, N_ALL_OUTPUT, 0);
return; return;
} }
head = info->xmit.head; head = state->xmit.head;
tail = info->xmit.tail; tail = state->xmit.tail;
start = (char *)&info->xmit.buf[tail]; start = (char *)&state->xmit.buf[tail];
/* write out all the data or until the end of the buffer */ /* write out all the data or until the end of the buffer */
xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); 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 */ /* advance the pointers */
tail += result; tail += result;
tail &= UART_XMIT_SIZE - 1; tail &= UART_XMIT_SIZE - 1;
info->xmit.tail = tail; state->xmit.tail = tail;
start = (char *)&info->xmit.buf[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); uart_write_wakeup(the_port);
if (uart_circ_empty(&info->xmit)) { if (uart_circ_empty(&state->xmit)) {
set_notification(port, N_OUTPUT_LOWAT, 0); set_notification(port, N_OUTPUT_LOWAT, 0);
} else { } else {
set_notification(port, N_OUTPUT_LOWAT, 1); set_notification(port, N_OUTPUT_LOWAT, 1);
@@ -1686,7 +1686,7 @@ ioc4_change_speed(struct uart_port *the_port,
int baud, bits; int baud, bits;
unsigned cflag; unsigned cflag;
int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; 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; 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; 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 the_port->ignore_status_mask &= ~(N_PARITY_ERROR
| N_FRAMING_ERROR); | N_FRAMING_ERROR);
if (I_IGNBRK(info->port.tty)) { if (I_IGNBRK(state->port.tty)) {
the_port->ignore_status_mask &= ~N_BREAK; 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; the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
} }
if (!(cflag & CREAD)) { 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) static inline int ic4_startup_local(struct uart_port *the_port)
{ {
struct ioc4_port *port; struct ioc4_port *port;
struct uart_info *info; struct uart_state *state;
if (!the_port) if (!the_port)
return -1; return -1;
@@ -1793,7 +1793,7 @@ static inline int ic4_startup_local(struct uart_port *the_port)
if (!port) if (!port)
return -1; return -1;
info = the_port->info; state = the_port->state;
local_open(port); 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); ioc4_set_proto(port, the_port->mapbase);
/* set the speed of the serial port */ /* 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); (struct ktermios *)0);
return 0; return 0;
@@ -1882,7 +1882,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
the_port = port->ip_port; the_port = port->ip_port;
the_port->icount.dcd = 1; the_port->icount.dcd = 1;
wake_up_interruptible wake_up_interruptible
(&the_port-> info->delta_msr_wait); (&the_port->state->delta_msr_wait);
} else if ((port->ip_notify & N_DDCD) } else if ((port->ip_notify & N_DDCD)
&& !(shadow & IOC4_SHADOW_DCD)) { && !(shadow & IOC4_SHADOW_DCD)) {
/* Flag delta DCD/no DCD */ /* Flag delta DCD/no DCD */
@@ -1904,7 +1904,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
the_port->icount.cts = the_port->icount.cts =
(shadow & IOC4_SHADOW_CTS) ? 1 : 0; (shadow & IOC4_SHADOW_CTS) ? 1 : 0;
wake_up_interruptible 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) { && port->ip_port) {
the_port->icount.dcd = 0; the_port->icount.dcd = 0;
wake_up_interruptible wake_up_interruptible
(&the_port->info-> (&the_port->state->
delta_msr_wait); delta_msr_wait);
} }
@@ -2341,17 +2341,17 @@ static void receive_chars(struct uart_port *the_port)
unsigned char ch[IOC4_MAX_CHARS]; unsigned char ch[IOC4_MAX_CHARS];
int read_count, request_count = IOC4_MAX_CHARS; int read_count, request_count = IOC4_MAX_CHARS;
struct uart_icount *icount; struct uart_icount *icount;
struct uart_info *info = the_port->info; struct uart_state *state = the_port->state;
unsigned long pflags; unsigned long pflags;
/* Make sure all the pointers are "good" ones */ /* Make sure all the pointers are "good" ones */
if (!info) if (!state)
return; return;
if (!info->port.tty) if (!state->port.tty)
return; return;
spin_lock_irqsave(&the_port->lock, pflags); 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); 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; unsigned long port_flags;
struct ioc4_port *port; struct ioc4_port *port;
struct uart_info *info; struct uart_state *state;
port = get_ioc4_port(the_port, 0); port = get_ioc4_port(the_port, 0);
if (!port) if (!port)
return; return;
info = the_port->info; state = the_port->state;
port->ip_port = NULL; port->ip_port = NULL;
wake_up_interruptible(&info->delta_msr_wait); wake_up_interruptible(&state->delta_msr_wait);
if (info->port.tty) if (state->port.tty)
set_bit(TTY_IO_ERROR, &info->port.tty->flags); set_bit(TTY_IO_ERROR, &state->port.tty->flags);
spin_lock_irqsave(&the_port->lock, port_flags); spin_lock_irqsave(&the_port->lock, port_flags);
set_notification(port, N_ALL, 0); set_notification(port, N_ALL, 0);
@@ -2538,7 +2538,7 @@ static int ic4_startup(struct uart_port *the_port)
int retval; int retval;
struct ioc4_port *port; struct ioc4_port *port;
struct ioc4_control *control; struct ioc4_control *control;
struct uart_info *info; struct uart_state *state;
unsigned long port_flags; unsigned long port_flags;
if (!the_port) if (!the_port)
@@ -2546,7 +2546,7 @@ static int ic4_startup(struct uart_port *the_port)
port = get_ioc4_port(the_port, 1); port = get_ioc4_port(the_port, 1);
if (!port) if (!port)
return -ENODEV; return -ENODEV;
info = the_port->info; state = the_port->state;
control = port->ip_control; control = port->ip_control;
if (!control) { if (!control) {
+7 -7
View File
@@ -256,9 +256,9 @@ static struct tty_struct *ip22zilog_receive_chars(struct uart_ip22zilog_port *up
unsigned int r1; unsigned int r1;
tty = NULL; tty = NULL;
if (up->port.info != NULL && if (up->port.state != NULL &&
up->port.info->port.tty != NULL) up->port.state->port.tty != NULL)
tty = up->port.info->port.tty; tty = up->port.state->port.tty;
for (;;) { for (;;) {
ch = readb(&channel->control); ch = readb(&channel->control);
@@ -354,7 +354,7 @@ static void ip22zilog_status_handle(struct uart_ip22zilog_port *up,
uart_handle_cts_change(&up->port, uart_handle_cts_change(&up->port,
(status & CTS)); (status & CTS));
wake_up_interruptible(&up->port.info->delta_msr_wait); wake_up_interruptible(&up->port.state->delta_msr_wait);
} }
up->prev_status = status; up->prev_status = status;
@@ -404,9 +404,9 @@ static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up,
return; return;
} }
if (up->port.info == NULL) if (up->port.state == NULL)
goto ack_tx_int; goto ack_tx_int;
xmit = &up->port.info->xmit; xmit = &up->port.state->xmit;
if (uart_circ_empty(xmit)) if (uart_circ_empty(xmit))
goto ack_tx_int; goto ack_tx_int;
if (uart_tx_stopped(&up->port)) if (uart_tx_stopped(&up->port))
@@ -607,7 +607,7 @@ static void ip22zilog_start_tx(struct uart_port *port)
port->icount.tx++; port->icount.tx++;
port->x_char = 0; port->x_char = 0;
} else { } else {
struct circ_buf *xmit = &port->info->xmit; struct circ_buf *xmit = &port->state->xmit;
writeb(xmit->buf[xmit->tail], &channel->data); writeb(xmit->buf[xmit->tail], &channel->data);
ZSDELAY(); ZSDELAY();
+1 -1
View File
@@ -989,7 +989,7 @@ static void neo_param(struct jsm_channel *ch)
{ 50, B50 }, { 50, B50 },
}; };
cflag = C_BAUD(ch->uart_port.info->port.tty); cflag = C_BAUD(ch->uart_port.state->port.tty);
baud = 9600; baud = 9600;
for (i = 0; i < ARRAY_SIZE(baud_rates); i++) { for (i = 0; i < ARRAY_SIZE(baud_rates); i++) {
if (baud_rates[i].cflag == cflag) { if (baud_rates[i].cflag == cflag) {
+10 -10
View File
@@ -147,7 +147,7 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch)
struct ktermios *termios; struct ktermios *termios;
spin_lock_irqsave(&port->lock, lock_flags); 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]) if (ch == termios->c_cc[VSTART])
channel->ch_bd->bd_ops->send_start_character(channel); 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_cached_lsr = 0;
channel->ch_stops_sent = 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_cflag = termios->c_cflag;
channel->ch_c_iflag = termios->c_iflag; channel->ch_c_iflag = termios->c_iflag;
channel->ch_c_oflag = termios->c_oflag; 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"); jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n");
bd = channel->ch_bd; bd = channel->ch_bd;
ts = port->info->port.tty->termios; ts = port->state->port.tty->termios;
channel->ch_flags &= ~(CH_STOPI); channel->ch_flags &= ~(CH_STOPI);
@@ -530,7 +530,7 @@ void jsm_input(struct jsm_channel *ch)
if (!ch) if (!ch)
return; return;
tp = ch->uart_port.info->port.tty; tp = ch->uart_port.state->port.tty;
bd = ch->ch_bd; bd = ch->ch_bd;
if(!bd) if(!bd)
@@ -849,7 +849,7 @@ int jsm_tty_write(struct uart_port *port)
u16 tail; u16 tail;
u16 tmask; u16 tmask;
u32 remain; u32 remain;
int temp_tail = port->info->xmit.tail; int temp_tail = port->state->xmit.tail;
struct jsm_channel *channel = (struct jsm_channel *)port; struct jsm_channel *channel = (struct jsm_channel *)port;
tmask = WQUEUEMASK; tmask = WQUEUEMASK;
@@ -865,10 +865,10 @@ int jsm_tty_write(struct uart_port *port)
data_count = 0; data_count = 0;
if (bufcount >= remain) { if (bufcount >= remain) {
bufcount -= remain; bufcount -= remain;
while ((port->info->xmit.head != temp_tail) && while ((port->state->xmit.head != temp_tail) &&
(data_count < remain)) { (data_count < remain)) {
channel->ch_wqueue[head++] = channel->ch_wqueue[head++] =
port->info->xmit.buf[temp_tail]; port->state->xmit.buf[temp_tail];
temp_tail++; temp_tail++;
temp_tail &= (UART_XMIT_SIZE - 1); temp_tail &= (UART_XMIT_SIZE - 1);
@@ -880,10 +880,10 @@ int jsm_tty_write(struct uart_port *port)
data_count1 = 0; data_count1 = 0;
if (bufcount > 0) { if (bufcount > 0) {
remain = bufcount; remain = bufcount;
while ((port->info->xmit.head != temp_tail) && while ((port->state->xmit.head != temp_tail) &&
(data_count1 < remain)) { (data_count1 < remain)) {
channel->ch_wqueue[head++] = channel->ch_wqueue[head++] =
port->info->xmit.buf[temp_tail]; port->state->xmit.buf[temp_tail];
temp_tail++; temp_tail++;
temp_tail &= (UART_XMIT_SIZE - 1); 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; data_count += data_count1;
if (data_count) { if (data_count) {
+3 -3
View File
@@ -286,7 +286,7 @@ static void m32r_sio_start_tx(struct uart_port *port)
{ {
#ifdef CONFIG_SERIAL_M32R_PLDSIO #ifdef CONFIG_SERIAL_M32R_PLDSIO
struct uart_sio_port *up = (struct uart_sio_port *)port; 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)) { if (!(up->ier & UART_IER_THRI)) {
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) 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 ch;
unsigned char flag; unsigned char flag;
int max_count = 256; 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) 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; int count;
if (up->port.x_char) { if (up->port.x_char) {
+8 -8
View File
@@ -184,7 +184,7 @@ static void max3100_timeout(unsigned long data)
{ {
struct max3100_port *s = (struct max3100_port *)data; struct max3100_port *s = (struct max3100_port *)data;
if (s->port.info) { if (s->port.state) {
max3100_dowork(s); max3100_dowork(s);
mod_timer(&s->timer, jiffies + s->poll_time); mod_timer(&s->timer, jiffies + s->poll_time);
} }
@@ -261,7 +261,7 @@ static void max3100_work(struct work_struct *w)
int rxchars; int rxchars;
u16 tx, rx; u16 tx, rx;
int conf, cconf, rts, crts; 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__); 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) { if (rxchars > 16 && s->port.state->port.tty != NULL) {
tty_flip_buffer_push(s->port.info->port.tty); tty_flip_buffer_push(s->port.state->port.tty);
rxchars = 0; rxchars = 0;
} }
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 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_circ_empty(xmit) &&
!uart_tx_stopped(&s->port)))); !uart_tx_stopped(&s->port))));
if (rxchars > 0 && s->port.info->port.tty != NULL) if (rxchars > 0 && s->port.state->port.tty != NULL)
tty_flip_buffer_push(s->port.info->port.tty); tty_flip_buffer_push(s->port.state->port.tty);
} }
static irqreturn_t max3100_irq(int irqno, void *dev_id) 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; int baud = 0;
unsigned cflag; unsigned cflag;
u32 param_new, param_mask, parity = 0; 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__); dev_dbg(&s->spi->dev, "%s\n", __func__);
if (!tty) if (!tty)
@@ -529,7 +529,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
MAX3100_STATUS_OE; MAX3100_STATUS_OE;
/* we are sending char from a workqueue so enable */ /* 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) if (s->poll_time > 0)
del_timer_sync(&s->timer); del_timer_sync(&s->timer);

Some files were not shown because too many files have changed in this diff Show More