--------------------
- $Id: driver,v 1.9 2002/07/06 16:51:43 rmk Exp $
+ $Id: driver,v 1.10 2002/07/22 15:27:30 rmk Exp $
This document is meant as a brief overview of some aspects of the new serial
tty_stop: 1 if this call is due to the TTY layer issuing a
TTY stop to the driver (equiv to rs_stop).
- Locking: none.
+ Locking: port->lock taken.
Interrupts: caller dependent.
This call must not sleep
*
* Based on drivers/char/serial.c
*
- * $Id: 21285.c,v 1.33 2002/07/21 21:32:29 rmk Exp $
+ * $Id: 21285.c,v 1.34 2002/07/22 15:27:32 rmk Exp $
*/
#include <linux/config.h>
#include <linux/module.h>
* int((BAUD_BASE - (baud >> 1)) / baud)
*/
-static void __serial21285_stop_tx(struct uart_port *port)
+static void
+serial21285_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
if (tx_enabled(port)) {
disable_irq(IRQ_CONTX);
}
static void
-serial21285_stop_tx(struct uart_port *port, unsigned int tty_stop)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&port->lock, flags);
- __serial21285_stop_tx(port);
- spin_unlock_irqrestore(&port->lock, flags);
-}
-
-static void
serial21285_start_tx(struct uart_port *port, unsigned int tty_start)
{
- unsigned long flags;
-
- spin_lock_irqsave(&port->lock, flags);
if (!tx_enabled(port)) {
enable_irq(IRQ_CONTX);
tx_enabled(port) = 1;
}
- spin_unlock_irqrestore(&port->lock, flags);
}
static void serial21285_stop_rx(struct uart_port *port)
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
- __serial21285_stop_tx(port);
+ serial21285_stop_tx(port, 0);
return;
}
uart_event(port, EVT_WRITE_WAKEUP);
if (uart_circ_empty(xmit))
- __serial21285_stop_tx(port);
+ serial21285_stop_tx(port, 0);
}
static unsigned int serial21285_tx_empty(struct uart_port *port)
{
int ret;
- printk(KERN_INFO "Serial: 21285 driver $Revision: 1.33 $\n");
+ printk(KERN_INFO "Serial: 21285 driver $Revision: 1.34 $\n");
serial21285_setup_ports();
EXPORT_NO_SYMBOLS;
MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Intel Footbridge (21285) serial driver $Revision: 1.33 $");
+MODULE_DESCRIPTION("Intel Footbridge (21285) serial driver $Revision: 1.34 $");
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * $Id: 8250.c,v 1.83 2002/07/21 23:08:22 rmk Exp $
+ * $Id: 8250.c,v 1.84 2002/07/22 15:27:32 rmk Exp $
*
* A note about mapbase / membase
*
up->port.irq = (irq > 0) ? irq : 0;
}
-static void __serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
+static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
}
}
-static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
-{
- struct uart_8250_port *up = (struct uart_8250_port *)port;
- unsigned long flags;
-
- spin_lock_irqsave(&up->port.lock, flags);
- __serial8250_stop_tx(port, tty_stop);
- spin_unlock_irqrestore(&up->port.lock, flags);
-}
-
static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start)
{
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, 0);
return;
}
DEBUG_INTR("THRE...");
if (uart_circ_empty(xmit))
- __serial8250_stop_tx(&up->port, 0);
+ serial8250_stop_tx(&up->port, 0);
}
static _INLINE_ void check_modem_status(struct uart_8250_port *up)
{
int ret, i;
- printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.83 $ "
+ printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.84 $ "
"IRQ sharing %sabled\n", share_irqs ? "en" : "dis");
for (i = 0; i < NR_IRQS; i++)
EXPORT_SYMBOL(serial8250_get_irq_map);
MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.83 $");
+MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.84 $");
MODULE_PARM(share_irqs, "i");
MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices"
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: amba.c,v 1.36 2002/07/21 21:32:30 rmk Exp $
+ * $Id: amba.c,v 1.37 2002/07/22 15:27:32 rmk Exp $
*
* This is a generic driver for ARM AMBA-type serial ports. They
* have a lot of 16550-like features, but are not register compatable.
unsigned int old_status;
};
-static void __ambauart_stop_tx(struct uart_port *port)
+static void ambauart_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
unsigned int cr;
UART_PUT_CR(port, cr);
}
-static void ambauart_stop_tx(struct uart_port *port, unsigned int tty_stop)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&port->lock, flags);
- __ambauart_stop_tx(port);
- spin_unlock_irqrestore(&port->lock, flags);
-}
-
static void ambauart_start_tx(struct uart_port *port, unsigned int tty_start)
{
unsigned int cr;
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
- __ambauart_stop_tx(port);
+ ambauart_stop_tx(port);
return;
}
uart_event(port, EVT_WRITE_WAKEUP);
if (uart_circ_empty(xmit))
- __ambauart_stop_tx(port);
+ ambauart_stop_tx(port);
}
static void ambauart_modem_status(struct uart_port *port)
{
int ret;
- printk(KERN_INFO "Serial: AMBA driver $Revision: 1.36 $\n");
+ printk(KERN_INFO "Serial: AMBA driver $Revision: 1.37 $\n");
ret = uart_register_driver(&amba_reg);
if (ret == 0) {
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("ARM Ltd/Deep Blue Solutions Ltd");
-MODULE_DESCRIPTION("ARM AMBA serial port driver $Revision: 1.36 $");
+MODULE_DESCRIPTION("ARM AMBA serial port driver $Revision: 1.37 $");
MODULE_LICENSE("GPL");
* SA_INTERRUPT. Works reliably now. No longer requires
* changes to the serial_core API.
*
- * $Id: anakin.c,v 1.28 2002/07/21 21:32:30 rmk Exp $
+ * $Id: anakin.c,v 1.29 2002/07/22 15:27:32 rmk Exp $
*/
#include <linux/config.h>
static void
anakin_start_tx(struct uart_port *port, unsigned int tty_start)
{
- unsigned int flags;
-
- spin_lock_irqsave(&port->lock, flags);
-
// is it this... or below
if (!txenable[port->irq]) {
txenable[port->irq] = TXENABLE;
anakin_transmit_buffer(port);
}
}
-
- spin_unlock_irqrestore(&port->lock, flags);
}
static void
{
int ret;
- printk(KERN_INFO "Serial: Anakin driver $Revision: 1.28 $\n");
+ printk(KERN_INFO "Serial: Anakin driver $Revision: 1.29 $\n");
ret = uart_register_driver(&anakin_reg);
if (ret == 0) {
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: clps711x.c,v 1.39 2002/07/21 21:32:30 rmk Exp $
+ * $Id: clps711x.c,v 1.40 2002/07/22 15:27:32 rmk Exp $
*
*/
#include <linux/config.h>
#define tx_enabled(port) ((port)->unused[0])
static void
-__clps711xuart_stop_tx(struct uart_port *port)
+clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
if (tx_enabled(port)) {
disable_irq(TX_IRQ(port));
}
static void
-clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&port->lock, flags);
- __clps711xuart_stop_tx(port);
- spin_unlock_irqrestore(&port->lock, flags);
-}
-
-static void
clps711xuart_start_tx(struct uart_port *port, unsigned int tty_start)
{
- unsigned long flags;
-
- spin_lock_irqsave(&port->lock, flags);
if (!tx_enabled(port)) {
enable_irq(TX_IRQ(port));
tx_enabled(port) = 1;
}
- spin_unlock_irqrestore(&port->lock, flags);
}
static void clps711xuart_stop_rx(struct uart_port *port)
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
- __clps711xuart_stop_tx(port);
+ clps711xuart_stop_tx(port);
return;
}
uart_event(port, EVT_WRITE_WAKEUP);
if (uart_circ_empty(xmit))
- __clps711xuart_stop_tx(port);
+ clps711xuart_stop_tx(port);
}
static unsigned int clps711xuart_tx_empty(struct uart_port *port)
{
int ret, i;
- printk(KERN_INFO "Serial: CLPS711x driver $Revision: 1.39 $\n");
+ printk(KERN_INFO "Serial: CLPS711x driver $Revision: 1.40 $\n");
ret = uart_register_driver(&clps711x_reg);
if (ret)
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Deep Blue Solutions Ltd");
-MODULE_DESCRIPTION("CLPS-711x generic serial driver $Revision: 1.39 $");
+MODULE_DESCRIPTION("CLPS-711x generic serial driver $Revision: 1.40 $");
MODULE_LICENSE("GPL");
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: core.c,v 1.90 2002/07/21 21:32:30 rmk Exp $
+ * $Id: core.c,v 1.91 2002/07/22 15:27:32 rmk Exp $
*
*/
#include <linux/config.h>
{
struct uart_info *info = tty->driver_data;
struct uart_port *port = info->port;
+ unsigned long flags;
+ spin_lock_irqsave(&port->lock, flags);
port->ops->stop_tx(port, 1);
+ spin_unlock_irqrestore(&port->lock, flags);
}
static void __uart_start(struct tty_struct *tty)
{
struct uart_info *info = tty->driver_data;
struct uart_port *port = info->port;
+ unsigned long flags;
+ spin_lock_irqsave(&port->lock, flags);
if (!uart_circ_empty(&info->xmit) && info->xmit.buf &&
!tty->stopped && !tty->hw_stopped)
port->ops->start_tx(port, 1);
+ spin_unlock_irqrestore(&port->flags, flags);
}
static void uart_start(struct tty_struct *tty)
{
struct uart_info *info = tty->driver_data;
struct uart_port *port = info->port;
+ unsigned long flags;
if (port->ops->send_xchar)
port->ops->send_xchar(port, ch);
else {
port->x_char = ch;
- if (ch)
+ if (ch) {
+ spin_lock_irqsave(&port->lock, flags);
port->ops->start_tx(port, 0);
+ spin_unlock_irqrestore(&port->lock, flags);
+ }
}
}
port->cons->flags &= ~CON_ENABLED;
if (running) {
- ops->stop_tx(port, 0);
spin_lock_irq(&port->lock);
+ ops->stop_tx(port, 0);
ops->set_mctrl(port, 0);
spin_unlock_irq(&port->lock);
ops->stop_rx(port);
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: sa1100.c,v 1.42 2002/07/21 21:32:30 rmk Exp $
+ * $Id: sa1100.c,v 1.43 2002/07/22 15:27:32 rmk Exp $
*
*/
#include <linux/config.h>
}
}
-static void __sa1100_stop_tx(struct sa1100_port *sport)
-{
- u32 utcr3;
-
- utcr3 = UART_GET_UTCR3(sport);
- UART_PUT_UTCR3(sport, utcr3 & ~UTCR3_TIE);
- sport->port.read_status_mask &= ~UTSR0_TO_SM(UTSR0_TFS);
-}
-
/*
* interrupts disabled on entry
*/
static void sa1100_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
struct sa1100_port *sport = (struct sa1100_port *)port;
- unsigned long flags;
+ u32 utcr3;
- spin_lock_irqsave(&sport->port.lock, flags);
- __sa1100_stop_tx(sport);
- spin_unlock_irqrestore(&sport->port.lock, flags);
+ utcr3 = UART_GET_UTCR3(sport);
+ UART_PUT_UTCR3(sport, utcr3 & ~UTCR3_TIE);
+ sport->port.read_status_mask &= ~UTSR0_TO_SM(UTSR0_TFS);
}
/*
sa1100_mctrl_check(sport);
if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) {
- __sa1100_stop_tx(sport);
+ sa1100_stop_tx(sport);
return;
}
uart_event(&sport->port, EVT_WRITE_WAKEUP);
if (uart_circ_empty(xmit))
- __sa1100_stop_tx(sport);
+ sa1100_stop_tx(sport);
}
static void sa1100_int(int irq, void *dev_id, struct pt_regs *regs)
{
int ret;
- printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.42 $\n");
+ printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.43 $\n");
sa1100_init_ports();
ret = uart_register_driver(&sa1100_reg);
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Deep Blue Solutions Ltd");
-MODULE_DESCRIPTION("SA1100 generic serial port driver $Revision: 1.42 $");
+MODULE_DESCRIPTION("SA1100 generic serial port driver $Revision: 1.43 $");
MODULE_LICENSE("GPL");