MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / drivers / serial / serial_atmel.h
blob21c900293c402e9156e13c7432e6d6317e8e00cf
1 /* serial-atmel.h: Definitions for the Atmel serial driver.
3 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
4 * D. Jeff Dionne <jeff@uClinux.org>,
5 * The Silver Hammer Group, Ltd.
6 * Copyright (C) 2004 Hyok S. Choi <hyok.choi@samsung.com>
7 * 2.6 port
9 * Based on:
11 * drivers/char/68328serial.h
13 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
16 #ifndef _ATMEL_SERIAL_H
17 #define _ATMEL_SERIAL_H
19 #include <asm/page.h>
20 #include <asm/arch/hardware.h>
23 * For the close wait times, 0 means wait forever for serial port to
24 * flush its output. 65535 means don't wait at all.
26 #define S_CLOSING_WAIT_INF 0
27 #define S_CLOSING_WAIT_NONE 65535
30 * Definitions for S_struct (and serial_struct) flags field
32 #define S_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
33 on the callout port */
34 #define S_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */
35 #define S_SAK 0x0004 /* Secure Attention Key (Orange book) */
36 #define S_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
38 #define S_SPD_MASK 0x0030
39 #define S_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */
41 #define S_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */
42 #define S_SPD_CUST 0x0030 /* Use user-specified divisor */
44 #define S_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */
45 #define S_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */
46 #define S_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
47 #define S_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
48 #define S_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */
50 #define S_FLAGS 0x0FFF /* Possible legal S flags */
51 #define S_USR_MASK 0x0430 /* Legal flags that non-privileged
52 * users can set or reset */
54 /* Internal flags used only by kernel/chr_drv/serial.c */
55 #define S_INITIALIZED 0x80000000 /* Serial port was initialized */
56 #define S_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */
57 #define S_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
58 #define S_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */
59 #define S_CLOSING 0x08000000 /* Serial port is closing */
60 #define S_CTS_FLOW 0x04000000 /* Do CTS flow control */
61 #define S_CHECK_CD 0x02000000 /* i.e., CLOCAL */
63 #define RS_EVENT_WRITE_WAKEUP 0
64 #define SERIAL_MAGIC 0x5301
66 /* Software state per channel */
69 * This is our internal structure for each serial port's state.
71 * Many fields are paralleled by the structure used by the serial_struct
72 * structure.
74 * For definitions of the flags field, see tty.h
77 struct atmel_serial {
78 char soft_carrier; /* Use soft carrier on this channel */
79 char break_abort; /* Is serial console in, so process brk/abrt */
80 char is_cons; /* Is this our console. */
82 /* We need to know the current clock divisor
83 * to read the bps rate the chip has currently
84 * loaded.
86 unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
87 int baud;
88 int magic;
89 int baud_base;
90 int port;
91 int irq;
92 int irqmask;
93 int flags; /* defined in tty.h */
94 int type; /* UART type */
95 int use_ints;
96 volatile struct atmel_usart_regs *usart;
97 int cts_state;
98 struct tty_struct *tty;
99 int read_status_mask;
100 int ignore_status_mask;
101 int timeout;
102 int xmit_fifo_size;
103 int custom_divisor;
104 int x_char; /* xon/xoff character */
105 int close_delay;
106 unsigned short closing_wait;
107 unsigned short closing_wait2;
108 unsigned long event;
109 unsigned long last_active;
110 int line;
111 int count; /* # of fd on device */
112 int blocked_open; /* # of blocked opens */
113 unsigned char *xmit_buf;
114 unsigned char *rx_buf;
115 int xmit_head;
116 int xmit_tail;
117 int xmit_cnt;
118 struct work_struct tqueue;
119 struct work_struct tqueue_hangup;
120 wait_queue_head_t open_wait;
121 wait_queue_head_t close_wait;
124 #endif /* !(_ATMEL_SERIAL_H) */