pre-2.3.4..
[davej-history.git] / drivers / isdn / eicon / eicon_idi.h
bloba0605cdef8646d73af393b2b40dd5a2f21dc03ae
1 /* $Id: eicon_idi.h,v 1.4 1999/03/29 11:19:44 armin Exp $
3 * ISDN lowlevel-module for the Eicon.Diehl active cards.
4 * IDI-Interface
6 * Copyright 1998,99 by Armin Schindler (mac@melware.de)
7 * Copyright 1999 Cytronics & Melware (info@melware.de)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * $Log: eicon_idi.h,v $
24 * Revision 1.4 1999/03/29 11:19:44 armin
25 * I/O stuff now in seperate file (eicon_io.c)
26 * Old ISA type cards (S,SX,SCOM,Quadro,S2M) implemented.
28 * Revision 1.3 1999/03/02 12:37:45 armin
29 * Added some important checks.
30 * Analog Modem with DSP.
31 * Channels will be added to Link-Level after loading firmware.
33 * Revision 1.2 1999/01/24 20:14:18 armin
34 * Changed and added debug stuff.
35 * Better data sending. (still problems with tty's flip buffer)
37 * Revision 1.1 1999/01/01 18:09:42 armin
38 * First checkin of new eicon driver.
39 * DIVA-Server BRI/PCI and PRI/PCI are supported.
40 * Old diehl code is obsolete.
45 #ifndef IDI_H
46 #define IDI_H
49 #define ASSIGN 0x01
50 #define REMOVE 0xff
52 #define CALL_REQ 1 /* call request */
53 #define CALL_CON 1 /* call confirmation */
54 #define CALL_IND 2 /* incoming call connected */
55 #define LISTEN_REQ 2 /* listen request */
56 #define HANGUP 3 /* hangup request/indication */
57 #define SUSPEND 4 /* call suspend request/confirm */
58 #define RESUME 5 /* call resume request/confirm */
59 #define SUSPEND_REJ 6 /* suspend rejected indication */
60 #define USER_DATA 8 /* user data for user to user signaling */
61 #define CONGESTION 9 /* network congestion indication */
62 #define INDICATE_REQ 10 /* request to indicate an incoming call */
63 #define INDICATE_IND 10 /* indicates that there is an incoming call */
64 #define CALL_RES 11 /* accept an incoming call */
65 #define CALL_ALERT 12 /* send ALERT for incoming call */
66 #define INFO_REQ 13 /* INFO request */
67 #define INFO_IND 13 /* INFO indication */
68 #define REJECT 14 /* reject an incoming call */
69 #define RESOURCES 15 /* reserve B-Channel hardware resources */
70 #define TEL_CTRL 16 /* Telephone control request/indication */
71 #define STATUS_REQ 17 /* Request D-State (returned in INFO_IND) */
72 #define FAC_REG_REQ 18 /* connection idependent fac registration */
73 #define FAC_REG_ACK 19 /* fac registration acknowledge */
74 #define FAC_REG_REJ 20 /* fac registration reject */
75 #define CALL_COMPLETE 21/* send a CALL_PROC for incoming call */
76 #define AOC_IND 26/* Advice of Charge */
78 #define IDI_N_MDATA (0x01)
79 #define IDI_N_CONNECT (0x02)
80 #define IDI_N_CONNECT_ACK (0x03)
81 #define IDI_N_DISC (0x04)
82 #define IDI_N_DISC_ACK (0x05)
83 #define IDI_N_RESET (0x06)
84 #define IDI_N_RESET_ACK (0x07)
85 #define IDI_N_DATA (0x08)
86 #define IDI_N_EDATA (0x09)
87 #define IDI_N_UDATA (0x0a)
88 #define IDI_N_BDATA (0x0b)
89 #define IDI_N_DATA_ACK (0x0c)
90 #define IDI_N_EDATA_ACK (0x0d)
92 #define N_Q_BIT 0x10 /* Q-bit for req/ind */
93 #define N_M_BIT 0x20 /* M-bit for req/ind */
94 #define N_D_BIT 0x40 /* D-bit for req/ind */
97 #define SHIFT 0x90 /* codeset shift */
98 #define MORE 0xa0 /* more data */
99 #define CL 0xb0 /* congestion level */
101 /* codeset 0 */
103 #define BC 0x04 /* Bearer Capability */
104 #define CAU 0x08 /* cause */
105 #define CAD 0x0c /* Connected address */
106 #define CAI 0x10 /* call identity */
107 #define CHI 0x18 /* channel identification */
108 #define LLI 0x19 /* logical link id */
109 #define CHA 0x1a /* charge advice */
110 #define FTY 0x1c
111 #define PI 0x1e /* Progress Indicator */
112 #define NI 0x27 /* Notification Indicator */
113 #define DT 0x29 /* ETSI date/time */
114 #define KEY 0x2c /* keypad information element */
115 #define DSP 0x28 /* display */
116 #define OAD 0x6c /* origination address */
117 #define OSA 0x6d /* origination sub-address */
118 #define CPN 0x70 /* called party number */
119 #define DSA 0x71 /* destination sub-address */
120 #define RDN 0x74 /* redirecting number */
121 #define LLC 0x7c /* low layer compatibility */
122 #define HLC 0x7d /* high layer compatibility */
123 #define UUI 0x7e /* user user information */
124 #define ESC 0x7f /* escape extension */
126 #define DLC 0x20 /* data link layer configuration */
127 #define NLC 0x21 /* network layer configuration */
129 /* codeset 6 */
131 #define SIN 0x01 /* service indicator */
132 #define CIF 0x02 /* charging information */
133 #define DATE 0x03 /* date */
134 #define CPS 0x07 /* called party status */
136 /*------------------------------------------------------------------*/
137 /* return code coding */
138 /*------------------------------------------------------------------*/
140 #define UNKNOWN_COMMAND 0x01 /* unknown command */
141 #define WRONG_COMMAND 0x02 /* wrong command */
142 #define WRONG_ID 0x03 /* unknown task/entity id */
143 #define WRONG_CH 0x04 /* wrong task/entity id */
144 #define UNKNOWN_IE 0x05 /* unknown information el. */
145 #define WRONG_IE 0x06 /* wrong information el. */
146 #define OUT_OF_RESOURCES 0x07 /* card out of res. */
147 #define N_FLOW_CONTROL 0x10 /* Flow-Control, retry */
148 #define ASSIGN_RC 0xe0 /* ASSIGN acknowledgement */
149 #define ASSIGN_OK 0xef /* ASSIGN OK */
150 #define OK_FC 0xfc /* Flow-Control RC */
151 #define READY_INT 0xfd /* Ready interrupt */
152 #define TIMER_INT 0xfe /* timer interrupt */
153 #define OK 0xff /* command accepted */
155 /*------------------------------------------------------------------*/
157 typedef struct {
158 char cpn[32];
159 char oad[32];
160 char dsa[32];
161 char osa[32];
162 __u8 plan;
163 __u8 screen;
164 __u8 sin[4];
165 __u8 chi[4];
166 __u8 e_chi[4];
167 __u8 bc[12];
168 __u8 e_bc[12];
169 __u8 llc[18];
170 __u8 hlc[5];
171 __u8 cau[4];
172 __u8 e_cau[2];
173 __u8 e_mt;
174 __u8 dt[6];
175 char display[83];
176 char keypad[35];
177 char rdn[32];
178 } idi_ind_message;
180 typedef struct {
181 __u16 next __attribute__ ((packed));
182 __u8 Req __attribute__ ((packed));
183 __u8 ReqId __attribute__ ((packed));
184 __u8 ReqCh __attribute__ ((packed));
185 __u8 Reserved1 __attribute__ ((packed));
186 __u16 Reference __attribute__ ((packed));
187 __u8 Reserved[8] __attribute__ ((packed));
188 eicon_PBUFFER XBuffer;
189 } eicon_REQ;
191 typedef struct {
192 __u16 next __attribute__ ((packed));
193 __u8 Rc __attribute__ ((packed));
194 __u8 RcId __attribute__ ((packed));
195 __u8 RcCh __attribute__ ((packed));
196 __u8 Reserved1 __attribute__ ((packed));
197 __u16 Reference __attribute__ ((packed));
198 __u8 Reserved2[8] __attribute__ ((packed));
199 } eicon_RC;
201 typedef struct {
202 __u16 next __attribute__ ((packed));
203 __u8 Ind __attribute__ ((packed));
204 __u8 IndId __attribute__ ((packed));
205 __u8 IndCh __attribute__ ((packed));
206 __u8 MInd __attribute__ ((packed));
207 __u16 MLength __attribute__ ((packed));
208 __u16 Reference __attribute__ ((packed));
209 __u8 RNR __attribute__ ((packed));
210 __u8 Reserved __attribute__ ((packed));
211 __u32 Ack __attribute__ ((packed));
212 eicon_PBUFFER RBuffer;
213 } eicon_IND;
215 typedef struct {
216 __u16 NextReq __attribute__ ((packed)); /* pointer to next Req Buffer */
217 __u16 NextRc __attribute__ ((packed)); /* pointer to next Rc Buffer */
218 __u16 NextInd __attribute__ ((packed)); /* pointer to next Ind Buffer */
219 __u8 ReqInput __attribute__ ((packed)); /* number of Req Buffers sent */
220 __u8 ReqOutput __attribute__ ((packed)); /* number of Req Buffers returned */
221 __u8 ReqReserved __attribute__ ((packed));/*number of Req Buffers reserved */
222 __u8 Int __attribute__ ((packed)); /* ISDN-P interrupt */
223 __u8 XLock __attribute__ ((packed)); /* Lock field for arbitration */
224 __u8 RcOutput __attribute__ ((packed)); /* number of Rc buffers received */
225 __u8 IndOutput __attribute__ ((packed)); /* number of Ind buffers received */
226 __u8 IMask __attribute__ ((packed)); /* Interrupt Mask Flag */
227 __u8 Reserved1[2] __attribute__ ((packed)); /* reserved field, do not use */
228 __u8 ReadyInt __attribute__ ((packed)); /* request field for ready int */
229 __u8 Reserved2[12] __attribute__ ((packed)); /* reserved field, do not use */
230 __u8 InterfaceType __attribute__ ((packed)); /* interface type 1=16K */
231 __u16 Signature __attribute__ ((packed)); /* ISDN-P initialized ind */
232 __u8 B[1]; /* buffer space for Req,Ind and Rc */
233 } eicon_pr_ram;
236 extern int idi_do_req(eicon_card *card, eicon_chan *chan, int cmd, int layer);
237 extern int idi_hangup(eicon_card *card, eicon_chan *chan);
238 extern int idi_connect_res(eicon_card *card, eicon_chan *chan);
239 extern int eicon_idi_listen_req(eicon_card *card, eicon_chan *chan);
240 extern int idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone,
241 char *eazmsn, int si1, int si2);
243 extern void idi_handle_ack(eicon_card *card, struct sk_buff *skb);
244 extern void idi_handle_ind(eicon_card *card, struct sk_buff *skb);
245 extern int eicon_idi_manage(eicon_card *card, eicon_manifbuf *mb);
246 extern int idi_send_data(eicon_card *card, eicon_chan *chan, int ack, struct sk_buff *skb);
248 #endif