Commit e1776fa6 authored by Russell King's avatar Russell King

Merge flint.arm.linux.org.uk:/usr/src/bk/linux-2.6-undo

into flint.arm.linux.org.uk:/usr/src/bk/linux-2.6-serial
parents 373d2673 7acd1ea4
This diff is collapsed.
......@@ -19,7 +19,6 @@
int serial8250_register_port(struct uart_port *);
void serial8250_unregister_port(int line);
void serial8250_get_irq_map(unsigned int *map);
void serial8250_suspend_port(int line);
void serial8250_resume_port(int line);
......
......@@ -1313,20 +1313,6 @@ void unregister_serial(int line)
uart_unregister_port(&serial8250_reg, line);
}
/*
* This is for ISAPNP only.
*/
void serial8250_get_irq_map(unsigned int *map)
{
int i;
for (i = 0; i < UART_NR; i++) {
if (serial8250_ports[i].port.type != PORT_UNKNOWN &&
serial8250_ports[i].port.irq < 16)
*map |= 1 << serial8250_ports[i].port.irq;
}
}
/**
* serial8250_suspend_port - suspend one serial port
* @line: serial line number
......@@ -1382,7 +1368,6 @@ module_exit(serial8250_exit);
EXPORT_SYMBOL(register_serial);
EXPORT_SYMBOL(unregister_serial);
EXPORT_SYMBOL(serial8250_get_irq_map);
EXPORT_SYMBOL(serial8250_suspend_port);
EXPORT_SYMBOL(serial8250_resume_port);
......
......@@ -162,8 +162,6 @@ static int uart_startup(struct uart_state *state, int init_hw)
return -ENOMEM;
info->xmit.buf = (unsigned char *) page;
info->tmpbuf = info->xmit.buf + UART_XMIT_SIZE;
init_MUTEX(&info->tmpbuf_sem);
uart_circ_clear(&info->xmit);
}
......@@ -238,7 +236,6 @@ static void uart_shutdown(struct uart_state *state)
if (info->xmit.buf) {
free_page((unsigned long)info->xmit.buf);
info->xmit.buf = NULL;
info->tmpbuf = NULL;
}
/*
......@@ -450,53 +447,30 @@ __uart_put_char(struct uart_port *port, struct circ_buf *circ, unsigned char c)
spin_unlock_irqrestore(&port->lock, flags);
}
static inline int
__uart_user_write(struct uart_port *port, struct circ_buf *circ,
const unsigned char __user *buf, int count)
static void uart_put_char(struct tty_struct *tty, unsigned char ch)
{
unsigned long flags;
int c, ret = 0;
if (down_interruptible(&port->info->tmpbuf_sem))
return -EINTR;
while (1) {
int c1;
c = CIRC_SPACE_TO_END(circ->head, circ->tail, UART_XMIT_SIZE);
if (count < c)
c = count;
if (c <= 0)
break;
struct uart_state *state = tty->driver_data;
c -= copy_from_user(port->info->tmpbuf, buf, c);
if (!c) {
if (!ret)
ret = -EFAULT;
break;
}
spin_lock_irqsave(&port->lock, flags);
c1 = CIRC_SPACE_TO_END(circ->head, circ->tail, UART_XMIT_SIZE);
if (c1 < c)
c = c1;
memcpy(circ->buf + circ->head, port->info->tmpbuf, c);
circ->head = (circ->head + c) & (UART_XMIT_SIZE - 1);
spin_unlock_irqrestore(&port->lock, flags);
buf += c;
count -= c;
ret += c;
}
up(&port->info->tmpbuf_sem);
__uart_put_char(state->port, &state->info->xmit, ch);
}
return ret;
static void uart_flush_chars(struct tty_struct *tty)
{
uart_start(tty);
}
static inline int
__uart_kern_write(struct uart_port *port, struct circ_buf *circ,
const unsigned char *buf, int count)
static int
uart_write(struct tty_struct *tty, const unsigned char * buf, int count)
{
struct uart_state *state = tty->driver_data;
struct uart_port *port = state->port;
struct circ_buf *circ = &state->info->xmit;
unsigned long flags;
int c, ret = 0;
if (!circ->buf)
return 0;
spin_lock_irqsave(&port->lock, flags);
while (1) {
c = CIRC_SPACE_TO_END(circ->head, circ->tail, UART_XMIT_SIZE);
......@@ -512,33 +486,6 @@ __uart_kern_write(struct uart_port *port, struct circ_buf *circ,
}
spin_unlock_irqrestore(&port->lock, flags);
return ret;
}
static void uart_put_char(struct tty_struct *tty, unsigned char ch)
{
struct uart_state *state = tty->driver_data;
__uart_put_char(state->port, &state->info->xmit, ch);
}
static void uart_flush_chars(struct tty_struct *tty)
{
uart_start(tty);
}
static int
uart_write(struct tty_struct *tty, const unsigned char * buf, int count)
{
struct uart_state *state = tty->driver_data;
int ret;
if (!state->info->xmit.buf)
return 0;
ret = __uart_kern_write(state->port, &state->info->xmit,
buf, count);
uart_start(tty);
return ret;
}
......
/*
* linux/include/linux/serial_8250.h
*
* Copyright (C) 2004 Russell King
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef _LINUX_SERIAL_8250_H
#define _LINUX_SERIAL_8250_H
#include <linux/serial_core.h>
#include <linux/device.h>
struct plat_serial8250_port {
unsigned long iobase; /* io base address */
void __iomem *membase; /* ioremap cookie or NULL */
unsigned long mapbase; /* resource base */
unsigned int irq; /* interrupt number */
unsigned int uartclk; /* UART clock rate */
unsigned char regshift; /* register shift */
unsigned char iotype; /* UPIO_* */
unsigned int flags; /* UPF_* flags */
};
#endif
......@@ -17,6 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef LINUX_SERIAL_CORE_H
#define LINUX_SERIAL_CORE_H
/*
* The type definitions. These are from Ted Ts'o's serial.h
......@@ -96,6 +98,7 @@
#include <linux/circ_buf.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/tty.h>
struct uart_port;
struct uart_info;
......@@ -246,7 +249,7 @@ struct uart_state {
struct semaphore sem;
};
#define UART_XMIT_SIZE 1024
#define UART_XMIT_SIZE PAGE_SIZE
/*
* This is the state information which is only valid when the port
* is open; it may be freed by the core driver once the device has
......@@ -268,9 +271,6 @@ struct uart_info {
#define UIF_NORMAL_ACTIVE (1 << 29)
#define UIF_INITIALIZED (1 << 31)
unsigned char *tmpbuf;
struct semaphore tmpbuf_sem;
int blocked_open;
struct tasklet_struct tlet;
......@@ -458,3 +458,5 @@ uart_handle_cts_change(struct uart_port *port, unsigned int status)
!((cflag) & CLOCAL))
#endif
#endif /* LINUX_SERIAL_CORE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment