aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-09-19 16:13:30 -0400
committerLive-CD User <linux@linux.site>2009-09-19 16:13:30 -0400
commitccce6debb62d94964e3878f978a56b0f3e32d94f (patch)
treec6df089e5b4394d841819090921b1673901d7a3a /include/linux
parent91312cdb4fcd832341e425f74f49938e0503c929 (diff)
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: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/serial.h2
-rw-r--r--include/linux/serial_core.h48
2 files changed, 21 insertions, 29 deletions
diff --git a/include/linux/serial.h b/include/linux/serial.h
index e5bb75a63802..c8613c3ff9d3 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -122,6 +122,7 @@ struct serial_uart_config {
122 122
123/* Internal flags used only by kernel */ 123/* Internal flags used only by kernel */
124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ 124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
125#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
125#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ 126#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
126#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ 127#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
127#define ASYNCB_CLOSING 27 /* Serial port is closing */ 128#define ASYNCB_CLOSING 27 /* Serial port is closing */
@@ -133,6 +134,7 @@ struct serial_uart_config {
133#define ASYNCB_FIRST_KERNEL 22 134#define ASYNCB_FIRST_KERNEL 22
134 135
135#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) 136#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
137#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
136#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) 138#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
137#define ASYNC_SAK (1U << ASYNCB_SAK) 139#define ASYNC_SAK (1U << ASYNCB_SAK)
138#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) 140#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 63ad90966db2..284ef7f54890 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -20,6 +20,8 @@
20#ifndef LINUX_SERIAL_CORE_H 20#ifndef LINUX_SERIAL_CORE_H
21#define LINUX_SERIAL_CORE_H 21#define LINUX_SERIAL_CORE_H
22 22
23#include <linux/serial.h>
24
23/* 25/*
24 * The type definitions. These are from Ted Ts'o's serial.h 26 * The type definitions. These are from Ted Ts'o's serial.h
25 */ 27 */
@@ -356,19 +358,6 @@ struct uart_state {
356 358
357 int pm_state; 359 int pm_state;
358 struct circ_buf xmit; 360 struct circ_buf xmit;
359 uif_t flags;
360
361/*
362 * Definitions for info->flags. These are _private_ to serial_core, and
363 * are specific to this structure. They may be queried by low level drivers.
364 *
365 * FIXME: use the ASY_ definitions
366 */
367#define UIF_CHECK_CD ((__force uif_t) (1 << 25))
368#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
369#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
370#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
371#define UIF_SUSPENDED ((__force uif_t) (1 << 30))
372 361
373 struct tasklet_struct tlet; 362 struct tasklet_struct tlet;
374 wait_queue_head_t delta_msr_wait; 363 wait_queue_head_t delta_msr_wait;
@@ -509,22 +498,23 @@ static inline int uart_handle_break(struct uart_port *port)
509 * @status: new carrier detect status, nonzero if active 498 * @status: new carrier detect status, nonzero if active
510 */ 499 */
511static inline void 500static inline void
512uart_handle_dcd_change(struct uart_port *port, unsigned int status) 501uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
513{ 502{
514 struct uart_state *state = port->state; 503 struct uart_state *state = uport->state;
504 struct tty_port *port = &state->port;
515 505
516 port->icount.dcd++; 506 uport->icount.dcd++;
517 507
518#ifdef CONFIG_HARD_PPS 508#ifdef CONFIG_HARD_PPS
519 if ((port->flags & UPF_HARDPPS_CD) && status) 509 if ((uport->flags & UPF_HARDPPS_CD) && status)
520 hardpps(); 510 hardpps();
521#endif 511#endif
522 512
523 if (state->flags & UIF_CHECK_CD) { 513 if (port->flags & ASYNC_CHECK_CD) {
524 if (status) 514 if (status)
525 wake_up_interruptible(&state->port.open_wait); 515 wake_up_interruptible(&port->open_wait);
526 else if (state->port.tty) 516 else if (port->tty)
527 tty_hangup(state->port.tty); 517 tty_hangup(port->tty);
528 } 518 }
529} 519}
530 520
@@ -534,24 +524,24 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
534 * @status: new clear to send status, nonzero if active 524 * @status: new clear to send status, nonzero if active
535 */ 525 */
536static inline void 526static inline void
537uart_handle_cts_change(struct uart_port *port, unsigned int status) 527uart_handle_cts_change(struct uart_port *uport, unsigned int status)
538{ 528{
539 struct uart_state *state = port->state; 529 struct tty_port *port = &uport->state->port;
540 struct tty_struct *tty = state->port.tty; 530 struct tty_struct *tty = port->tty;
541 531
542 port->icount.cts++; 532 uport->icount.cts++;
543 533
544 if (state->flags & UIF_CTS_FLOW) { 534 if (port->flags & ASYNC_CTS_FLOW) {
545 if (tty->hw_stopped) { 535 if (tty->hw_stopped) {
546 if (status) { 536 if (status) {
547 tty->hw_stopped = 0; 537 tty->hw_stopped = 0;
548 port->ops->start_tx(port); 538 uport->ops->start_tx(uport);
549 uart_write_wakeup(port); 539 uart_write_wakeup(uport);
550 } 540 }
551 } else { 541 } else {
552 if (!status) { 542 if (!status) {
553 tty->hw_stopped = 1; 543 tty->hw_stopped = 1;
554 port->ops->stop_tx(port); 544 uport->ops->stop_tx(uport);
555 } 545 }
556 } 546 }
557 } 547 }