Interrupts: locally disabled.
This call must not sleep
-- stop_tx(port,tty_stop)
++ stop_tx(port)
Stop transmitting characters. This might be due to the CTS
line becoming inactive or the tty layer indicating we want
-- to stop transmission.
--
-- tty_stop: 1 if this call is due to the TTY layer issuing a
-- TTY stop to the driver (equiv to rs_stop).
++ to stop transmission due to an XOFF character.
Locking: port->lock taken.
Interrupts: locally disabled.
This call must not sleep
-- start_tx(port,tty_start)
-- start transmitting characters. (incidentally, nonempty will
-- always be nonzero, and shouldn't be used - it will be dropped).
--
-- tty_start: 1 if this call was due to the TTY layer issuing
-- a TTY start to the driver (equiv to rs_start)
++ start_tx(port)
++ start transmitting characters.
Locking: port->lock taken.
Interrupts: locally disabled.
* int((BAUD_BASE - (baud >> 1)) / baud)
*/
--static void
--serial21285_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void serial21285_stop_tx(struct uart_port *port)
{
if (tx_enabled(port)) {
disable_irq(IRQ_CONTX);
}
}
--static void
--serial21285_start_tx(struct uart_port *port, unsigned int tty_start)
++static void serial21285_start_tx(struct uart_port *port)
{
if (!tx_enabled(port)) {
enable_irq(IRQ_CONTX);
goto out;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- serial21285_stop_tx(port, 0);
++ serial21285_stop_tx(port);
goto out;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- serial21285_stop_tx(port, 0);
++ serial21285_stop_tx(port);
out:
return IRQ_HANDLED;
}
}
--static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void serial8250_stop_tx(struct uart_port *port)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
static void transmit_chars(struct uart_8250_port *up);
--static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start)
++static void serial8250_start_tx(struct uart_port *port)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
up->port.x_char = 0;
return;
}
-- if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
++ if (uart_tx_stopped(&up->port)) {
++ serial8250_stop_tx(&up->port);
++ return;
++ }
++ if (uart_circ_empty(xmit)) {
__stop_tx(up);
return;
}
unsigned int old_status;
};
--static void pl010_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void pl010_stop_tx(struct uart_port *port)
{
unsigned int cr;
UART_PUT_CR(port, cr);
}
--static void pl010_start_tx(struct uart_port *port, unsigned int tty_start)
++static void pl010_start_tx(struct uart_port *port)
{
unsigned int cr;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- pl010_stop_tx(port, 0);
++ pl010_stop_tx(port);
return;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- pl010_stop_tx(port, 0);
++ pl010_stop_tx(port);
}
static void pl010_modem_status(struct uart_port *port)
unsigned int old_status;
};
--static void pl011_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void pl011_stop_tx(struct uart_port *port)
{
struct uart_amba_port *uap = (struct uart_amba_port *)port;
writew(uap->im, uap->port.membase + UART011_IMSC);
}
--static void pl011_start_tx(struct uart_port *port, unsigned int tty_start)
++static void pl011_start_tx(struct uart_port *port)
{
struct uart_amba_port *uap = (struct uart_amba_port *)port;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&uap->port)) {
-- pl011_stop_tx(&uap->port, 0);
++ pl011_stop_tx(&uap->port);
return;
}
uart_write_wakeup(&uap->port);
if (uart_circ_empty(xmit))
-- pl011_stop_tx(&uap->port, 0);
++ pl011_stop_tx(&uap->port);
}
static void pl011_modem_status(struct uart_amba_port *uap)
DEBUG_AUTOCONF("type=%s\n", uart_config[up->port.type].name);
}
--static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void serial8250_stop_tx(struct uart_port *port)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
}
}
--static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start)
++static void serial8250_start_tx(struct uart_port *port)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
-- serial8250_stop_tx(&up->port, 0);
++ serial8250_stop_tx(&up->port);
return;
}
DEBUG_INTR("THRE...");
if (uart_circ_empty(xmit))
-- serial8250_stop_tx(&up->port, 0);
++ serial8250_stop_tx(&up->port);
}
static _INLINE_ void check_modem_status(struct uart_8250_port *up)
#define tx_enabled(port) ((port)->unused[0])
--static void
--clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void clps711xuart_stop_tx(struct uart_port *port)
{
if (tx_enabled(port)) {
disable_irq(TX_IRQ(port));
}
}
--static void
--clps711xuart_start_tx(struct uart_port *port, unsigned int tty_start)
++static void clps711xuart_start_tx(struct uart_port *port)
{
if (!tx_enabled(port)) {
enable_irq(TX_IRQ(port));
return IRQ_HANDLED;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- clps711xuart_stop_tx(port, 0);
++ clps711xuart_stop_tx(port);
return IRQ_HANDLED;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- clps711xuart_stop_tx(port, 0);
++ clps711xuart_stop_tx(port);
return IRQ_HANDLED;
}
*
* Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2)
* Pantelis Antoniou (panto@intracom.gr) (CPM1)
- *
+ *
* Copyright (C) 2004 Freescale Semiconductor, Inc.
* (C) 2004 Intracom, S.A.
+ * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**************************************************************/
+static inline unsigned long cpu2cpm_addr(void *addr)
+{
+ if ((unsigned long)addr >= CPM_ADDR)
+ return (unsigned long)addr;
+ return virt_to_bus(addr);
+}
+
+static inline void *cpm2cpu_addr(unsigned long addr)
+{
+ if (addr >= CPM_ADDR)
+ return (void *)addr;
+ return bus_to_virt(addr);
+}
+
/*
- * Check, if transmit buffers are processed
+ * Check, if transmit buffers are processed
*/
static unsigned int cpm_uart_tx_empty(struct uart_port *port)
{
/*
* Stop transmitter
*/
--static void cpm_uart_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void cpm_uart_stop_tx(struct uart_port *port)
{
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
volatile smc_t *smcp = pinfo->smcp;
/*
* Start transmitter
*/
--static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start)
++static void cpm_uart_start_tx(struct uart_port *port)
{
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
volatile smc_t *smcp = pinfo->smcp;
}
if (cpm_uart_tx_pump(port) != 0) {
- if (IS_SMC(pinfo))
+ if (IS_SMC(pinfo)) {
smcp->smc_smcm |= SMCM_TX;
- else
+ smcp->smc_smcmr |= SMCMR_TEN;
+ } else {
sccp->scc_sccm |= UART_SCCM_TX;
+ pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT;
+ }
}
}
/*
- * Stop receiver
+ * Stop receiver
*/
static void cpm_uart_stop_rx(struct uart_port *port)
{
}
/*
- * Generate a break.
+ * Generate a break.
*/
static void cpm_uart_break_ctl(struct uart_port *port, int break_state)
{
/* get number of characters, and check spce in flip-buffer */
i = bdp->cbd_datlen;
- /* If we have not enough room in tty flip buffer, then we try
+ /* If we have not enough room in tty flip buffer, then we try
* later, which will be the next rx-interrupt or a timeout
*/
if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) {
}
/* get pointer */
- cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr);
+ cp = cpm2cpu_addr(bdp->cbd_bufaddr);
/* loop through the buffer */
while (i-- > 0) {
} /* End while (i--) */
/* This BD is ready to be used again. Clear status. get next */
- bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV);
+ bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID);
bdp->cbd_sc |= BD_SC_EMPTY;
if (bdp->cbd_sc & BD_SC_WRAP)
bdp = pinfo->rx_bd_base;
else
bdp++;
+
} /* End for (;;) */
/* Write back buffer pointer */
if (IS_SMC(pinfo)) {
events = smcp->smc_smce;
+ smcp->smc_smce = events;
if (events & SMCM_BRKE)
uart_handle_break(port);
if (events & SMCM_RX)
cpm_uart_int_rx(port, regs);
if (events & SMCM_TX)
cpm_uart_int_tx(port, regs);
- smcp->smc_smce = events;
} else {
events = sccp->scc_scce;
+ sccp->scc_scce = events;
if (events & UART_SCCM_BRKE)
uart_handle_break(port);
if (events & UART_SCCM_RX)
cpm_uart_int_rx(port, regs);
if (events & UART_SCCM_TX)
cpm_uart_int_tx(port, regs);
- sccp->scc_scce = events;
}
return (events) ? IRQ_HANDLED : IRQ_NONE;
}
{
int retval;
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
+ int line = pinfo - cpm_uart_ports;
pr_debug("CPM uart[%d]:startup\n", port->line);
pinfo->sccp->scc_sccm |= UART_SCCM_RX;
}
+ if (!(pinfo->flags & FLAG_CONSOLE))
+ cpm_line_cr_cmd(line,CPM_CR_INIT_TRX);
return 0;
}
+inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)
+{
+ unsigned long target_jiffies = jiffies + pinfo->wait_closing;
+
+ while (!time_after(jiffies, target_jiffies))
+ schedule();
+}
+
/*
* Shutdown the uart
*/
/* If the port is not the console, disable Rx and Tx. */
if (!(pinfo->flags & FLAG_CONSOLE)) {
+ /* Wait for all the BDs marked sent */
+ while(!cpm_uart_tx_empty(port))
+ schedule_timeout(2);
+ if(pinfo->wait_closing)
+ cpm_uart_wait_until_send(pinfo);
+
/* Stop uarts */
if (IS_SMC(pinfo)) {
volatile smc_t *smcp = pinfo->smcp;
*/
if ((termios->c_cflag & CREAD) == 0)
port->read_status_mask &= ~BD_SC_EMPTY;
-
+
spin_lock_irqsave(&port->lock, flags);
/* Start bit has not been added (so don't, because we would just
/* Pick next descriptor and fill from buffer */
bdp = pinfo->tx_cur;
- p = bus_to_virt(bdp->cbd_bufaddr);
+ p = cpm2cpu_addr(bdp->cbd_bufaddr);
+
*p++ = xmit->buf[xmit->tail];
bdp->cbd_datlen = 1;
bdp->cbd_sc |= BD_SC_READY;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- cpm_uart_stop_tx(port, 0);
++ cpm_uart_stop_tx(port);
return 0;
}
while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) {
count = 0;
- p = bus_to_virt(bdp->cbd_bufaddr);
+ p = cpm2cpu_addr(bdp->cbd_bufaddr);
while (count < pinfo->tx_fifosize) {
*p++ = xmit->buf[xmit->tail];
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
}
bdp->cbd_datlen = count;
bdp->cbd_sc |= BD_SC_READY;
+ __asm__("eieio");
/* Get next BD. */
if (bdp->cbd_sc & BD_SC_WRAP)
bdp = pinfo->tx_bd_base;
uart_write_wakeup(port);
if (uart_circ_empty(xmit)) {
-- cpm_uart_stop_tx(port, 0);
++ cpm_uart_stop_tx(port);
return 0;
}
mem_addr = pinfo->mem_addr;
bdp = pinfo->rx_cur = pinfo->rx_bd_base;
for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
mem_addr += pinfo->rx_fifosize;
}
-
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
/* Set the physical address of the host memory
mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
bdp = pinfo->tx_cur = pinfo->tx_bd_base;
for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_INTRPT;
mem_addr += pinfo->tx_fifosize;
}
-
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
}
/* Using idle charater time requires some additional tuning. */
up->smc_mrblr = pinfo->rx_fifosize;
up->smc_maxidl = pinfo->rx_fifosize;
+ up->smc_brklen = 0;
+ up->smc_brkec = 0;
up->smc_brkcr = 1;
cpm_line_cr_cmd(line, CPM_CR_INIT_TRX);
/*
* Setup any port IO, connect any baud rate generators,
* etc. This is expected to be handled by board
- * dependant code
+ * dependant code
*/
if (pinfo->set_lineif)
pinfo->set_lineif(pinfo);
return ret;
cpm_uart_initbd(pinfo);
+ if (IS_SMC(pinfo))
+ cpm_uart_init_smc(pinfo);
+ else
+ cpm_uart_init_scc(pinfo);
return 0;
}
.flags = FLAG_SMC,
.tx_nrfifos = TX_NUM_FIFO,
.tx_fifosize = TX_BUF_SIZE,
- .rx_nrfifos = RX_NUM_FIFO,
+ .rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = smc1_lineif,
},
.flags = FLAG_SMC,
.tx_nrfifos = TX_NUM_FIFO,
.tx_fifosize = TX_BUF_SIZE,
- .rx_nrfifos = RX_NUM_FIFO,
+ .rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = smc2_lineif,
#ifdef CONFIG_SERIAL_CPM_ALT_SMC2
},
.tx_nrfifos = TX_NUM_FIFO,
.tx_fifosize = TX_BUF_SIZE,
- .rx_nrfifos = RX_NUM_FIFO,
+ .rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc1_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
[UART_SCC2] = {
.port = {
},
.tx_nrfifos = TX_NUM_FIFO,
.tx_fifosize = TX_BUF_SIZE,
- .rx_nrfifos = RX_NUM_FIFO,
+ .rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc2_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
[UART_SCC3] = {
.port = {
},
.tx_nrfifos = TX_NUM_FIFO,
.tx_fifosize = TX_BUF_SIZE,
- .rx_nrfifos = RX_NUM_FIFO,
+ .rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc3_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
[UART_SCC4] = {
.port = {
},
.tx_nrfifos = TX_NUM_FIFO,
.tx_fifosize = TX_BUF_SIZE,
- .rx_nrfifos = RX_NUM_FIFO,
+ .rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc4_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
};
* If the buffer address is in the CPM DPRAM, don't
* convert it.
*/
- if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR)
- cp = (unsigned char *) (bdp->cbd_bufaddr);
- else
- cp = bus_to_virt(bdp->cbd_bufaddr);
-
+ cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+
*cp = *s;
bdp->cbd_datlen = 1;
while ((bdp->cbd_sc & BD_SC_READY) != 0)
;
- if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR)
- cp = (unsigned char *) (bdp->cbd_bufaddr);
- else
- cp = bus_to_virt(bdp->cbd_bufaddr);
+ cp = cpm2cpu_addr(bdp->cbd_bufaddr);
*cp = 13;
bdp->cbd_datlen = 1;
port =
(struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
pinfo = (struct uart_cpm_port *)port;
-
+
pinfo->flags |= FLAG_CONSOLE;
if (options) {
/*
* Setup any port IO, connect any baud rate generators,
* etc. This is expected to be handled by board
- * dependant code
+ * dependant code
*/
if (pinfo->set_lineif)
pinfo->set_lineif(pinfo);
return 0;
}
-extern struct uart_driver cpm_reg;
+static struct uart_driver cpm_reg;
static struct console cpm_scc_uart_console = {
- .name "ttyCPM",
- .write cpm_uart_console_write,
- .device uart_console_device,
- .setup cpm_uart_console_setup,
- .flags CON_PRINTBUFFER,
- .index -1,
+ .name = "ttyCPM",
+ .write = cpm_uart_console_write,
+ .device = uart_console_device,
+ .setup = cpm_uart_console_setup,
+ .flags = CON_PRINTBUFFER,
+ .index = -1,
.data = &cpm_reg,
};
* ------------------------------------------------------------
*/
--static void dz_stop_tx(struct uart_port *uport, unsigned int tty_stop)
++static void dz_stop_tx(struct uart_port *uport)
{
struct dz_port *dport = (struct dz_port *)uport;
unsigned short tmp, mask = 1 << dport->port.line;
spin_unlock_irqrestore(&dport->port.lock, flags);
}
--static void dz_start_tx(struct uart_port *uport, unsigned int tty_start)
++static void dz_start_tx(struct uart_port *uport)
{
struct dz_port *dport = (struct dz_port *)uport;
unsigned short tmp, mask = 1 << dport->port.line;
}
/* if nothing to do or stopped or hardware stopped */
if (uart_circ_empty(xmit) || uart_tx_stopped(&dport->port)) {
-- dz_stop_tx(&dport->port, 0);
++ dz_stop_tx(&dport->port);
return;
}
/* Are we done */
if (uart_circ_empty(xmit))
-- dz_stop_tx(&dport->port, 0);
++ dz_stop_tx(&dport->port);
}
/*
*/
static void dz_shutdown(struct uart_port *uport)
{
-- dz_stop_tx(uport, 0);
++ dz_stop_tx(uport);
}
/*
return result;
}
--static void icom_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void icom_stop_tx(struct uart_port *port)
{
unsigned char cmdReg;
-- if (tty_stop) {
-- trace(ICOM_PORT, "STOP", 0);
-- cmdReg = readb(&ICOM_PORT->dram->CmdReg);
-- writeb(cmdReg | CMD_HOLD_XMIT, &ICOM_PORT->dram->CmdReg);
-- }
++ trace(ICOM_PORT, "STOP", 0);
++ cmdReg = readb(&ICOM_PORT->dram->CmdReg);
++ writeb(cmdReg | CMD_HOLD_XMIT, &ICOM_PORT->dram->CmdReg);
}
--static void icom_start_tx(struct uart_port *port, unsigned int tty_start)
++static void icom_start_tx(struct uart_port *port)
{
unsigned char cmdReg;
/*
* interrupts disabled on entry
*/
--static void imx_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void imx_stop_tx(struct uart_port *port)
{
struct imx_port *sport = (struct imx_port *)port;
UCR1((u32)sport->port.membase) &= ~UCR1_TXMPTYEN;
} while (!(UTS((u32)sport->port.membase) & UTS_TXFULL));
if (uart_circ_empty(xmit))
-- imx_stop_tx(&sport->port, 0);
++ imx_stop_tx(&sport->port);
}
/*
* interrupts disabled on entry
*/
--static void imx_start_tx(struct uart_port *port, unsigned int tty_start)
++static void imx_start_tx(struct uart_port *port)
{
struct imx_port *sport = (struct imx_port *)port;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) {
-- imx_stop_tx(&sport->port, 0);
++ imx_stop_tx(&sport->port);
goto out;
}
/**
* ic4_stop_tx - stop the transmitter
* @port: Port to operate on
-- * @tty_stop: Set to 1 if called via uart_stop
*
*/
--static void ic4_stop_tx(struct uart_port *the_port, unsigned int tty_stop)
++static void ic4_stop_tx(struct uart_port *the_port)
{
}
/**
* ic4_start_tx - Start transmitter, flush any output
* @port: Port to operate on
-- * @tty_stop: Set to 1 if called via uart_start
*
*/
--static void ic4_start_tx(struct uart_port *the_port, unsigned int tty_stop)
++static void ic4_start_tx(struct uart_port *the_port)
{
struct ioc4_port *port = get_ioc4_port(the_port);
unsigned long flags;
}
/* The port lock is held and interrupts are disabled. */
--static void ip22zilog_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void ip22zilog_stop_tx(struct uart_port *port)
{
struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
}
/* The port lock is held and interrupts are disabled. */
--static void ip22zilog_start_tx(struct uart_port *port, unsigned int tty_start)
++static void ip22zilog_start_tx(struct uart_port *port)
{
struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
udelay(10);
}
--static void jsm_tty_start_tx(struct uart_port *port, unsigned int tty_start)
++static void jsm_tty_start_tx(struct uart_port *port)
{
struct jsm_channel *channel = (struct jsm_channel *)port;
jsm_printk(IOCTL, INFO, &channel->ch_bd->pci_dev, "finish\n");
}
--static void jsm_tty_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void jsm_tty_stop_tx(struct uart_port *port)
{
struct jsm_channel *channel = (struct jsm_channel *)port;
__sio_out(value, offset);
}
--static void m32r_sio_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void m32r_sio_stop_tx(struct uart_port *port)
{
struct uart_sio_port *up = (struct uart_sio_port *)port;
}
}
--static void m32r_sio_start_tx(struct uart_port *port, unsigned int tty_start)
++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;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
-- m32r_sio_stop_tx(&up->port, 0);
++ m32r_sio_stop_tx(&up->port);
return;
}
DEBUG_INTR("THRE...");
if (uart_circ_empty(xmit))
-- m32r_sio_stop_tx(&up->port, 0);
++ m32r_sio_stop_tx(&up->port);
}
/*
return uart_set_options(port, co, baud, parity, bits, flow);
}
-extern struct uart_driver m32r_sio_reg;
+static struct uart_driver m32r_sio_reg;
static struct console m32r_sio_console = {
.name = "ttyS",
.write = m32r_sio_console_write,
}
static void
--mpc52xx_uart_stop_tx(struct uart_port *port, unsigned int tty_stop)
++mpc52xx_uart_stop_tx(struct uart_port *port)
{
/* port->lock taken by caller */
port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
}
static void
--mpc52xx_uart_start_tx(struct uart_port *port, unsigned int tty_start)
++mpc52xx_uart_start_tx(struct uart_port *port)
{
/* port->lock taken by caller */
port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
/* Nothing to do ? */
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- mpc52xx_uart_stop_tx(port,0);
++ mpc52xx_uart_stop_tx(port);
return 0;
}
/* Maybe we're done after all */
if (uart_circ_empty(xmit)) {
-- mpc52xx_uart_stop_tx(port,0);
++ mpc52xx_uart_stop_tx(port);
return 0;
}
}
static void
--mpsc_stop_tx(struct uart_port *port, uint tty_start)
++mpsc_stop_tx(struct uart_port *port)
{
struct mpsc_port_info *pi = (struct mpsc_port_info *)port;
-- pr_debug("mpsc_stop_tx[%d]: tty_start: %d\n", port->line, tty_start);
++ pr_debug("mpsc_stop_tx[%d]\n", port->line);
mpsc_freeze(pi);
return;
}
static void
--mpsc_start_tx(struct uart_port *port, uint tty_start)
++mpsc_start_tx(struct uart_port *port)
{
struct mpsc_port_info *pi = (struct mpsc_port_info *)port;
mpsc_copy_tx_data(pi);
mpsc_sdma_start_tx(pi);
-- pr_debug("mpsc_start_tx[%d]: tty_start: %d\n", port->line, tty_start);
++ pr_debug("mpsc_start_tx[%d]\n", port->line);
return;
}
/**
* mux_stop_tx - Stop transmitting characters.
* @port: Ptr to the uart_port.
-- * @tty_stop: tty layer issue this command?
*
* The Serial MUX does not support this function.
*/
--static void mux_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void mux_stop_tx(struct uart_port *port)
{
}
/**
* mux_start_tx - Start transmitting characters.
* @port: Ptr to the uart_port.
-- * @tty_start: tty layer issue this command?
*
* The Serial Mux does not support this function.
*/
--static void mux_start_tx(struct uart_port *port, unsigned int tty_start)
++static void mux_start_tx(struct uart_port *port)
{
}
}
if(uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- mux_stop_tx(port, 0);
++ mux_stop_tx(port);
return;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- mux_stop_tx(port, 0);
++ mux_stop_tx(port);
}
/**
/*
* Stop TX side. Dealt like sunzilog at next Tx interrupt,
-- * though for DMA, we will have to do a bit more. What is
-- * the meaning of the tty_stop bit ? XXX
++ * though for DMA, we will have to do a bit more.
* The port lock is held and interrupts are disabled.
*/
--static void pmz_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void pmz_stop_tx(struct uart_port *port)
{
to_pmz(port)->flags |= PMACZILOG_FLAG_TX_STOPPED;
}
* Kick the Tx side.
* The port lock is held and interrupts are disabled.
*/
--static void pmz_start_tx(struct uart_port *port, unsigned int tty_start)
++static void pmz_start_tx(struct uart_port *port)
{
struct uart_pmac_port *uap = to_pmz(port);
unsigned char status;
serial_out(up, UART_IER, up->ier);
}
--static void serial_pxa_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void serial_pxa_stop_tx(struct uart_port *port)
{
struct uart_pxa_port *up = (struct uart_pxa_port *)port;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
-- serial_pxa_stop_tx(&up->port, 0);
++ serial_pxa_stop_tx(&up->port);
return;
}
if (uart_circ_empty(xmit))
-- serial_pxa_stop_tx(&up->port, 0);
++ serial_pxa_stop_tx(&up->port);
}
--static void serial_pxa_start_tx(struct uart_port *port, unsigned int tty_start)
++static void serial_pxa_start_tx(struct uart_port *port)
{
struct uart_pxa_port *up = (struct uart_pxa_port *)port;
spin_unlock_irqrestore(&port->lock, flags);
}
--static void
--s3c24xx_serial_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void s3c24xx_serial_stop_tx(struct uart_port *port)
{
if (tx_enabled(port)) {
disable_irq(TX_IRQ(port));
}
}
--static void
--s3c24xx_serial_start_tx(struct uart_port *port, unsigned int tty_start)
++static void s3c24xx_serial_start_tx(struct uart_port *port)
{
if (!tx_enabled(port)) {
if (port->flags & UPF_CONS_FLOW)
*/
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- s3c24xx_serial_stop_tx(port, 0);
++ s3c24xx_serial_stop_tx(port);
goto out;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- s3c24xx_serial_stop_tx(port, 0);
++ s3c24xx_serial_stop_tx(port);
out:
return IRQ_HANDLED;
/*
* interrupts disabled on entry
*/
--static void sa1100_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void sa1100_stop_tx(struct uart_port *port)
{
struct sa1100_port *sport = (struct sa1100_port *)port;
u32 utcr3;
/*
* interrupts may not be disabled on entry
*/
--static void sa1100_start_tx(struct uart_port *port, unsigned int tty_start)
++static void sa1100_start_tx(struct uart_port *port)
{
struct sa1100_port *sport = (struct sa1100_port *)port;
unsigned long flags;
sa1100_mctrl_check(sport);
if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) {
-- sa1100_stop_tx(&sport->port, 0);
++ sa1100_stop_tx(&sport->port);
return;
}
uart_write_wakeup(&sport->port);
if (uart_circ_empty(xmit))
-- sa1100_stop_tx(&sport->port, 0);
++ sa1100_stop_tx(&sport->port);
}
static irqreturn_t sa1100_int(int irq, void *dev_id, struct pt_regs *regs)
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
-- port->ops->stop_tx(port, 1);
++ port->ops->stop_tx(port);
spin_unlock_irqrestore(&port->lock, flags);
}
if (!uart_circ_empty(&state->info->xmit) && state->info->xmit.buf &&
!tty->stopped && !tty->hw_stopped)
-- port->ops->start_tx(port, 1);
++ port->ops->start_tx(port);
}
static void uart_start(struct tty_struct *tty)
port->x_char = ch;
if (ch) {
spin_lock_irqsave(&port->lock, flags);
-- port->ops->start_tx(port, 0);
++ port->ops->start_tx(port);
spin_unlock_irqrestore(&port->lock, flags);
}
}
spin_lock_irqsave(&state->port->lock, flags);
if (!(state->port->ops->get_mctrl(state->port) & TIOCM_CTS)) {
tty->hw_stopped = 1;
-- state->port->ops->stop_tx(state->port, 0);
++ state->port->ops->stop_tx(state->port);
}
spin_unlock_irqrestore(&state->port->lock, flags);
}
struct uart_ops *ops = port->ops;
spin_lock_irq(&port->lock);
-- ops->stop_tx(port, 0);
++ ops->stop_tx(port);
ops->set_mctrl(port, 0);
ops->stop_rx(port);
spin_unlock_irq(&port->lock);
uart_change_speed(state, NULL);
spin_lock_irq(&port->lock);
ops->set_mctrl(port, port->mctrl);
-- ops->start_tx(port, 0);
++ ops->start_tx(port);
spin_unlock_irq(&port->lock);
}
unsigned int statusPrev; /* Most recently read modem status */
};
--static void lh7a40xuart_stop_tx (struct uart_port* port, unsigned int tty_stop)
++static void lh7a40xuart_stop_tx (struct uart_port* port)
{
BIT_CLR (port, UART_R_INTEN, TxInt);
}
--static void lh7a40xuart_start_tx (struct uart_port* port,
-- unsigned int tty_start)
++static void lh7a40xuart_start_tx (struct uart_port* port)
{
BIT_SET (port, UART_R_INTEN, TxInt);
sio_out(up, TXX9_SIBGR, 0xff | TXX9_SIBGR_BCLK_T6);
}
--static void serial_txx9_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void serial_txx9_stop_tx(struct uart_port *port)
{
struct uart_txx9_port *up = (struct uart_txx9_port *)port;
unsigned long flags;
spin_unlock_irqrestore(&up->port.lock, flags);
}
--static void serial_txx9_start_tx(struct uart_port *port, unsigned int tty_start)
++static void serial_txx9_start_tx(struct uart_port *port)
{
struct uart_txx9_port *up = (struct uart_txx9_port *)port;
unsigned long flags;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
-- serial_txx9_stop_tx(&up->port, 0);
++ serial_txx9_stop_tx(&up->port);
return;
}
uart_write_wakeup(&up->port);
if (uart_circ_empty(xmit))
-- serial_txx9_stop_tx(&up->port, 0);
++ serial_txx9_stop_tx(&up->port);
}
static irqreturn_t serial_txx9_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
/* Function prototypes */
--static void sci_stop_tx(struct uart_port *port, unsigned int tty_stop);
--static void sci_start_tx(struct uart_port *port, unsigned int tty_start);
++static void sci_stop_tx(struct uart_port *port);
++static void sci_start_tx(struct uart_port *port);
static void sci_start_rx(struct uart_port *port, unsigned int tty_start);
static void sci_stop_rx(struct uart_port *port);
static int sci_request_irq(struct sci_port *port);
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(port);
if (uart_circ_empty(xmit)) {
-- sci_stop_tx(port, 0);
++ sci_stop_tx(port);
} else {
local_irq_save(flags);
ctrl = sci_in(port, SCSCR);
return TIOCM_DTR | TIOCM_RTS | TIOCM_DSR;
}
--static void sci_start_tx(struct uart_port *port, unsigned int tty_start)
++static void sci_start_tx(struct uart_port *port)
{
struct sci_port *s = &sci_ports[port->line];
enable_irq(s->irqs[SCIx_TXI_IRQ]);
}
--static void sci_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void sci_stop_tx(struct uart_port *port)
{
unsigned long flags;
unsigned short ctrl;
struct sci_port *s = &sci_ports[port->line];
sci_stop_rx(port);
-- sci_stop_tx(port, 1);
++ sci_stop_tx(port);
sci_free_irq(s);
#if defined(__H8300S__)
/**
* snp_stop_tx - stop the transmitter - no-op for us
* @port: Port to operat eon - we ignore - no-op function
-- * @tty_stop: Set to 1 if called via uart_stop
*
*/
--static void snp_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void snp_stop_tx(struct uart_port *port)
{
}
/**
* snp_start_tx - Start transmitter
* @port: Port to operate on
-- * @tty_stop: Set to 1 if called via uart_start
*
*/
--static void snp_start_tx(struct uart_port *port, unsigned int tty_stop)
++static void snp_start_tx(struct uart_port *port)
{
if (sal_console_port.sc_ops->sal_wakeup_transmit)
sal_console_port.sc_ops->sal_wakeup_transmit(&sal_console_port,
uart_write_wakeup(&port->sc_port);
if (uart_circ_empty(xmit))
-- snp_stop_tx(&port->sc_port, 0); /* no-op for us */
++ snp_stop_tx(&port->sc_port); /* no-op for us */
}
/**
return -1;
sal_console_port.sc_ops = &poll_ops;
+ spin_lock_init(&sal_console_port.sc_port.lock);
early_sn_setup(); /* Find SAL entry points */
register_console(&sal_console_early);
return tty;
}
--static void sunsab_stop_tx(struct uart_port *, unsigned int);
++static void sunsab_stop_tx(struct uart_port *);
static void sunsab_tx_idle(struct uart_sunsab_port *);
static void transmit_chars(struct uart_sunsab_port *up,
uart_write_wakeup(&up->port);
if (uart_circ_empty(xmit))
-- sunsab_stop_tx(&up->port, 0);
++ sunsab_stop_tx(&up->port);
}
static void check_status(struct uart_sunsab_port *up,
}
/* port->lock held by caller. */
--static void sunsab_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void sunsab_stop_tx(struct uart_port *port)
{
struct uart_sunsab_port *up = (struct uart_sunsab_port *) port;
}
/* port->lock held by caller. */
--static void sunsab_start_tx(struct uart_port *port, unsigned int tty_start)
++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;
}
#endif /* CONFIG_SERIAL_8250_RSA */
--static void sunsu_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static inline void __stop_tx(struct uart_sunsu_port *p)
++{
++ if (p->ier & UART_IER_THRI) {
++ p->ier &= ~UART_IER_THRI;
++ serial_out(p, UART_IER, p->ier);
++ }
++}
++
++static void sunsu_stop_tx(struct uart_port *port)
{
struct uart_sunsu_port *up = (struct uart_sunsu_port *) port;
-- if (up->ier & UART_IER_THRI) {
-- up->ier &= ~UART_IER_THRI;
-- serial_out(up, UART_IER, up->ier);
-- }
-- if (up->port.type == PORT_16C950 && tty_stop) {
++ __stop_tx(up);
++
++ if (up->port.type == PORT_16C950 && tty_stop /*FIXME*/) {
up->acr |= UART_ACR_TXDIS;
serial_icr_write(up, UART_ACR, up->acr);
}
}
--static void sunsu_start_tx(struct uart_port *port, unsigned int tty_start)
++static void sunsu_start_tx(struct uart_port *port)
{
struct uart_sunsu_port *up = (struct uart_sunsu_port *) port;
/*
* We only do this from uart_start
*/
-- if (tty_start && up->port.type == PORT_16C950) {
++ if (tty_start && up->port.type == PORT_16C950 /*FIXME*/) {
up->acr &= ~UART_ACR_TXDIS;
serial_icr_write(up, UART_ACR, up->acr);
}
up->port.x_char = 0;
return;
}
-- if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
-- sunsu_stop_tx(&up->port, 0);
++ if (uart_tx_stopped(&up->port)) {
++ sunsu_stop_tx(&up->port);
++ return;
++ }
++ if (uart_circ_empty(xmit)) {
++ __stop_tx(up);
return;
}
uart_write_wakeup(&up->port);
if (uart_circ_empty(xmit))
-- sunsu_stop_tx(&up->port, 0);
++ __stop_tx(up);
}
static _INLINE_ void check_modem_status(struct uart_sunsu_port *up)
}
/* The port lock is held and interrupts are disabled. */
--static void sunzilog_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void sunzilog_stop_tx(struct uart_port *port)
{
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
}
/* The port lock is held and interrupts are disabled. */
--static void sunzilog_start_tx(struct uart_port *port, unsigned int tty_start)
++static void sunzilog_start_tx(struct uart_port *port)
{
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
#define UART_TX_READY(s) (((s) & UART_TSR_TX_LEVEL_MSK) < 15)
//#define UART_TX_EMPTY(p) ((UART_GET_FR(p) & UART00_UARTFR_TMSK) == 0)
--static void uart00_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void uart00_stop_tx(struct uart_port *port)
{
UART_PUT_IEC(port, UART_IEC_TIE_MSK);
}
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- uart00_stop_tx(port, 0);
++ uart00_stop_tx(port);
return;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- uart00_stop_tx(port, 0);
++ uart00_stop_tx(port);
}
--static void uart00_start_tx(struct uart_port *port, unsigned int tty_start)
++static void uart00_start_tx(struct uart_port *port)
{
UART_PUT_IES(port, UART_IES_TIE_MSK);
uart00_tx_chars(port);
\f
/* TX/RX interrupt handlers. */
--static void v850e_uart_stop_tx (struct uart_port *port, unsigned tty_stop);
++static void v850e_uart_stop_tx (struct uart_port *port);
void v850e_uart_tx (struct uart_port *port)
{
return mctrl;
}
--static void v850e_uart_start_tx (struct uart_port *port, unsigned tty_start)
++static void v850e_uart_start_tx (struct uart_port *port)
{
v850e_intc_disable_irq (V850E_UART_TX_IRQ (port->line));
v850e_uart_tx (port);
v850e_intc_enable_irq (V850E_UART_TX_IRQ (port->line));
}
--static void v850e_uart_stop_tx (struct uart_port *port, unsigned tty_stop)
++static void v850e_uart_stop_tx (struct uart_port *port)
{
v850e_intc_disable_irq (V850E_UART_TX_IRQ (port->line));
}
return mctrl;
}
--static void siu_stop_tx(struct uart_port *port, unsigned int tty_stop)
++static void siu_stop_tx(struct uart_port *port)
{
unsigned long flags;
uint8_t ier;
spin_unlock_irqrestore(&port->lock, flags);
}
--static void siu_start_tx(struct uart_port *port, unsigned int tty_start)
++static void siu_start_tx(struct uart_port *port)
{
unsigned long flags;
uint8_t ier;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-- siu_stop_tx(port, 0);
++ siu_stop_tx(port);
return;
}
uart_write_wakeup(port);
if (uart_circ_empty(xmit))
-- siu_stop_tx(port, 0);
++ siu_stop_tx(port);
}
static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned int (*tx_empty)(struct uart_port *);
void (*set_mctrl)(struct uart_port *, unsigned int mctrl);
unsigned int (*get_mctrl)(struct uart_port *);
-- void (*stop_tx)(struct uart_port *, unsigned int tty_stop);
-- void (*start_tx)(struct uart_port *, unsigned int tty_start);
++ void (*stop_tx)(struct uart_port *);
++ void (*start_tx)(struct uart_port *);
void (*send_xchar)(struct uart_port *, char ch);
void (*stop_rx)(struct uart_port *);
void (*enable_ms)(struct uart_port *);
if (tty->hw_stopped) {
if (status) {
tty->hw_stopped = 0;
-- port->ops->start_tx(port, 0);
++ port->ops->start_tx(port);
uart_write_wakeup(port);
}
} else {
if (!status) {
tty->hw_stopped = 1;
-- port->ops->stop_tx(port, 0);
++ port->ops->stop_tx(port);
}
}
}