2 * Private header file for the (dumb) serial driver
4 * Copyright (C) 1997 by Theodore Ts'o.
6 * Redistribution of this file is permitted under the terms of the GNU
10 #ifndef _LINUX_SERIALP_H
11 #define _LINUX_SERIALP_H
14 * This is our internal structure for each serial port's state.
16 * Many fields are paralleled by the structure used by the serial_struct
19 * For definitions of the flags field, see tty.h
22 #include <linux/termios.h>
23 #include <linux/tqueue.h>
26 * Counters of the input lines (CTS, DSR, RI, CD) interrupts
29 __u32 cts
, dsr
, rng
, dcd
, tx
, rx
;
30 __u32 frame
, parity
, overrun
, brk
;
46 unsigned short close_delay
;
47 unsigned short closing_wait
; /* time to wait before closing */
48 struct async_icount icount
;
49 struct termios normal_termios
;
50 struct termios callout_termios
;
51 struct async_struct
*info
;
60 struct serial_state
*state
;
61 struct tty_struct
*tty
;
63 int ignore_status_mask
;
66 int x_char
; /* xon/xoff character */
68 unsigned short closing_wait
;
69 unsigned short closing_wait2
;
70 int IER
; /* Interrupt Enable Register */
71 int MCR
; /* Modem control register */
73 unsigned long last_active
;
75 int blocked_open
; /* # of blocked opens */
76 long session
; /* Session of opening process */
77 long pgrp
; /* pgrp of opening process */
78 unsigned char *xmit_buf
;
82 struct tq_struct tqueue
;
83 wait_queue_head_t open_wait
;
84 wait_queue_head_t close_wait
;
85 wait_queue_head_t delta_msr_wait
;
86 struct async_struct
*next_port
; /* For the linked list */
87 struct async_struct
*prev_port
;
90 #define SERIAL_MAGIC 0x5301
91 #define SSTATE_MAGIC 0x5302
94 * The size of the serial xmit buffer is 1 page, or 4096 bytes
96 #define SERIAL_XMIT_SIZE 4096
99 * Events are used to schedule things to happen at timer-interrupt
100 * time, instead of at rs interrupt time.
102 #define RS_EVENT_WRITE_WAKEUP 0
105 * Multiport serial configuration structure --- internal structure
107 struct rs_multiport_struct
{
109 unsigned char mask1
, match1
;
111 unsigned char mask2
, match2
;
113 unsigned char mask3
, match3
;
115 unsigned char mask4
, match4
;
119 #endif /* _LINUX_SERIAL_H */