* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / drivers / isdn / pcbit / pcbit.h
blob45c68871dd5b55fb8f47b95c464abeae37ce0321
1 /*
2 * Copyright (C) 1996 Universidade de Lisboa
3 *
4 * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
6 * This software may be used and distributed according to the terms of
7 * the GNU Public License, incorporated herein by reference.
8 */
10 /*
11 * PCBIT-D device driver definitions
14 #ifndef PCBIT_H
15 #define PCBIT_H
17 #define MAX_PCBIT_CARDS 4
20 #define BLOCK_TIMER
22 #ifdef __KERNEL__
24 struct pcbit_chan {
25 unsigned short id;
26 unsigned short callref; /* Call Reference */
27 unsigned char proto; /* layer2protocol */
28 unsigned char queued; /* unacked data messages */
29 unsigned char layer2link; /* used in TData */
30 unsigned char snum; /* used in TData */
31 unsigned short s_refnum;
32 unsigned short r_refnum;
33 unsigned short fsm_state;
34 struct timer_list fsm_timer;
35 #ifdef BLOCK_TIMER
36 struct timer_list block_timer;
37 #endif
40 struct msn_entry {
41 char *msn;
42 struct msn_entry * next;
45 struct pcbit_dev {
46 /* board */
48 volatile unsigned char* sh_mem; /* RDP address */
49 unsigned int irq;
50 unsigned int id;
51 unsigned int interrupt; /* set during interrupt
52 processing */
54 /* isdn4linux */
56 struct msn_entry * msn_list; /* ISDN address list */
58 isdn_if * dev_if;
60 ushort ll_hdrlen;
61 ushort hl_hdrlen;
63 /* link layer */
64 unsigned char l2_state;
66 struct frame_buf *read_queue;
67 struct frame_buf *read_frame;
68 struct frame_buf *write_queue;
70 /* Protocol start */
71 #ifdef COMPAT_HAS_NEW_WAITQ
72 wait_queue_head_t set_running_wq;
73 #else
74 struct wait_queue *set_running_wq;
75 #endif
76 struct timer_list set_running_timer;
78 struct timer_list error_recover_timer;
80 struct tq_struct qdelivery;
82 u_char w_busy;
83 u_char r_busy;
85 volatile unsigned char *readptr;
86 volatile unsigned char *writeptr;
88 ushort loadptr;
90 unsigned short fsize[8]; /* sent layer2 frames size */
92 unsigned char send_seq;
93 unsigned char rcv_seq;
94 unsigned char unack_seq;
96 unsigned short free;
98 /* channels */
100 struct pcbit_chan *b1;
101 struct pcbit_chan *b2;
104 #define STATS_TIMER (10*HZ)
105 #define ERRTIME (HZ/10)
107 /* MRU */
108 #define MAXBUFSIZE 1534
109 #define MRU MAXBUFSIZE
111 #define STATBUF_LEN 2048
116 #endif /* __KERNEL__ */
118 /* isdn_ctrl only allows a long sized argument */
120 struct pcbit_ioctl {
121 union {
122 struct byte_op {
123 ushort addr;
124 ushort value;
125 } rdp_byte;
126 unsigned long l2_status;
127 } info;
132 #define PCBIT_IOCTL_GETSTAT 0x01 /* layer2 status */
133 #define PCBIT_IOCTL_LWMODE 0x02 /* linear write mode */
134 #define PCBIT_IOCTL_STRLOAD 0x03 /* start load mode */
135 #define PCBIT_IOCTL_ENDLOAD 0x04 /* end load mode */
136 #define PCBIT_IOCTL_SETBYTE 0x05 /* set byte */
137 #define PCBIT_IOCTL_GETBYTE 0x06 /* get byte */
138 #define PCBIT_IOCTL_RUNNING 0x07 /* set protocol running */
139 #define PCBIT_IOCTL_WATCH188 0x08 /* set watch 188 */
140 #define PCBIT_IOCTL_PING188 0x09 /* ping 188 */
141 #define PCBIT_IOCTL_FWMODE 0x0A /* firmware write mode */
142 #define PCBIT_IOCTL_STOP 0x0B /* stop protocol */
143 #define PCBIT_IOCTL_APION 0x0C /* issue API_ON */
145 #ifndef __KERNEL__
147 #define PCBIT_GETSTAT (PCBIT_IOCTL_GETSTAT + IIOCDRVCTL)
148 #define PCBIT_LWMODE (PCBIT_IOCTL_LWMODE + IIOCDRVCTL)
149 #define PCBIT_STRLOAD (PCBIT_IOCTL_STRLOAD + IIOCDRVCTL)
150 #define PCBIT_ENDLOAD (PCBIT_IOCTL_ENDLOAD + IIOCDRVCTL)
151 #define PCBIT_SETBYTE (PCBIT_IOCTL_SETBYTE + IIOCDRVCTL)
152 #define PCBIT_GETBYTE (PCBIT_IOCTL_GETBYTE + IIOCDRVCTL)
153 #define PCBIT_RUNNING (PCBIT_IOCTL_RUNNING + IIOCDRVCTL)
154 #define PCBIT_WATCH188 (PCBIT_IOCTL_WATCH188 + IIOCDRVCTL)
155 #define PCBIT_PING188 (PCBIT_IOCTL_PING188 + IIOCDRVCTL)
156 #define PCBIT_FWMODE (PCBIT_IOCTL_FWMODE + IIOCDRVCTL)
157 #define PCBIT_STOP (PCBIT_IOCTL_STOP + IIOCDRVCTL)
158 #define PCBIT_APION (PCBIT_IOCTL_APION + IIOCDRVCTL)
160 #define MAXSUPERLINE 3000
162 #endif
164 #define L2_DOWN 0
165 #define L2_LOADING 1
166 #define L2_LWMODE 2
167 #define L2_FWMODE 3
168 #define L2_STARTING 4
169 #define L2_RUNNING 5
170 #define L2_ERROR 6
172 #endif