Skip to content

Commit

Permalink
Merge HEAD from master.kernel.org:/home/rmk/linux-2.6-serial
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 2, 2005
2 parents 66f3767 + bc49a66 commit 138307b
Show file tree
Hide file tree
Showing 41 changed files with 200 additions and 393 deletions.
15 changes: 4 additions & 11 deletions Documentation/serial/driver
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,17 @@ hardware.
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.
Expand Down
21 changes: 12 additions & 9 deletions drivers/char/mwave/mwavedd.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/serial_8250.h>
#include "smapi.h"
#include "mwavedd.h"
#include "3780i.h"
Expand Down Expand Up @@ -410,8 +411,8 @@ static ssize_t mwave_write(struct file *file, const char __user *buf,

static int register_serial_portandirq(unsigned int port, int irq)
{
struct serial_struct serial;

struct uart_port uart;
switch ( port ) {
case 0x3f8:
case 0x2f8:
Expand Down Expand Up @@ -442,12 +443,14 @@ static int register_serial_portandirq(unsigned int port, int irq)
} /* switch */
/* irq is okay */

memset(&serial, 0, sizeof(serial));
serial.port = port;
serial.irq = irq;
serial.flags = ASYNC_SHARE_IRQ;

return register_serial(&serial);
memset(&uart, 0, sizeof(struct uart_port));

uart.uartclk = 1843200;
uart.iobase = port;
uart.irq = irq;
uart.iotype = UPIO_PORT;
uart.flags = UPF_SHARE_IRQ;
return serial8250_register_port(&uart);
}


Expand Down Expand Up @@ -523,7 +526,7 @@ static void mwave_exit(void)
#endif

if ( pDrvData->sLine >= 0 ) {
unregister_serial(pDrvData->sLine);
serial8250_unregister_port(pDrvData->sLine);
}
if (pDrvData->bMwaveDevRegistered) {
misc_deregister(&mwave_misc_dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ menu "Misc devices"

config IBM_ASM
tristate "Device driver for IBM RSA service processor"
depends on X86 && PCI && EXPERIMENTAL
depends on X86 && PCI && EXPERIMENTAL && BROKEN
---help---
This option enables device driver support for in-band access to the
IBM RSA (Condor) service processor in eServer xSeries systems.
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ config NET_SB1250_MAC

config SGI_IOC3_ETH
bool "SGI IOC3 Ethernet"
depends on NET_ETHERNET && PCI && SGI_IP27
depends on NET_ETHERNET && PCI && SGI_IP27 && BROKEN
select CRC32
select MII
help
Expand Down
10 changes: 4 additions & 6 deletions drivers/serial/21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ static const char serial21285_name[] = "Footbridge UART";
* 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);
tx_enabled(port) = 0;
}
}

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);
Expand Down Expand Up @@ -148,7 +146,7 @@ static irqreturn_t serial21285_tx_chars(int irq, void *dev_id, struct pt_regs *r
goto out;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
serial21285_stop_tx(port, 0);
serial21285_stop_tx(port);
goto out;
}

Expand All @@ -164,7 +162,7 @@ static irqreturn_t serial21285_tx_chars(int irq, void *dev_id, struct pt_regs *r
uart_write_wakeup(port);

if (uart_circ_empty(xmit))
serial21285_stop_tx(port, 0);
serial21285_stop_tx(port);

out:
return IRQ_HANDLED;
Expand Down
89 changes: 7 additions & 82 deletions drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ static inline void __stop_tx(struct uart_8250_port *p)
}
}

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;

Expand All @@ -1018,7 +1018,7 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)

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;

Expand Down Expand Up @@ -1158,7 +1158,11 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up)
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;
}
Expand Down Expand Up @@ -2586,82 +2590,3 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444);
MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
#endif
MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);

/**
* register_serial - configure a 16x50 serial port at runtime
* @req: request structure
*
* Configure the serial port specified by the request. If the
* port exists and is in use an error is returned. If the port
* is not currently in the table it is added.
*
* The port is then probed and if necessary the IRQ is autodetected
* If this fails an error is returned.
*
* On success the port is ready to use and the line number is returned.
*
* Note: this function is deprecated - use serial8250_register_port
* instead.
*/
int register_serial(struct serial_struct *req)
{
struct uart_port port;

port.iobase = req->port;
port.membase = req->iomem_base;
port.irq = req->irq;
port.uartclk = req->baud_base * 16;
port.fifosize = req->xmit_fifo_size;
port.regshift = req->iomem_reg_shift;
port.iotype = req->io_type;
port.flags = req->flags | UPF_BOOT_AUTOCONF;
port.mapbase = req->iomap_base;
port.dev = NULL;

if (share_irqs)
port.flags |= UPF_SHARE_IRQ;

if (HIGH_BITS_OFFSET)
port.iobase |= (long) req->port_high << HIGH_BITS_OFFSET;

/*
* If a clock rate wasn't specified by the low level driver, then
* default to the standard clock rate. This should be 115200 (*16)
* and should not depend on the architecture's BASE_BAUD definition.
* However, since this API will be deprecated, it's probably a
* better idea to convert the drivers to use the new API
* (serial8250_register_port and serial8250_unregister_port).
*/
if (port.uartclk == 0) {
printk(KERN_WARNING
"Serial: registering port at [%08x,%08lx,%p] irq %d with zero baud_base\n",
port.iobase, port.mapbase, port.membase, port.irq);
printk(KERN_WARNING "Serial: see %s:%d for more information\n",
__FILE__, __LINE__);
dump_stack();

/*
* Fix it up for now, but this is only a temporary measure.
*/
port.uartclk = BASE_BAUD * 16;
}

return serial8250_register_port(&port);
}
EXPORT_SYMBOL(register_serial);

/**
* unregister_serial - remove a 16x50 serial port at runtime
* @line: serial line number
*
* Remove one serial port. This may not be called from interrupt
* context. We hand the port back to our local PM control.
*
* Note: this function is deprecated - use serial8250_unregister_port
* instead.
*/
void unregister_serial(int line)
{
serial8250_unregister_port(line);
}
EXPORT_SYMBOL(unregister_serial);
6 changes: 1 addition & 5 deletions drivers/serial/8250.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
*/

#include <linux/config.h>

int serial8250_register_port(struct uart_port *);
void serial8250_unregister_port(int line);
void serial8250_suspend_port(int line);
void serial8250_resume_port(int line);
#include <linux/serial_8250.h>

struct old_serial_port {
unsigned int uart;
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ config SERIAL_M32R_PLDSIO

config SERIAL_TXX9
bool "TMPTX39XX/49XX SIO support"
depends HAS_TXX9_SERIAL
depends HAS_TXX9_SERIAL && BROKEN
select SERIAL_CORE
default y

Expand Down
8 changes: 4 additions & 4 deletions drivers/serial/amba-pl010.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct uart_amba_port {
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;

Expand All @@ -114,7 +114,7 @@ static void pl010_stop_tx(struct uart_port *port, unsigned int tty_stop)
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;

Expand Down Expand Up @@ -219,7 +219,7 @@ static void pl010_tx_chars(struct uart_port *port)
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
pl010_stop_tx(port, 0);
pl010_stop_tx(port);
return;
}

Expand All @@ -236,7 +236,7 @@ static void pl010_tx_chars(struct uart_port *port)
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)
Expand Down
8 changes: 4 additions & 4 deletions drivers/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ struct uart_amba_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;

uap->im &= ~UART011_TXIM;
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;

Expand Down Expand Up @@ -184,7 +184,7 @@ static void pl011_tx_chars(struct uart_amba_port *uap)
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&uap->port)) {
pl011_stop_tx(&uap->port, 0);
pl011_stop_tx(&uap->port);
return;
}

Expand All @@ -201,7 +201,7 @@ static void pl011_tx_chars(struct uart_amba_port *uap)
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)
Expand Down
8 changes: 4 additions & 4 deletions drivers/serial/au1x00_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
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;

Expand All @@ -210,7 +210,7 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
}
}

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;

Expand Down Expand Up @@ -337,7 +337,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up)
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
serial8250_stop_tx(&up->port, 0);
serial8250_stop_tx(&up->port);
return;
}

Expand All @@ -356,7 +356,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up)
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)
Expand Down
Loading

0 comments on commit 138307b

Please sign in to comment.