diff options
author | Alan Cox <alan@redhat.com> | 2008-07-16 16:53:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:12:35 -0400 |
commit | df4f4dd429870f435f8d5d9d561db029a29f063b (patch) | |
tree | 5e33106f5e5fc4c530170087d3151c13659fad1f /include | |
parent | 6f67048cd010afe19d79d821f16055d9c704c6f0 (diff) |
serial: use tty_port
Switch the serial_core based drivers to use the new tty_port structure.
We can't quite use all of it yet because of the dynamically allocated
extras in the serial_core layer.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/serial_core.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 1d2faa6592ae..f3a1c0e45021 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -344,13 +344,15 @@ typedef unsigned int __bitwise__ uif_t; | |||
344 | * stuff here. | 344 | * stuff here. |
345 | */ | 345 | */ |
346 | struct uart_info { | 346 | struct uart_info { |
347 | struct tty_struct *tty; | 347 | struct tty_port port; |
348 | struct circ_buf xmit; | 348 | struct circ_buf xmit; |
349 | uif_t flags; | 349 | uif_t flags; |
350 | 350 | ||
351 | /* | 351 | /* |
352 | * Definitions for info->flags. These are _private_ to serial_core, and | 352 | * Definitions for info->flags. These are _private_ to serial_core, and |
353 | * are specific to this structure. They may be queried by low level drivers. | 353 | * are specific to this structure. They may be queried by low level drivers. |
354 | * | ||
355 | * FIXME: use the ASY_ definitions | ||
354 | */ | 356 | */ |
355 | #define UIF_CHECK_CD ((__force uif_t) (1 << 25)) | 357 | #define UIF_CHECK_CD ((__force uif_t) (1 << 25)) |
356 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) | 358 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) |
@@ -358,11 +360,7 @@ struct uart_info { | |||
358 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) | 360 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) |
359 | #define UIF_SUSPENDED ((__force uif_t) (1 << 30)) | 361 | #define UIF_SUSPENDED ((__force uif_t) (1 << 30)) |
360 | 362 | ||
361 | int blocked_open; | ||
362 | |||
363 | struct tasklet_struct tlet; | 363 | struct tasklet_struct tlet; |
364 | |||
365 | wait_queue_head_t open_wait; | ||
366 | wait_queue_head_t delta_msr_wait; | 364 | wait_queue_head_t delta_msr_wait; |
367 | }; | 365 | }; |
368 | 366 | ||
@@ -439,8 +437,8 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); | |||
439 | #define uart_circ_chars_free(circ) \ | 437 | #define uart_circ_chars_free(circ) \ |
440 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) | 438 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) |
441 | 439 | ||
442 | #define uart_tx_stopped(port) \ | 440 | #define uart_tx_stopped(portp) \ |
443 | ((port)->info->tty->stopped || (port)->info->tty->hw_stopped) | 441 | ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped) |
444 | 442 | ||
445 | /* | 443 | /* |
446 | * The following are helper functions for the low level drivers. | 444 | * The following are helper functions for the low level drivers. |
@@ -451,7 +449,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
451 | #ifdef SUPPORT_SYSRQ | 449 | #ifdef SUPPORT_SYSRQ |
452 | if (port->sysrq) { | 450 | if (port->sysrq) { |
453 | if (ch && time_before(jiffies, port->sysrq)) { | 451 | if (ch && time_before(jiffies, port->sysrq)) { |
454 | handle_sysrq(ch, port->info ? port->info->tty : NULL); | 452 | handle_sysrq(ch, port->info ? port->info->port.tty : NULL); |
455 | port->sysrq = 0; | 453 | port->sysrq = 0; |
456 | return 1; | 454 | return 1; |
457 | } | 455 | } |
@@ -480,7 +478,7 @@ static inline int uart_handle_break(struct uart_port *port) | |||
480 | } | 478 | } |
481 | #endif | 479 | #endif |
482 | if (port->flags & UPF_SAK) | 480 | if (port->flags & UPF_SAK) |
483 | do_SAK(info->tty); | 481 | do_SAK(info->port.tty); |
484 | return 0; | 482 | return 0; |
485 | } | 483 | } |
486 | 484 | ||
@@ -503,9 +501,9 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status) | |||
503 | 501 | ||
504 | if (info->flags & UIF_CHECK_CD) { | 502 | if (info->flags & UIF_CHECK_CD) { |
505 | if (status) | 503 | if (status) |
506 | wake_up_interruptible(&info->open_wait); | 504 | wake_up_interruptible(&info->port.open_wait); |
507 | else if (info->tty) | 505 | else if (info->port.tty) |
508 | tty_hangup(info->tty); | 506 | tty_hangup(info->port.tty); |
509 | } | 507 | } |
510 | } | 508 | } |
511 | 509 | ||
@@ -518,7 +516,7 @@ static inline void | |||
518 | uart_handle_cts_change(struct uart_port *port, unsigned int status) | 516 | uart_handle_cts_change(struct uart_port *port, unsigned int status) |
519 | { | 517 | { |
520 | struct uart_info *info = port->info; | 518 | struct uart_info *info = port->info; |
521 | struct tty_struct *tty = info->tty; | 519 | struct tty_struct *tty = info->port.tty; |
522 | 520 | ||
523 | port->icount.cts++; | 521 | port->icount.cts++; |
524 | 522 | ||
@@ -544,7 +542,7 @@ static inline void | |||
544 | uart_insert_char(struct uart_port *port, unsigned int status, | 542 | uart_insert_char(struct uart_port *port, unsigned int status, |
545 | unsigned int overrun, unsigned int ch, unsigned int flag) | 543 | unsigned int overrun, unsigned int ch, unsigned int flag) |
546 | { | 544 | { |
547 | struct tty_struct *tty = port->info->tty; | 545 | struct tty_struct *tty = port->info->port.tty; |
548 | 546 | ||
549 | if ((status & port->ignore_status_mask & ~overrun) == 0) | 547 | if ((status & port->ignore_status_mask & ~overrun) == 0) |
550 | tty_insert_flip_char(tty, ch, flag); | 548 | tty_insert_flip_char(tty, ch, flag); |