Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver...
[linux-2.6/verdex.git] / include / linux / hayesesp.h
blobb436be7a7fff35869383b38b3516a83223f69516
1 #ifndef HAYESESP_H
2 #define HAYESESP_H
4 struct hayes_esp_config {
5 short flow_on;
6 short flow_off;
7 short rx_trigger;
8 short tx_trigger;
9 short pio_threshold;
10 unsigned char rx_timeout;
11 char dma_channel;
14 #ifdef __KERNEL__
16 #define ESP_DMA_CHANNEL 0
17 #define ESP_RX_TRIGGER 768
18 #define ESP_TX_TRIGGER 768
19 #define ESP_FLOW_OFF 1016
20 #define ESP_FLOW_ON 944
21 #define ESP_RX_TMOUT 128
22 #define ESP_PIO_THRESHOLD 32
24 #define ESP_IN_MAJOR 57 /* major dev # for dial in */
25 #define ESP_OUT_MAJOR 58 /* major dev # for dial out */
26 #define ESPC_SCALE 3
27 #define UART_ESI_BASE 0x00
28 #define UART_ESI_SID 0x01
29 #define UART_ESI_RX 0x02
30 #define UART_ESI_TX 0x02
31 #define UART_ESI_CMD1 0x04
32 #define UART_ESI_CMD2 0x05
33 #define UART_ESI_STAT1 0x04
34 #define UART_ESI_STAT2 0x05
35 #define UART_ESI_RWS 0x07
37 #define UART_IER_DMA_TMOUT 0x80
38 #define UART_IER_DMA_TC 0x08
40 #define ESI_SET_IRQ 0x04
41 #define ESI_SET_DMA_TMOUT 0x05
42 #define ESI_SET_SRV_MASK 0x06
43 #define ESI_SET_ERR_MASK 0x07
44 #define ESI_SET_FLOW_CNTL 0x08
45 #define ESI_SET_FLOW_CHARS 0x09
46 #define ESI_SET_FLOW_LVL 0x0a
47 #define ESI_SET_TRIGGER 0x0b
48 #define ESI_SET_RX_TIMEOUT 0x0c
49 #define ESI_SET_FLOW_TMOUT 0x0d
50 #define ESI_WRITE_UART 0x0e
51 #define ESI_READ_UART 0x0f
52 #define ESI_SET_MODE 0x10
53 #define ESI_GET_ERR_STAT 0x12
54 #define ESI_GET_UART_STAT 0x13
55 #define ESI_GET_RX_AVAIL 0x14
56 #define ESI_GET_TX_AVAIL 0x15
57 #define ESI_START_DMA_RX 0x16
58 #define ESI_START_DMA_TX 0x17
59 #define ESI_ISSUE_BREAK 0x1a
60 #define ESI_FLUSH_RX 0x1b
61 #define ESI_FLUSH_TX 0x1c
62 #define ESI_SET_BAUD 0x1d
63 #define ESI_SET_ENH_IRQ 0x1f
64 #define ESI_SET_REINTR 0x20
65 #define ESI_SET_PRESCALAR 0x23
66 #define ESI_NO_COMMAND 0xff
68 #define ESP_STAT_RX_TIMEOUT 0x01
69 #define ESP_STAT_DMA_RX 0x02
70 #define ESP_STAT_DMA_TX 0x04
71 #define ESP_STAT_NEVER_DMA 0x08
72 #define ESP_STAT_USE_PIO 0x10
74 #define ESP_EVENT_WRITE_WAKEUP 0
75 #define ESP_MAGIC 0x53ee
76 #define ESP_XMIT_SIZE 4096
78 struct esp_struct {
79 int magic;
80 spinlock_t lock;
81 int port;
82 int irq;
83 int flags; /* defined in tty.h */
84 struct tty_struct *tty;
85 int read_status_mask;
86 int ignore_status_mask;
87 int timeout;
88 int stat_flags;
89 int custom_divisor;
90 int close_delay;
91 unsigned short closing_wait;
92 unsigned short closing_wait2;
93 int IER; /* Interrupt Enable Register */
94 int MCR; /* Modem control register */
95 unsigned long event;
96 unsigned long last_active;
97 int line;
98 int count; /* # of fd on device */
99 int blocked_open; /* # of blocked opens */
100 unsigned char *xmit_buf;
101 int xmit_head;
102 int xmit_tail;
103 int xmit_cnt;
104 struct work_struct tqueue;
105 struct work_struct tqueue_hangup;
106 wait_queue_head_t open_wait;
107 wait_queue_head_t close_wait;
108 wait_queue_head_t delta_msr_wait;
109 wait_queue_head_t break_wait;
110 struct async_icount icount; /* kernel counters for the 4 input interrupts */
111 struct hayes_esp_config config; /* port configuration */
112 struct esp_struct *next_port; /* For the linked list */
115 struct esp_pio_buffer {
116 unsigned char data[1024];
117 struct esp_pio_buffer *next;
120 #endif /* __KERNEL__ */
123 #endif /* ESP_H */