Commit ccce6deb authored by Alan Cox's avatar Alan Cox Committed by Live-CD User

serial: move the flags into the tty_port field

Fortunately the serial layer was designed to use the same flag values but
with different names. It has its own SUSPENDED flag which is a free slot in
the ASYNC flags so we allocate it in the ASYNC flags instead.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 91312cdb
This diff is collapsed.
......@@ -122,6 +122,7 @@ struct serial_uart_config {
/* Internal flags used only by kernel */
#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
#define ASYNCB_CLOSING 27 /* Serial port is closing */
......@@ -133,6 +134,7 @@ struct serial_uart_config {
#define ASYNCB_FIRST_KERNEL 22
#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
#define ASYNC_SAK (1U << ASYNCB_SAK)
#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
......
......@@ -20,6 +20,8 @@
#ifndef LINUX_SERIAL_CORE_H
#define LINUX_SERIAL_CORE_H
#include <linux/serial.h>
/*
* The type definitions. These are from Ted Ts'o's serial.h
*/
......@@ -356,19 +358,6 @@ struct uart_state {
int pm_state;
struct circ_buf xmit;
uif_t flags;
/*
* Definitions for info->flags. These are _private_ to serial_core, and
* are specific to this structure. They may be queried by low level drivers.
*
* FIXME: use the ASY_ definitions
*/
#define UIF_CHECK_CD ((__force uif_t) (1 << 25))
#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
#define UIF_SUSPENDED ((__force uif_t) (1 << 30))
struct tasklet_struct tlet;
wait_queue_head_t delta_msr_wait;
......@@ -509,22 +498,23 @@ static inline int uart_handle_break(struct uart_port *port)
* @status: new carrier detect status, nonzero if active
*/
static inline void
uart_handle_dcd_change(struct uart_port *port, unsigned int status)
uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
{
struct uart_state *state = port->state;
struct uart_state *state = uport->state;
struct tty_port *port = &state->port;
port->icount.dcd++;
uport->icount.dcd++;
#ifdef CONFIG_HARD_PPS
if ((port->flags & UPF_HARDPPS_CD) && status)
if ((uport->flags & UPF_HARDPPS_CD) && status)
hardpps();
#endif
if (state->flags & UIF_CHECK_CD) {
if (port->flags & ASYNC_CHECK_CD) {
if (status)
wake_up_interruptible(&state->port.open_wait);
else if (state->port.tty)
tty_hangup(state->port.tty);
wake_up_interruptible(&port->open_wait);
else if (port->tty)
tty_hangup(port->tty);
}
}
......@@ -534,24 +524,24 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
* @status: new clear to send status, nonzero if active
*/
static inline void
uart_handle_cts_change(struct uart_port *port, unsigned int status)
uart_handle_cts_change(struct uart_port *uport, unsigned int status)
{
struct uart_state *state = port->state;
struct tty_struct *tty = state->port.tty;
struct tty_port *port = &uport->state->port;
struct tty_struct *tty = port->tty;
port->icount.cts++;
uport->icount.cts++;
if (state->flags & UIF_CTS_FLOW) {
if (port->flags & ASYNC_CTS_FLOW) {
if (tty->hw_stopped) {
if (status) {
tty->hw_stopped = 0;
port->ops->start_tx(port);
uart_write_wakeup(port);
uport->ops->start_tx(uport);
uart_write_wakeup(uport);
}
} else {
if (!status) {
tty->hw_stopped = 1;
port->ops->stop_tx(port);
uport->ops->stop_tx(uport);
}
}
}
......
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