Import 2.3.28
[davej-history.git] / include / linux / isdnif.h
blob07e3b826df910b34e4345b51d8d97c3b20337099
1 /* $Id: isdnif.h,v 1.32 1999/10/11 22:03:00 keil Exp $
3 * Linux ISDN subsystem
5 * Definition of the interface between the subsystem and its low-level drivers.
7 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
8 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * $Log: isdnif.h,v $
25 * Revision 1.32 1999/10/11 22:03:00 keil
26 * COMPAT_NEED_UACCESS (no include in isdn_compat.h)
28 * Revision 1.31 1999/09/06 07:29:36 fritz
29 * Changed my mail-address.
31 * Revision 1.30 1999/08/23 15:54:29 keil
32 * more backported changes from kernel 2.3.14
34 * Revision 1.29 1999/07/31 13:00:02 armin
35 * Added tty fax capabilities.
37 * Revision 1.28 1999/07/13 20:57:48 werner
38 * added callback ISDN_STAT_DISCH for limiting b-channel resources.
40 * Revision 1.27 1999/07/11 17:07:39 armin
41 * Added tty modem register S23.
42 * Added new layer 2 and 3 protocols for Fax and DSP functions.
44 * Revision 1.26 1999/07/01 08:35:44 keil
45 * compatibility to 2.3
47 * Revision 1.25 1998/06/17 19:51:55 he
48 * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay())
49 * brute force fix to avoid Ugh's in isdn_tty_write()
50 * cleaned up some dead code
52 * Revision 1.24 1998/03/19 13:18:57 keil
53 * Start of a CAPI like interface for supplementary Service
54 * first service: SUSPEND
56 * Revision 1.23 1998/02/20 17:36:52 fritz
57 * Added L2-protocols for V.110, changed FEATURE-Flag-constants.
59 * Revision 1.22 1998/01/31 22:14:12 keil
60 * changes for 2.1.82
62 * Revision 1.21 1997/10/09 21:28:13 fritz
63 * New HL<->LL interface:
64 * New BSENT callback with nr. of bytes included.
65 * Sending without ACK.
66 * New L1 error status (not yet in use).
67 * Cleaned up obsolete structures.
68 * Implemented Cisco-SLARP.
69 * Changed local net-interface data to be dynamically allocated.
70 * Removed old 2.0 compatibility stuff.
72 * Revision 1.20 1997/05/27 15:18:06 fritz
73 * Added changes for recent 2.1.x kernels:
74 * changed return type of isdn_close
75 * queue_task_* -> queue_task
76 * clear/set_bit -> test_and_... where apropriate.
77 * changed type of hard_header_cache parameter.
79 * Revision 1.19 1997/03/25 23:13:56 keil
80 * NI-1 US protocol
82 * Revision 1.18 1997/03/04 22:09:18 calle
83 * Change macros copy_from_user and copy_to_user in inline function.
84 * These are now correct replacements of the functions for 2.1.xx
86 * Revision 1.17 1997/02/10 21:12:53 fritz
87 * More setup-interface changes.
89 * Revision 1.16 1997/02/10 19:42:57 fritz
90 * New interface for reporting incoming calls.
92 * Revision 1.15 1997/02/09 00:18:42 keil
93 * leased line support
95 * Revision 1.14 1997/02/03 23:43:00 fritz
96 * Misc changes for Kernel 2.1.X compatibility.
98 * Revision 1.13 1996/11/13 02:39:59 fritz
99 * More compatibility changes.
101 * Revision 1.12 1996/11/06 17:38:48 keil
102 * more changes for 2.1.X
104 * Revision 1.11 1996/10/23 11:59:42 fritz
105 * More compatibility changes.
107 * Revision 1.10 1996/10/22 23:14:19 fritz
108 * Changes for compatibility to 2.0.X and 2.1.X kernels.
110 * Revision 1.9 1996/06/06 21:24:24 fritz
111 * Started adding support for suspend/resume.
113 * Revision 1.8 1996/05/18 01:45:37 fritz
114 * More spelling corrections.
116 * Revision 1.7 1996/05/18 01:37:19 fritz
117 * Added spelling corrections and some minor changes
118 * to stay in sync with kernel.
120 * Revision 1.6 1996/05/17 03:59:28 fritz
121 * Marked rcvcallb and writebuf obsolete.
123 * Revision 1.5 1996/05/01 11:43:54 fritz
124 * Removed STANDALONE
126 * Revision 1.4 1996/05/01 11:38:40 fritz
127 * Added ISDN_FEATURE_L2_TRANS
129 * Revision 1.3 1996/04/29 22:57:54 fritz
130 * Added driverId and channel parameters to
131 * writecmd() and readstat().
132 * Added constant for voice-support.
134 * Revision 1.2 1996/04/20 17:02:40 fritz
135 * Changes to support skbuffs for Lowlevel-Drivers.
136 * Misc. typos
138 * Revision 1.1 1996/01/09 05:50:51 fritz
139 * Initial revision
143 #ifndef isdnif_h
144 #define isdnif_h
146 #include <linux/config.h>
149 * Values for general protocol-selection
151 #define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
152 #define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
153 #define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
154 #define ISDN_PTYPE_LEASED 3 /* for leased lines */
155 #define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
156 #define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
159 * Values for Layer-2-protocol-selection
161 #define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
162 #define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
163 #define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
164 #define ISDN_PROTO_L2_HDLC 3 /* HDLC */
165 #define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
166 #define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
167 #define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
168 #define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
169 #define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
170 #define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
171 #define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
172 #define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
173 #define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
176 * Values for Layer-3-protocol-selection
178 #define ISDN_PROTO_L3_TRANS 0 /* Transparent */
179 #define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
180 #define ISDN_PROTO_L3_FAX 2 /* Fax Group 2/3 */
181 #define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
183 #ifdef __KERNEL__
185 #include <linux/skbuff.h>
187 /***************************************************************************/
188 /* Extensions made by Werner Cornelius (werner@ikt.de) */
189 /* */
190 /* The proceed command holds a incoming call in a state to leave processes */
191 /* enough time to check whether ist should be accepted. */
192 /* The PROT_IO Command extends the interface to make protocol dependant */
193 /* features available (call diversion, call waiting...). */
194 /* */
195 /* The PROT_IO Command is executed with the desired driver id and the arg */
196 /* parameter coded as follows: */
197 /* The lower 8 bits of arg contain the desired protocol from ISDN_PTYPE */
198 /* definitions. The upper 24 bits represent the protocol specific cmd/stat.*/
199 /* Any additional data is protocol and command specific. */
200 /* This mechanism also applies to the statcallb callback STAT_PROT. */
201 /* */
202 /* This suggested extension permits an easy expansion of protocol specific */
203 /* handling. Extensions may be added at any time without changing the HL */
204 /* driver code and not getting conflicts without certifications. */
205 /* The well known CAPI 2.0 interface handles such extensions in a similar */
206 /* way. Perhaps a protocol specific module may be added and separately */
207 /* loaded and linked to the basic isdn module for handling. */
208 /***************************************************************************/
210 /*****************/
211 /* DSS1 commands */
212 /*****************/
213 #define DSS1_CMD_INVOKE ((0x00 << 8) | ISDN_PTYPE_EURO) /* invoke a supplementary service */
214 #define DSS1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_EURO) /* abort a invoke cmd */
216 /*******************************/
217 /* DSS1 Status callback values */
218 /*******************************/
219 #define DSS1_STAT_INVOKE_RES ((0x80 << 8) | ISDN_PTYPE_EURO) /* Result for invocation */
220 #define DSS1_STAT_INVOKE_ERR ((0x81 << 8) | ISDN_PTYPE_EURO) /* Error Return for invocation */
221 #define DSS1_STAT_INVOKE_BRD ((0x82 << 8) | ISDN_PTYPE_EURO) /* Deliver invoke broadcast info */
224 /*********************************************************************/
225 /* structures for DSS1 commands and callback */
226 /* */
227 /* An action is invoked by sending a DSS1_CMD_INVOKE. The ll_id, proc*/
228 /* timeout, datalen and data fields must be set before calling. */
229 /* */
230 /* The return value is a positive hl_id value also delivered in the */
231 /* hl_id field. A value of zero signals no more left hl_id capacitys.*/
232 /* A negative return value signals errors in LL. So if the return */
233 /* value is <= 0 no action in LL will be taken -> request ignored */
234 /* */
235 /* The timeout field must be filled with a positive value specifying */
236 /* the amount of time the INVOKED process waits for a reaction from */
237 /* the network. */
238 /* If a response (either error or result) is received during this */
239 /* intervall, a reporting callback is initiated and the process will */
240 /* be deleted, the hl identifier will be freed. */
241 /* If no response is received during the specified intervall, a error*/
242 /* callback is initiated with timeout set to -1 and a datalen set */
243 /* to 0. */
244 /* If timeout is set to a value <= 0 during INVOCATION the process is*/
245 /* immediately deleted after sending the data. No callback occurs ! */
246 /* */
247 /* A currently waiting process may be aborted with INVOKE_ABORT. No */
248 /* callback will occur when a process has been aborted. */
249 /* */
250 /* Broadcast invoke frames from the network are reported via the */
251 /* STAT_INVOKE_BRD callback. The ll_id is set to 0, the other fields */
252 /* are supplied by the network and not by the HL. */
253 /*********************************************************************/
254 typedef struct
255 { ulong ll_id; /* ID supplied by LL when executing */
256 /* a command and returned by HL for */
257 /* INVOKE_RES and INVOKE_ERR */
258 int hl_id; /* ID supplied by HL when called */
259 /* for executing a cmd and delivered */
260 /* for results and errors */
261 /* must be supplied by LL when aborting*/
262 int proc; /* invoke procedure used by CMD_INVOKE */
263 /* returned by callback and broadcast */
264 int timeout; /* timeout for INVOKE CMD in ms */
265 /* -1 in stat callback when timed out */
266 /* error value when error callback */
267 int datalen; /* length of cmd or stat data */
268 u_char *data;/* pointer to data delivered or send */
269 } dss1_cmd_stat;
272 * Commands from linklevel to lowlevel
275 #define ISDN_CMD_IOCTL 0 /* Perform ioctl */
276 #define ISDN_CMD_DIAL 1 /* Dial out */
277 #define ISDN_CMD_ACCEPTD 2 /* Accept an incoming call on D-Chan. */
278 #define ISDN_CMD_ACCEPTB 3 /* Request B-Channel connect. */
279 #define ISDN_CMD_HANGUP 4 /* Hangup */
280 #define ISDN_CMD_CLREAZ 5 /* Clear EAZ(s) of channel */
281 #define ISDN_CMD_SETEAZ 6 /* Set EAZ(s) of channel */
282 #define ISDN_CMD_GETEAZ 7 /* Get EAZ(s) of channel */
283 #define ISDN_CMD_SETSIL 8 /* Set Service-Indicator-List of channel */
284 #define ISDN_CMD_GETSIL 9 /* Get Service-Indicator-List of channel */
285 #define ISDN_CMD_SETL2 10 /* Set B-Chan. Layer2-Parameter */
286 #define ISDN_CMD_GETL2 11 /* Get B-Chan. Layer2-Parameter */
287 #define ISDN_CMD_SETL3 12 /* Set B-Chan. Layer3-Parameter */
288 #define ISDN_CMD_GETL3 13 /* Get B-Chan. Layer3-Parameter */
289 #define ISDN_CMD_LOCK 14 /* Signal usage by upper levels */
290 #define ISDN_CMD_UNLOCK 15 /* Release usage-lock */
291 #define ISDN_CMD_SUSPEND 16 /* Suspend connection */
292 #define ISDN_CMD_RESUME 17 /* Resume connection */
293 #define ISDN_CMD_PROCEED 18 /* Proceed with call establishment */
294 #define ISDN_CMD_ALERT 19 /* Alert after Proceeding */
295 #define ISDN_CMD_REDIR 20 /* Redir a incoming call */
296 #define ISDN_CMD_PROT_IO 21 /* Protocol specific commands */
297 #define CAPI_PUT_MESSAGE 22 /* CAPI message send down or up */
298 #define ISDN_CMD_FAXCMD 23 /* FAX commands to HL-driver */
299 #define ISDN_CMD_AUDIO 24 /* DSP, DTMF, ... settings */
302 * Status-Values delivered from lowlevel to linklevel via
303 * statcallb().
306 #define ISDN_STAT_STAVAIL 256 /* Raw status-data available */
307 #define ISDN_STAT_ICALL 257 /* Incoming call detected */
308 #define ISDN_STAT_RUN 258 /* Signal protocol-code is running */
309 #define ISDN_STAT_STOP 259 /* Signal halt of protocol-code */
310 #define ISDN_STAT_DCONN 260 /* Signal D-Channel connect */
311 #define ISDN_STAT_BCONN 261 /* Signal B-Channel connect */
312 #define ISDN_STAT_DHUP 262 /* Signal D-Channel disconnect */
313 #define ISDN_STAT_BHUP 263 /* Signal B-Channel disconnect */
314 #define ISDN_STAT_CINF 264 /* Charge-Info */
315 #define ISDN_STAT_LOAD 265 /* Signal new lowlevel-driver is loaded */
316 #define ISDN_STAT_UNLOAD 266 /* Signal unload of lowlevel-driver */
317 #define ISDN_STAT_BSENT 267 /* Signal packet sent */
318 #define ISDN_STAT_NODCH 268 /* Signal no D-Channel */
319 #define ISDN_STAT_ADDCH 269 /* Add more Channels */
320 #define ISDN_STAT_CAUSE 270 /* Cause-Message */
321 #define ISDN_STAT_ICALLW 271 /* Incoming call without B-chan waiting */
322 #define ISDN_STAT_REDIR 272 /* Redir result */
323 #define ISDN_STAT_PROT 273 /* protocol IO specific callback */
324 #define ISDN_STAT_DISPLAY 274 /* deliver a received display message */
325 #define ISDN_STAT_L1ERR 275 /* Signal Layer-1 Error */
326 #define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
327 #define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
328 #define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
331 * Audio commands
333 #define ISDN_AUDIO_SETDD 0 /* Set DTMF detection */
334 #define ISDN_AUDIO_DTMF 1 /* Rx/Tx DTMF */
337 * Values for errcode field
339 #define ISDN_STAT_L1ERR_SEND 1
340 #define ISDN_STAT_L1ERR_RECV 2
343 * Values for feature-field of interface-struct.
345 /* Layer 2 */
346 #define ISDN_FEATURE_L2_X75I (0x0001 << ISDN_PROTO_L2_X75I)
347 #define ISDN_FEATURE_L2_X75UI (0x0001 << ISDN_PROTO_L2_X75UI)
348 #define ISDN_FEATURE_L2_X75BUI (0x0001 << ISDN_PROTO_L2_X75BUI)
349 #define ISDN_FEATURE_L2_HDLC (0x0001 << ISDN_PROTO_L2_HDLC)
350 #define ISDN_FEATURE_L2_TRANS (0x0001 << ISDN_PROTO_L2_TRANS)
351 #define ISDN_FEATURE_L2_X25DTE (0x0001 << ISDN_PROTO_L2_X25DTE)
352 #define ISDN_FEATURE_L2_X25DCE (0x0001 << ISDN_PROTO_L2_X25DCE)
353 #define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096)
354 #define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019)
355 #define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038)
356 #define ISDN_FEATURE_L2_MODEM (0x0001 << ISDN_PROTO_L2_MODEM)
357 #define ISDN_FEATURE_L2_FAX (0x0001 << ISDN_PROTO_L2_FAX)
359 #define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */
360 #define ISDN_FEATURE_L2_SHIFT (0)
362 /* Layer 3 */
363 #define ISDN_FEATURE_L3_TRANS (0x10000 << ISDN_PROTO_L3_TRANS)
364 #define ISDN_FEATURE_L3_TRANSDSP (0x10000 << ISDN_PROTO_L3_TRANSDSP)
365 #define ISDN_FEATURE_L3_FAX (0x10000 << ISDN_PROTO_L3_FAX)
367 #define ISDN_FEATURE_L3_MASK (0x0FF0000) /* Max. 8 Protocols */
368 #define ISDN_FEATURE_L3_SHIFT (16)
370 /* Signaling */
371 #define ISDN_FEATURE_P_UNKNOWN (0x1000000 << ISDN_PTYPE_UNKNOWN)
372 #define ISDN_FEATURE_P_1TR6 (0x1000000 << ISDN_PTYPE_1TR6)
373 #define ISDN_FEATURE_P_EURO (0x1000000 << ISDN_PTYPE_EURO)
374 #define ISDN_FEATURE_P_NI1 (0x1000000 << ISDN_PTYPE_NI1)
376 #define ISDN_FEATURE_P_MASK (0x0FF000000) /* Max. 8 Protocols */
377 #define ISDN_FEATURE_P_SHIFT (24)
379 typedef struct setup_parm {
380 unsigned char phone[32]; /* Remote Phone-Number */
381 unsigned char eazmsn[32]; /* Local EAZ or MSN */
382 unsigned char si1; /* Service Indicator 1 */
383 unsigned char si2; /* Service Indicator 2 */
384 unsigned char plan; /* Numbering plan */
385 unsigned char screen; /* Screening info */
386 } setup_parm;
389 #ifdef CONFIG_ISDN_TTY_FAX
390 /* T.30 Fax G3 */
392 #define FAXIDLEN 21
394 typedef struct T30_s {
395 /* session parameters */
396 __u8 resolution __attribute__ ((packed));
397 __u8 rate __attribute__ ((packed));
398 __u8 width __attribute__ ((packed));
399 __u8 length __attribute__ ((packed));
400 __u8 compression __attribute__ ((packed));
401 __u8 ecm __attribute__ ((packed));
402 __u8 binary __attribute__ ((packed));
403 __u8 scantime __attribute__ ((packed));
404 __u8 id[FAXIDLEN] __attribute__ ((packed));
405 /* additional parameters */
406 __u8 phase __attribute__ ((packed));
407 __u8 direction __attribute__ ((packed));
408 __u8 code __attribute__ ((packed));
409 __u8 badlin __attribute__ ((packed));
410 __u8 badmul __attribute__ ((packed));
411 __u8 bor __attribute__ ((packed));
412 __u8 fet __attribute__ ((packed));
413 __u8 pollid[FAXIDLEN] __attribute__ ((packed));
414 __u8 cq __attribute__ ((packed));
415 __u8 cr __attribute__ ((packed));
416 __u8 ctcrty __attribute__ ((packed));
417 __u8 minsp __attribute__ ((packed));
418 __u8 phcto __attribute__ ((packed));
419 __u8 rel __attribute__ ((packed));
420 __u8 nbc __attribute__ ((packed));
421 /* remote station parameters */
422 __u8 r_resolution __attribute__ ((packed));
423 __u8 r_rate __attribute__ ((packed));
424 __u8 r_width __attribute__ ((packed));
425 __u8 r_length __attribute__ ((packed));
426 __u8 r_compression __attribute__ ((packed));
427 __u8 r_ecm __attribute__ ((packed));
428 __u8 r_binary __attribute__ ((packed));
429 __u8 r_scantime __attribute__ ((packed));
430 __u8 r_id[FAXIDLEN] __attribute__ ((packed));
431 __u8 r_code __attribute__ ((packed));
432 } T30_s;
434 #define ISDN_TTY_FAX_CONN_IN 0
435 #define ISDN_TTY_FAX_CONN_OUT 1
437 #define ISDN_TTY_FAX_FCON 0
438 #define ISDN_TTY_FAX_DIS 1
439 #define ISDN_TTY_FAX_FTT 2
440 #define ISDN_TTY_FAX_MCF 3
441 #define ISDN_TTY_FAX_DCS 4
442 #define ISDN_TTY_FAX_TRAIN_OK 5
443 #define ISDN_TTY_FAX_EOP 6
444 #define ISDN_TTY_FAX_EOM 7
445 #define ISDN_TTY_FAX_MPS 8
446 #define ISDN_TTY_FAX_DTC 9
447 #define ISDN_TTY_FAX_RID 10
448 #define ISDN_TTY_FAX_HNG 11
449 #define ISDN_TTY_FAX_DT 12
450 #define ISDN_TTY_FAX_FCON_I 13
451 #define ISDN_TTY_FAX_DR 14
452 #define ISDN_TTY_FAX_ET 15
453 #define ISDN_TTY_FAX_CFR 16
454 #define ISDN_TTY_FAX_PTS 17
455 #define ISDN_TTY_FAX_SENT 18
457 #define ISDN_FAX_PHASE_IDLE 0
458 #define ISDN_FAX_PHASE_A 1
459 #define ISDN_FAX_PHASE_B 2
460 #define ISDN_FAX_PHASE_C 3
461 #define ISDN_FAX_PHASE_D 4
462 #define ISDN_FAX_PHASE_E 5
464 #endif /* TTY_FAX */
466 /* CAPI structs */
468 /* this is compatible to the old union size */
469 #define MAX_CAPI_PARA_LEN 50
471 typedef struct {
472 /* Header */
473 __u16 Length;
474 __u16 ApplId;
475 __u8 Command;
476 __u8 Subcommand;
477 __u16 Messagenumber;
479 /* Parameter */
480 union {
481 __u32 Controller;
482 __u32 PLCI;
483 __u32 NCCI;
484 } adr;
485 __u8 para[MAX_CAPI_PARA_LEN];
486 } capi_msg;
489 * Structure for exchanging above infos
492 typedef struct {
493 int driver; /* Lowlevel-Driver-ID */
494 int command; /* Command or Status (see above) */
495 ulong arg; /* Additional Data */
496 union {
497 ulong errcode; /* Type of error with STAT_L1ERR */
498 int length; /* Amount of bytes sent with STAT_BSENT */
499 u_char num[50];/* Additional Data */
500 setup_parm setup;/* For SETUP msg */
501 capi_msg cmsg; /* For CAPI like messages */
502 char display[85];/* display message data */
503 dss1_cmd_stat dss1_io; /* DSS1 IO-parameter/result */
504 #ifdef CONFIG_ISDN_TTY_FAX
505 T30_s *fax; /* Pointer to ttys fax struct */
506 #endif
507 } parm;
508 } isdn_ctrl;
511 * The interface-struct itself (initialized at load-time of lowlevel-driver)
513 * See Documentation/isdn/INTERFACE for a description, how the communication
514 * between the ISDN subsystem and its drivers is done.
517 typedef struct {
518 /* Number of channels supported by this driver
520 int channels;
523 * Maximum Size of transmit/receive-buffer this driver supports.
525 int maxbufsize;
527 /* Feature-Flags for this driver.
528 * See defines ISDN_FEATURE_... for Values
530 unsigned long features;
533 * Needed for calculating
534 * dev->hard_header_len = linklayer header + hl_hdrlen;
535 * Drivers, not supporting sk_buff's should set this to 0.
537 unsigned short hl_hdrlen;
540 * Receive-Callback using sk_buff's
541 * Parameters:
542 * int Driver-ID
543 * int local channel-number (0 ...)
544 * struct sk_buff *skb received Data
546 void (*rcvcallb_skb)(int, int, struct sk_buff *);
548 /* Status-Callback
549 * Parameters:
550 * isdn_ctrl*
551 * driver = Driver ID.
552 * command = One of above ISDN_STAT_... constants.
553 * arg = depending on status-type.
554 * num = depending on status-type.
556 int (*statcallb)(isdn_ctrl*);
558 /* Send command
559 * Parameters:
560 * isdn_ctrl*
561 * driver = Driver ID.
562 * command = One of above ISDN_CMD_... constants.
563 * arg = depending on command.
564 * num = depending on command.
566 int (*command)(isdn_ctrl*);
569 * Send data using sk_buff's
570 * Parameters:
571 * int driverId
572 * int local channel-number (0...)
573 * int Flag: Need ACK for this packet.
574 * struct sk_buff *skb Data to send
576 int (*writebuf_skb) (int, int, int, struct sk_buff *);
578 /* Send raw D-Channel-Commands
579 * Parameters:
580 * u_char pointer data
581 * int length of data
582 * int Flag: 0 = Call form Kernel-Space (use memcpy,
583 * no schedule allowed)
584 * 1 = Data is in User-Space (use memcpy_fromfs,
585 * may schedule)
586 * int driverId
587 * int local channel-number (0 ...)
589 int (*writecmd)(const u_char*, int, int, int, int);
591 /* Read raw Status replies
592 * u_char pointer data (volatile)
593 * int length of buffer
594 * int Flag: 0 = Call form Kernel-Space (use memcpy,
595 * no schedule allowed)
596 * 1 = Data is in User-Space (use memcpy_fromfs,
597 * may schedule)
598 * int driverId
599 * int local channel-number (0 ...)
601 int (*readstat)(u_char*, int, int, int, int);
603 char id[20];
604 } isdn_if;
607 * Function which must be called by lowlevel-driver at loadtime with
608 * the following fields of above struct set:
610 * channels Number of channels that will be supported.
611 * hl_hdrlen Space to preserve in sk_buff's when sending. Drivers, not
612 * supporting sk_buff's should set this to 0.
613 * command Address of Command-Handler.
614 * features Bitwise coded Features of this driver. (use ISDN_FEATURE_...)
615 * writebuf_skb Address of Skbuff-Send-Handler.
616 * writecmd " " D-Channel " which accepts raw D-Ch-Commands.
617 * readstat " " D-Channel " which delivers raw Status-Data.
619 * The linklevel-driver fills the following fields:
621 * channels Driver-ID assigned to this driver. (Must be used on all
622 * subsequent callbacks.
623 * rcvcallb_skb Address of handler for received Skbuff's.
624 * statcallb " " " for status-changes.
627 extern int register_isdn(isdn_if*);
628 #include <asm/uaccess.h>
630 #endif /* __KERNEL__ */
631 #endif /* isdnif_h */