Import 2.3.7pre7
[davej-history.git] / include / linux / serialP.h
blob28e66f9e4e7ad48cc167388e8cf4dda7d277f006
1 /*
2 * Private header file for the (dumb) serial driver
4 * Copyright (C) 1997 by Theodore Ts'o.
5 *
6 * Redistribution of this file is permitted under the terms of the GNU
7 * Public License (GPL)
8 */
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
17 * structure.
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
28 struct async_icount {
29 __u32 cts, dsr, rng, dcd, tx, rx;
30 __u32 frame, parity, overrun, brk;
31 __u32 buf_overrun;
34 struct serial_state {
35 int magic;
36 int baud_base;
37 int port;
38 int irq;
39 int flags;
40 int hub6;
41 int type;
42 int line;
43 int xmit_fifo_size;
44 int custom_divisor;
45 int count;
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;
54 struct async_struct {
55 int magic;
56 int port;
57 int hub6;
58 int flags;
59 int xmit_fifo_size;
60 struct serial_state *state;
61 struct tty_struct *tty;
62 int read_status_mask;
63 int ignore_status_mask;
64 int timeout;
65 int quot;
66 int x_char; /* xon/xoff character */
67 int close_delay;
68 unsigned short closing_wait;
69 unsigned short closing_wait2;
70 int IER; /* Interrupt Enable Register */
71 int MCR; /* Modem control register */
72 unsigned long event;
73 unsigned long last_active;
74 int line;
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;
79 int xmit_head;
80 int xmit_tail;
81 int xmit_cnt;
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 {
108 int port1;
109 unsigned char mask1, match1;
110 int port2;
111 unsigned char mask2, match2;
112 int port3;
113 unsigned char mask3, match3;
114 int port4;
115 unsigned char mask4, match4;
116 int port_monitor;
119 #endif /* _LINUX_SERIAL_H */