| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $ | 
|  | 2 | * | 
|  | 3 | * Linux ISDN subsystem | 
|  | 4 | * Definition of the interface between the subsystem and its low-level drivers. | 
|  | 5 | * | 
|  | 6 | * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) | 
|  | 7 | * Copyright 1995,96    Thinking Objects Software GmbH Wuerzburg | 
|  | 8 | * | 
|  | 9 | * This software may be used and distributed according to the terms | 
|  | 10 | * of the GNU General Public License, incorporated herein by reference. | 
|  | 11 | * | 
|  | 12 | */ | 
|  | 13 |  | 
|  | 14 | #ifndef __ISDNIF_H__ | 
|  | 15 | #define __ISDNIF_H__ | 
|  | 16 |  | 
|  | 17 |  | 
|  | 18 | /* | 
|  | 19 | * Values for general protocol-selection | 
|  | 20 | */ | 
|  | 21 | #define ISDN_PTYPE_UNKNOWN   0   /* Protocol undefined   */ | 
|  | 22 | #define ISDN_PTYPE_1TR6      1   /* german 1TR6-protocol */ | 
|  | 23 | #define ISDN_PTYPE_EURO      2   /* EDSS1-protocol       */ | 
|  | 24 | #define ISDN_PTYPE_LEASED    3   /* for leased lines     */ | 
|  | 25 | #define ISDN_PTYPE_NI1       4   /* US NI-1 protocol     */ | 
|  | 26 | #define ISDN_PTYPE_MAX       7   /* Max. 8 Protocols     */ | 
|  | 27 |  | 
|  | 28 | /* | 
|  | 29 | * Values for Layer-2-protocol-selection | 
|  | 30 | */ | 
|  | 31 | #define ISDN_PROTO_L2_X75I   0   /* X75/LAPB with I-Frames            */ | 
|  | 32 | #define ISDN_PROTO_L2_X75UI  1   /* X75/LAPB with UI-Frames           */ | 
|  | 33 | #define ISDN_PROTO_L2_X75BUI 2   /* X75/LAPB with UI-Frames           */ | 
|  | 34 | #define ISDN_PROTO_L2_HDLC   3   /* HDLC                              */ | 
|  | 35 | #define ISDN_PROTO_L2_TRANS  4   /* Transparent (Voice)               */ | 
|  | 36 | #define ISDN_PROTO_L2_X25DTE 5   /* X25/LAPB DTE mode                 */ | 
|  | 37 | #define ISDN_PROTO_L2_X25DCE 6   /* X25/LAPB DCE mode                 */ | 
|  | 38 | #define ISDN_PROTO_L2_V11096 7   /* V.110 bitrate adaption 9600 Baud  */ | 
|  | 39 | #define ISDN_PROTO_L2_V11019 8   /* V.110 bitrate adaption 19200 Baud */ | 
|  | 40 | #define ISDN_PROTO_L2_V11038 9   /* V.110 bitrate adaption 38400 Baud */ | 
|  | 41 | #define ISDN_PROTO_L2_MODEM  10  /* Analog Modem on Board */ | 
|  | 42 | #define ISDN_PROTO_L2_FAX    11  /* Fax Group 2/3         */ | 
|  | 43 | #define ISDN_PROTO_L2_HDLC_56K 12   /* HDLC 56k                          */ | 
|  | 44 | #define ISDN_PROTO_L2_MAX    15  /* Max. 16 Protocols                 */ | 
|  | 45 |  | 
|  | 46 | /* | 
|  | 47 | * Values for Layer-3-protocol-selection | 
|  | 48 | */ | 
|  | 49 | #define ISDN_PROTO_L3_TRANS	0	/* Transparent */ | 
|  | 50 | #define ISDN_PROTO_L3_TRANSDSP	1	/* Transparent with DSP */ | 
|  | 51 | #define ISDN_PROTO_L3_FCLASS2	2	/* Fax Group 2/3 CLASS 2 */ | 
|  | 52 | #define ISDN_PROTO_L3_FCLASS1	3	/* Fax Group 2/3 CLASS 1 */ | 
|  | 53 | #define ISDN_PROTO_L3_MAX	7	/* Max. 8 Protocols */ | 
|  | 54 |  | 
|  | 55 | #ifdef __KERNEL__ | 
|  | 56 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | #include <linux/skbuff.h> | 
|  | 58 |  | 
|  | 59 | /***************************************************************************/ | 
|  | 60 | /* Extensions made by Werner Cornelius (werner@ikt.de)                     */ | 
|  | 61 | /*                                                                         */ | 
|  | 62 | /* The proceed command holds a incoming call in a state to leave processes */ | 
|  | 63 | /* enough time to check whether ist should be accepted.                    */ | 
|  | 64 | /* The PROT_IO Command extends the interface to make protocol dependent    */ | 
|  | 65 | /* features available (call diversion, call waiting...).                   */ | 
|  | 66 | /*                                                                         */ | 
|  | 67 | /* The PROT_IO Command is executed with the desired driver id and the arg  */ | 
|  | 68 | /* parameter coded as follows:                                             */ | 
|  | 69 | /* The lower 8 bits of arg contain the desired protocol from ISDN_PTYPE    */ | 
|  | 70 | /* definitions. The upper 24 bits represent the protocol specific cmd/stat.*/ | 
|  | 71 | /* Any additional data is protocol and command specific.                   */ | 
|  | 72 | /* This mechanism also applies to the statcallb callback STAT_PROT.        */ | 
|  | 73 | /*                                                                         */ | 
|  | 74 | /* This suggested extension permits an easy expansion of protocol specific */ | 
|  | 75 | /* handling. Extensions may be added at any time without changing the HL   */ | 
|  | 76 | /* driver code and not getting conflicts without certifications.           */ | 
|  | 77 | /* The well known CAPI 2.0 interface handles such extensions in a similar  */ | 
|  | 78 | /* way. Perhaps a protocol specific module may be added and separately     */ | 
|  | 79 | /* loaded and linked to the basic isdn module for handling.                */ | 
|  | 80 | /***************************************************************************/ | 
|  | 81 |  | 
|  | 82 | /*****************/ | 
|  | 83 | /* DSS1 commands */ | 
|  | 84 | /*****************/ | 
|  | 85 | #define DSS1_CMD_INVOKE       ((0x00 << 8) | ISDN_PTYPE_EURO)   /* invoke a supplementary service */ | 
|  | 86 | #define DSS1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_EURO)   /* abort a invoke cmd */ | 
|  | 87 |  | 
|  | 88 | /*******************************/ | 
|  | 89 | /* DSS1 Status callback values */ | 
|  | 90 | /*******************************/ | 
|  | 91 | #define DSS1_STAT_INVOKE_RES  ((0x80 << 8) | ISDN_PTYPE_EURO)   /* Result for invocation */ | 
|  | 92 | #define DSS1_STAT_INVOKE_ERR  ((0x81 << 8) | ISDN_PTYPE_EURO)   /* Error Return for invocation */ | 
|  | 93 | #define DSS1_STAT_INVOKE_BRD  ((0x82 << 8) | ISDN_PTYPE_EURO)   /* Deliver invoke broadcast info */ | 
|  | 94 |  | 
|  | 95 |  | 
|  | 96 | /*********************************************************************/ | 
|  | 97 | /* structures for DSS1 commands and callback                         */ | 
|  | 98 | /*                                                                   */ | 
|  | 99 | /* An action is invoked by sending a DSS1_CMD_INVOKE. The ll_id, proc*/ | 
|  | 100 | /* timeout, datalen and data fields must be set before calling.      */ | 
|  | 101 | /*                                                                   */ | 
|  | 102 | /* The return value is a positive hl_id value also delivered in the  */ | 
|  | 103 | /* hl_id field. A value of zero signals no more left hl_id capacitys.*/ | 
|  | 104 | /* A negative return value signals errors in LL. So if the return    */ | 
|  | 105 | /* value is <= 0 no action in LL will be taken -> request ignored    */ | 
|  | 106 | /*                                                                   */ | 
|  | 107 | /* The timeout field must be filled with a positive value specifying */ | 
|  | 108 | /* the amount of time the INVOKED process waits for a reaction from  */ | 
|  | 109 | /* the network.                                                      */ | 
|  | 110 | /* If a response (either error or result) is received during this    */ | 
|  | 111 | /* intervall, a reporting callback is initiated and the process will */ | 
|  | 112 | /* be deleted, the hl identifier will be freed.                      */ | 
|  | 113 | /* If no response is received during the specified intervall, a error*/ | 
|  | 114 | /* callback is initiated with timeout set to -1 and a datalen set    */ | 
|  | 115 | /* to 0.                                                             */ | 
|  | 116 | /* If timeout is set to a value <= 0 during INVOCATION the process is*/ | 
|  | 117 | /* immediately deleted after sending the data. No callback occurs !  */ | 
|  | 118 | /*                                                                   */ | 
|  | 119 | /* A currently waiting process may be aborted with INVOKE_ABORT. No  */ | 
|  | 120 | /* callback will occur when a process has been aborted.              */ | 
|  | 121 | /*                                                                   */ | 
|  | 122 | /* Broadcast invoke frames from the network are reported via the     */ | 
|  | 123 | /* STAT_INVOKE_BRD callback. The ll_id is set to 0, the other fields */ | 
|  | 124 | /* are supplied by the network and not by the HL.                    */ | 
|  | 125 | /*********************************************************************/ | 
|  | 126 |  | 
|  | 127 | /*****************/ | 
|  | 128 | /* NI1 commands */ | 
|  | 129 | /*****************/ | 
|  | 130 | #define NI1_CMD_INVOKE       ((0x00 << 8) | ISDN_PTYPE_NI1)   /* invoke a supplementary service */ | 
|  | 131 | #define NI1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_NI1)   /* abort a invoke cmd */ | 
|  | 132 |  | 
|  | 133 | /*******************************/ | 
|  | 134 | /* NI1 Status callback values */ | 
|  | 135 | /*******************************/ | 
|  | 136 | #define NI1_STAT_INVOKE_RES  ((0x80 << 8) | ISDN_PTYPE_NI1)   /* Result for invocation */ | 
|  | 137 | #define NI1_STAT_INVOKE_ERR  ((0x81 << 8) | ISDN_PTYPE_NI1)   /* Error Return for invocation */ | 
|  | 138 | #define NI1_STAT_INVOKE_BRD  ((0x82 << 8) | ISDN_PTYPE_NI1)   /* Deliver invoke broadcast info */ | 
|  | 139 |  | 
|  | 140 | typedef struct | 
|  | 141 | { ulong ll_id; /* ID supplied by LL when executing    */ | 
|  | 142 | /* a command and returned by HL for    */ | 
|  | 143 | /* INVOKE_RES and INVOKE_ERR           */ | 
|  | 144 | int hl_id;   /* ID supplied by HL when called       */ | 
|  | 145 | /* for executing a cmd and delivered   */ | 
|  | 146 | /* for results and errors              */ | 
|  | 147 | /* must be supplied by LL when aborting*/ | 
|  | 148 | int proc;    /* invoke procedure used by CMD_INVOKE */ | 
|  | 149 | /* returned by callback and broadcast  */ | 
|  | 150 | int timeout; /* timeout for INVOKE CMD in ms        */ | 
|  | 151 | /* -1  in stat callback when timed out */ | 
|  | 152 | /* error value when error callback     */ | 
|  | 153 | int datalen; /* length of cmd or stat data          */ | 
|  | 154 | u_char *data;/* pointer to data delivered or send   */ | 
|  | 155 | } isdn_cmd_stat; | 
|  | 156 |  | 
|  | 157 | /* | 
|  | 158 | * Commands from linklevel to lowlevel | 
|  | 159 | * | 
|  | 160 | */ | 
|  | 161 | #define ISDN_CMD_IOCTL    0       /* Perform ioctl                         */ | 
|  | 162 | #define ISDN_CMD_DIAL     1       /* Dial out                              */ | 
|  | 163 | #define ISDN_CMD_ACCEPTD  2       /* Accept an incoming call on D-Chan.    */ | 
|  | 164 | #define ISDN_CMD_ACCEPTB  3       /* Request B-Channel connect.            */ | 
|  | 165 | #define ISDN_CMD_HANGUP   4       /* Hangup                                */ | 
|  | 166 | #define ISDN_CMD_CLREAZ   5       /* Clear EAZ(s) of channel               */ | 
|  | 167 | #define ISDN_CMD_SETEAZ   6       /* Set EAZ(s) of channel                 */ | 
|  | 168 | #define ISDN_CMD_GETEAZ   7       /* Get EAZ(s) of channel                 */ | 
|  | 169 | #define ISDN_CMD_SETSIL   8       /* Set Service-Indicator-List of channel */ | 
|  | 170 | #define ISDN_CMD_GETSIL   9       /* Get Service-Indicator-List of channel */ | 
|  | 171 | #define ISDN_CMD_SETL2   10       /* Set B-Chan. Layer2-Parameter          */ | 
|  | 172 | #define ISDN_CMD_GETL2   11       /* Get B-Chan. Layer2-Parameter          */ | 
|  | 173 | #define ISDN_CMD_SETL3   12       /* Set B-Chan. Layer3-Parameter          */ | 
|  | 174 | #define ISDN_CMD_GETL3   13       /* Get B-Chan. Layer3-Parameter          */ | 
|  | 175 | // #define ISDN_CMD_LOCK    14       /* Signal usage by upper levels          */ | 
|  | 176 | // #define ISDN_CMD_UNLOCK  15       /* Release usage-lock                    */ | 
|  | 177 | #define ISDN_CMD_SUSPEND 16       /* Suspend connection                    */ | 
|  | 178 | #define ISDN_CMD_RESUME  17       /* Resume connection                     */ | 
|  | 179 | #define ISDN_CMD_PROCEED 18       /* Proceed with call establishment       */ | 
|  | 180 | #define ISDN_CMD_ALERT   19       /* Alert after Proceeding                */ | 
|  | 181 | #define ISDN_CMD_REDIR   20       /* Redir a incoming call                 */ | 
|  | 182 | #define ISDN_CMD_PROT_IO 21       /* Protocol specific commands            */ | 
|  | 183 | #define CAPI_PUT_MESSAGE 22       /* CAPI message send down or up          */ | 
|  | 184 | #define ISDN_CMD_FAXCMD  23       /* FAX commands to HL-driver             */ | 
|  | 185 | #define ISDN_CMD_AUDIO   24       /* DSP, DTMF, ... settings               */ | 
|  | 186 |  | 
|  | 187 | /* | 
|  | 188 | * Status-Values delivered from lowlevel to linklevel via | 
|  | 189 | * statcallb(). | 
|  | 190 | * | 
|  | 191 | */ | 
|  | 192 | #define ISDN_STAT_STAVAIL 256    /* Raw status-data available             */ | 
|  | 193 | #define ISDN_STAT_ICALL   257    /* Incoming call detected                */ | 
|  | 194 | #define ISDN_STAT_RUN     258    /* Signal protocol-code is running       */ | 
|  | 195 | #define ISDN_STAT_STOP    259    /* Signal halt of protocol-code          */ | 
|  | 196 | #define ISDN_STAT_DCONN   260    /* Signal D-Channel connect              */ | 
|  | 197 | #define ISDN_STAT_BCONN   261    /* Signal B-Channel connect              */ | 
|  | 198 | #define ISDN_STAT_DHUP    262    /* Signal D-Channel disconnect           */ | 
|  | 199 | #define ISDN_STAT_BHUP    263    /* Signal B-Channel disconnect           */ | 
|  | 200 | #define ISDN_STAT_CINF    264    /* Charge-Info                           */ | 
|  | 201 | #define ISDN_STAT_LOAD    265    /* Signal new lowlevel-driver is loaded  */ | 
|  | 202 | #define ISDN_STAT_UNLOAD  266    /* Signal unload of lowlevel-driver      */ | 
|  | 203 | #define ISDN_STAT_BSENT   267    /* Signal packet sent                    */ | 
|  | 204 | #define ISDN_STAT_NODCH   268    /* Signal no D-Channel                   */ | 
|  | 205 | #define ISDN_STAT_ADDCH   269    /* Add more Channels                     */ | 
|  | 206 | #define ISDN_STAT_CAUSE   270    /* Cause-Message                         */ | 
|  | 207 | #define ISDN_STAT_ICALLW  271    /* Incoming call without B-chan waiting  */ | 
|  | 208 | #define ISDN_STAT_REDIR   272    /* Redir result                          */ | 
|  | 209 | #define ISDN_STAT_PROT    273    /* protocol IO specific callback         */ | 
|  | 210 | #define ISDN_STAT_DISPLAY 274    /* deliver a received display message    */ | 
|  | 211 | #define ISDN_STAT_L1ERR   275    /* Signal Layer-1 Error                  */ | 
|  | 212 | #define ISDN_STAT_FAXIND  276    /* FAX indications from HL-driver        */ | 
|  | 213 | #define ISDN_STAT_AUDIO   277    /* DTMF, DSP indications                 */ | 
|  | 214 | #define ISDN_STAT_DISCH   278    /* Disable/Enable channel usage          */ | 
|  | 215 |  | 
|  | 216 | /* | 
|  | 217 | * Audio commands | 
|  | 218 | */ | 
|  | 219 | #define ISDN_AUDIO_SETDD	0	/* Set DTMF detection           */ | 
|  | 220 | #define ISDN_AUDIO_DTMF		1	/* Rx/Tx DTMF                   */ | 
|  | 221 |  | 
|  | 222 | /* | 
|  | 223 | * Values for errcode field | 
|  | 224 | */ | 
|  | 225 | #define ISDN_STAT_L1ERR_SEND 1 | 
|  | 226 | #define ISDN_STAT_L1ERR_RECV 2 | 
|  | 227 |  | 
|  | 228 | /* | 
|  | 229 | * Values for feature-field of interface-struct. | 
|  | 230 | */ | 
|  | 231 | /* Layer 2 */ | 
|  | 232 | #define ISDN_FEATURE_L2_X75I    (0x0001 << ISDN_PROTO_L2_X75I) | 
|  | 233 | #define ISDN_FEATURE_L2_X75UI   (0x0001 << ISDN_PROTO_L2_X75UI) | 
|  | 234 | #define ISDN_FEATURE_L2_X75BUI  (0x0001 << ISDN_PROTO_L2_X75BUI) | 
|  | 235 | #define ISDN_FEATURE_L2_HDLC    (0x0001 << ISDN_PROTO_L2_HDLC) | 
|  | 236 | #define ISDN_FEATURE_L2_TRANS   (0x0001 << ISDN_PROTO_L2_TRANS) | 
|  | 237 | #define ISDN_FEATURE_L2_X25DTE  (0x0001 << ISDN_PROTO_L2_X25DTE) | 
|  | 238 | #define ISDN_FEATURE_L2_X25DCE  (0x0001 << ISDN_PROTO_L2_X25DCE) | 
|  | 239 | #define ISDN_FEATURE_L2_V11096  (0x0001 << ISDN_PROTO_L2_V11096) | 
|  | 240 | #define ISDN_FEATURE_L2_V11019  (0x0001 << ISDN_PROTO_L2_V11019) | 
|  | 241 | #define ISDN_FEATURE_L2_V11038  (0x0001 << ISDN_PROTO_L2_V11038) | 
|  | 242 | #define ISDN_FEATURE_L2_MODEM   (0x0001 << ISDN_PROTO_L2_MODEM) | 
|  | 243 | #define ISDN_FEATURE_L2_FAX	(0x0001 << ISDN_PROTO_L2_FAX) | 
|  | 244 | #define ISDN_FEATURE_L2_HDLC_56K (0x0001 << ISDN_PROTO_L2_HDLC_56K) | 
|  | 245 |  | 
|  | 246 | #define ISDN_FEATURE_L2_MASK    (0x0FFFF) /* Max. 16 protocols */ | 
|  | 247 | #define ISDN_FEATURE_L2_SHIFT   (0) | 
|  | 248 |  | 
|  | 249 | /* Layer 3 */ | 
|  | 250 | #define ISDN_FEATURE_L3_TRANS   (0x10000 << ISDN_PROTO_L3_TRANS) | 
|  | 251 | #define ISDN_FEATURE_L3_TRANSDSP (0x10000 << ISDN_PROTO_L3_TRANSDSP) | 
|  | 252 | #define ISDN_FEATURE_L3_FCLASS2	(0x10000 << ISDN_PROTO_L3_FCLASS2) | 
|  | 253 | #define ISDN_FEATURE_L3_FCLASS1	(0x10000 << ISDN_PROTO_L3_FCLASS1) | 
|  | 254 |  | 
|  | 255 | #define ISDN_FEATURE_L3_MASK    (0x0FF0000) /* Max. 8 Protocols */ | 
|  | 256 | #define ISDN_FEATURE_L3_SHIFT   (16) | 
|  | 257 |  | 
|  | 258 | /* Signaling */ | 
|  | 259 | #define ISDN_FEATURE_P_UNKNOWN  (0x1000000 << ISDN_PTYPE_UNKNOWN) | 
|  | 260 | #define ISDN_FEATURE_P_1TR6     (0x1000000 << ISDN_PTYPE_1TR6) | 
|  | 261 | #define ISDN_FEATURE_P_EURO     (0x1000000 << ISDN_PTYPE_EURO) | 
|  | 262 | #define ISDN_FEATURE_P_NI1      (0x1000000 << ISDN_PTYPE_NI1) | 
|  | 263 |  | 
|  | 264 | #define ISDN_FEATURE_P_MASK     (0x0FF000000) /* Max. 8 Protocols */ | 
|  | 265 | #define ISDN_FEATURE_P_SHIFT    (24) | 
|  | 266 |  | 
|  | 267 | typedef struct setup_parm { | 
|  | 268 | unsigned char phone[32];	/* Remote Phone-Number */ | 
|  | 269 | unsigned char eazmsn[32];	/* Local EAZ or MSN    */ | 
|  | 270 | unsigned char si1;      /* Service Indicator 1 */ | 
|  | 271 | unsigned char si2;      /* Service Indicator 2 */ | 
|  | 272 | unsigned char plan;     /* Numbering plan      */ | 
|  | 273 | unsigned char screen;   /* Screening info      */ | 
|  | 274 | } setup_parm; | 
|  | 275 |  | 
|  | 276 |  | 
|  | 277 | #ifdef CONFIG_ISDN_TTY_FAX | 
|  | 278 | /* T.30 Fax G3 */ | 
|  | 279 |  | 
|  | 280 | #define FAXIDLEN 21 | 
|  | 281 |  | 
|  | 282 | typedef struct T30_s { | 
|  | 283 | /* session parameters */ | 
| Jan Blunck | 6a87818 | 2006-01-08 01:05:07 -0800 | [diff] [blame] | 284 | __u8 resolution; | 
|  | 285 | __u8 rate; | 
|  | 286 | __u8 width; | 
|  | 287 | __u8 length; | 
|  | 288 | __u8 compression; | 
|  | 289 | __u8 ecm; | 
|  | 290 | __u8 binary; | 
|  | 291 | __u8 scantime; | 
|  | 292 | __u8 id[FAXIDLEN]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | /* additional parameters */ | 
| Jan Blunck | 6a87818 | 2006-01-08 01:05:07 -0800 | [diff] [blame] | 294 | __u8 phase; | 
|  | 295 | __u8 direction; | 
|  | 296 | __u8 code; | 
|  | 297 | __u8 badlin; | 
|  | 298 | __u8 badmul; | 
|  | 299 | __u8 bor; | 
|  | 300 | __u8 fet; | 
|  | 301 | __u8 pollid[FAXIDLEN]; | 
|  | 302 | __u8 cq; | 
|  | 303 | __u8 cr; | 
|  | 304 | __u8 ctcrty; | 
|  | 305 | __u8 minsp; | 
|  | 306 | __u8 phcto; | 
|  | 307 | __u8 rel; | 
|  | 308 | __u8 nbc; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | /* remote station parameters */ | 
| Jan Blunck | 6a87818 | 2006-01-08 01:05:07 -0800 | [diff] [blame] | 310 | __u8 r_resolution; | 
|  | 311 | __u8 r_rate; | 
|  | 312 | __u8 r_width; | 
|  | 313 | __u8 r_length; | 
|  | 314 | __u8 r_compression; | 
|  | 315 | __u8 r_ecm; | 
|  | 316 | __u8 r_binary; | 
|  | 317 | __u8 r_scantime; | 
|  | 318 | __u8 r_id[FAXIDLEN]; | 
|  | 319 | __u8 r_code; | 
|  | 320 | } __attribute__((packed)) T30_s; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 |  | 
|  | 322 | #define ISDN_TTY_FAX_CONN_IN	0 | 
|  | 323 | #define ISDN_TTY_FAX_CONN_OUT	1 | 
|  | 324 |  | 
|  | 325 | #define ISDN_TTY_FAX_FCON	0 | 
|  | 326 | #define ISDN_TTY_FAX_DIS 	1 | 
|  | 327 | #define ISDN_TTY_FAX_FTT 	2 | 
|  | 328 | #define ISDN_TTY_FAX_MCF 	3 | 
|  | 329 | #define ISDN_TTY_FAX_DCS 	4 | 
|  | 330 | #define ISDN_TTY_FAX_TRAIN_OK	5 | 
|  | 331 | #define ISDN_TTY_FAX_EOP 	6 | 
|  | 332 | #define ISDN_TTY_FAX_EOM 	7 | 
|  | 333 | #define ISDN_TTY_FAX_MPS 	8 | 
|  | 334 | #define ISDN_TTY_FAX_DTC 	9 | 
|  | 335 | #define ISDN_TTY_FAX_RID 	10 | 
|  | 336 | #define ISDN_TTY_FAX_HNG 	11 | 
|  | 337 | #define ISDN_TTY_FAX_DT  	12 | 
|  | 338 | #define ISDN_TTY_FAX_FCON_I	13 | 
|  | 339 | #define ISDN_TTY_FAX_DR  	14 | 
|  | 340 | #define ISDN_TTY_FAX_ET  	15 | 
|  | 341 | #define ISDN_TTY_FAX_CFR 	16 | 
|  | 342 | #define ISDN_TTY_FAX_PTS 	17 | 
|  | 343 | #define ISDN_TTY_FAX_SENT	18 | 
|  | 344 |  | 
|  | 345 | #define ISDN_FAX_PHASE_IDLE	0 | 
|  | 346 | #define ISDN_FAX_PHASE_A	1 | 
|  | 347 | #define ISDN_FAX_PHASE_B   	2 | 
|  | 348 | #define ISDN_FAX_PHASE_C   	3 | 
|  | 349 | #define ISDN_FAX_PHASE_D   	4 | 
|  | 350 | #define ISDN_FAX_PHASE_E   	5 | 
|  | 351 |  | 
|  | 352 | #endif /* TTY_FAX */ | 
|  | 353 |  | 
|  | 354 | #define ISDN_FAX_CLASS1_FAE	0 | 
|  | 355 | #define ISDN_FAX_CLASS1_FTS	1 | 
|  | 356 | #define ISDN_FAX_CLASS1_FRS	2 | 
|  | 357 | #define ISDN_FAX_CLASS1_FTM	3 | 
|  | 358 | #define ISDN_FAX_CLASS1_FRM	4 | 
|  | 359 | #define ISDN_FAX_CLASS1_FTH	5 | 
|  | 360 | #define ISDN_FAX_CLASS1_FRH	6 | 
|  | 361 | #define ISDN_FAX_CLASS1_CTRL	7 | 
|  | 362 |  | 
|  | 363 | #define ISDN_FAX_CLASS1_OK	0 | 
|  | 364 | #define ISDN_FAX_CLASS1_CONNECT	1 | 
|  | 365 | #define ISDN_FAX_CLASS1_NOCARR	2 | 
|  | 366 | #define ISDN_FAX_CLASS1_ERROR	3 | 
|  | 367 | #define ISDN_FAX_CLASS1_FCERROR	4 | 
|  | 368 | #define ISDN_FAX_CLASS1_QUERY	5 | 
|  | 369 |  | 
|  | 370 | typedef struct { | 
|  | 371 | __u8	cmd; | 
|  | 372 | __u8	subcmd; | 
|  | 373 | __u8	para[50]; | 
|  | 374 | } aux_s; | 
|  | 375 |  | 
|  | 376 | #define AT_COMMAND	0 | 
|  | 377 | #define AT_EQ_VALUE	1 | 
|  | 378 | #define AT_QUERY	2 | 
|  | 379 | #define AT_EQ_QUERY	3 | 
|  | 380 |  | 
|  | 381 | /* CAPI structs */ | 
|  | 382 |  | 
|  | 383 | /* this is compatible to the old union size */ | 
|  | 384 | #define MAX_CAPI_PARA_LEN 50 | 
|  | 385 |  | 
|  | 386 | typedef struct { | 
|  | 387 | /* Header */ | 
|  | 388 | __u16 Length; | 
|  | 389 | __u16 ApplId; | 
|  | 390 | __u8 Command; | 
|  | 391 | __u8 Subcommand; | 
|  | 392 | __u16 Messagenumber; | 
|  | 393 |  | 
|  | 394 | /* Parameter */ | 
|  | 395 | union { | 
|  | 396 | __u32 Controller; | 
|  | 397 | __u32 PLCI; | 
|  | 398 | __u32 NCCI; | 
|  | 399 | } adr; | 
|  | 400 | __u8 para[MAX_CAPI_PARA_LEN]; | 
|  | 401 | } capi_msg; | 
|  | 402 |  | 
|  | 403 | /* | 
|  | 404 | * Structure for exchanging above infos | 
|  | 405 | * | 
|  | 406 | */ | 
|  | 407 | typedef struct { | 
|  | 408 | int   driver;		/* Lowlevel-Driver-ID            */ | 
|  | 409 | int   command;		/* Command or Status (see above) */ | 
|  | 410 | ulong arg;		/* Additional Data               */ | 
|  | 411 | union { | 
|  | 412 | ulong errcode;	/* Type of error with STAT_L1ERR	*/ | 
|  | 413 | int length;	/* Amount of bytes sent with STAT_BSENT	*/ | 
|  | 414 | u_char num[50];	/* Additional Data			*/ | 
|  | 415 | setup_parm setup;/* For SETUP msg			*/ | 
|  | 416 | capi_msg cmsg;	/* For CAPI like messages		*/ | 
|  | 417 | char display[85];/* display message data		*/ | 
|  | 418 | isdn_cmd_stat isdn_io; /* ISDN IO-parameter/result	*/ | 
|  | 419 | aux_s aux;	/* for modem commands/indications	*/ | 
|  | 420 | #ifdef CONFIG_ISDN_TTY_FAX | 
|  | 421 | T30_s	*fax;	/* Pointer to ttys fax struct		*/ | 
|  | 422 | #endif | 
|  | 423 | ulong userdata;	/* User Data */ | 
|  | 424 | } parm; | 
|  | 425 | } isdn_ctrl; | 
|  | 426 |  | 
|  | 427 | #define dss1_io    isdn_io | 
|  | 428 | #define ni1_io     isdn_io | 
|  | 429 |  | 
|  | 430 | /* | 
|  | 431 | * The interface-struct itself (initialized at load-time of lowlevel-driver) | 
|  | 432 | * | 
|  | 433 | * See Documentation/isdn/INTERFACE for a description, how the communication | 
|  | 434 | * between the ISDN subsystem and its drivers is done. | 
|  | 435 | * | 
|  | 436 | */ | 
|  | 437 | typedef struct { | 
|  | 438 | struct module *owner; | 
|  | 439 |  | 
|  | 440 | /* Number of channels supported by this driver | 
|  | 441 | */ | 
|  | 442 | int channels; | 
|  | 443 |  | 
|  | 444 | /* | 
|  | 445 | * Maximum Size of transmit/receive-buffer this driver supports. | 
|  | 446 | */ | 
|  | 447 | int maxbufsize; | 
|  | 448 |  | 
|  | 449 | /* Feature-Flags for this driver. | 
|  | 450 | * See defines ISDN_FEATURE_... for Values | 
|  | 451 | */ | 
|  | 452 | unsigned long features; | 
|  | 453 |  | 
|  | 454 | /* | 
|  | 455 | * Needed for calculating | 
|  | 456 | * dev->hard_header_len = linklayer header + hl_hdrlen; | 
|  | 457 | * Drivers, not supporting sk_buff's should set this to 0. | 
|  | 458 | */ | 
|  | 459 | unsigned short hl_hdrlen; | 
|  | 460 |  | 
|  | 461 | /* | 
|  | 462 | * Receive-Callback using sk_buff's | 
|  | 463 | * Parameters: | 
|  | 464 | *             int                    Driver-ID | 
|  | 465 | *             int                    local channel-number (0 ...) | 
|  | 466 | *             struct sk_buff *skb    received Data | 
|  | 467 | */ | 
|  | 468 | void (*rcvcallb_skb)(int, int, struct sk_buff *); | 
|  | 469 |  | 
|  | 470 | /* Status-Callback | 
|  | 471 | * Parameters: | 
|  | 472 | *             isdn_ctrl* | 
|  | 473 | *                   driver  = Driver ID. | 
|  | 474 | *                   command = One of above ISDN_STAT_... constants. | 
|  | 475 | *                   arg     = depending on status-type. | 
|  | 476 | *                   num     = depending on status-type. | 
|  | 477 | */ | 
|  | 478 | int (*statcallb)(isdn_ctrl*); | 
|  | 479 |  | 
|  | 480 | /* Send command | 
|  | 481 | * Parameters: | 
|  | 482 | *             isdn_ctrl* | 
|  | 483 | *                   driver  = Driver ID. | 
|  | 484 | *                   command = One of above ISDN_CMD_... constants. | 
|  | 485 | *                   arg     = depending on command. | 
|  | 486 | *                   num     = depending on command. | 
|  | 487 | */ | 
|  | 488 | int (*command)(isdn_ctrl*); | 
|  | 489 |  | 
|  | 490 | /* | 
|  | 491 | * Send data using sk_buff's | 
|  | 492 | * Parameters: | 
|  | 493 | *             int                    driverId | 
|  | 494 | *             int                    local channel-number (0...) | 
|  | 495 | *             int                    Flag: Need ACK for this packet. | 
|  | 496 | *             struct sk_buff *skb    Data to send | 
|  | 497 | */ | 
|  | 498 | int (*writebuf_skb) (int, int, int, struct sk_buff *); | 
|  | 499 |  | 
|  | 500 | /* Send raw D-Channel-Commands | 
|  | 501 | * Parameters: | 
|  | 502 | *             u_char pointer data | 
|  | 503 | *             int    length of data | 
|  | 504 | *             int    driverId | 
|  | 505 | *             int    local channel-number (0 ...) | 
|  | 506 | */ | 
|  | 507 | int (*writecmd)(const u_char __user *, int, int, int); | 
|  | 508 |  | 
|  | 509 | /* Read raw Status replies | 
|  | 510 | *             u_char pointer data (volatile) | 
|  | 511 | *             int    length of buffer | 
|  | 512 | *             int    driverId | 
|  | 513 | *             int    local channel-number (0 ...) | 
|  | 514 | */ | 
|  | 515 | int (*readstat)(u_char __user *, int, int, int); | 
|  | 516 |  | 
|  | 517 | char id[20]; | 
|  | 518 | } isdn_if; | 
|  | 519 |  | 
|  | 520 | /* | 
|  | 521 | * Function which must be called by lowlevel-driver at loadtime with | 
|  | 522 | * the following fields of above struct set: | 
|  | 523 | * | 
|  | 524 | * channels     Number of channels that will be supported. | 
|  | 525 | * hl_hdrlen    Space to preserve in sk_buff's when sending. Drivers, not | 
|  | 526 | *              supporting sk_buff's should set this to 0. | 
|  | 527 | * command      Address of Command-Handler. | 
|  | 528 | * features     Bitwise coded Features of this driver. (use ISDN_FEATURE_...) | 
|  | 529 | * writebuf_skb Address of Skbuff-Send-Handler. | 
|  | 530 | * writecmd        "    "  D-Channel  " which accepts raw D-Ch-Commands. | 
|  | 531 | * readstat        "    "  D-Channel  " which delivers raw Status-Data. | 
|  | 532 | * | 
|  | 533 | * The linklevel-driver fills the following fields: | 
|  | 534 | * | 
|  | 535 | * channels      Driver-ID assigned to this driver. (Must be used on all | 
|  | 536 | *               subsequent callbacks. | 
|  | 537 | * rcvcallb_skb  Address of handler for received Skbuff's. | 
|  | 538 | * statcallb        "    "     "    for status-changes. | 
|  | 539 | * | 
|  | 540 | */ | 
|  | 541 | extern int register_isdn(isdn_if*); | 
|  | 542 | #include <asm/uaccess.h> | 
|  | 543 |  | 
|  | 544 | #endif /* __KERNEL__ */ | 
|  | 545 |  | 
|  | 546 | #endif /* __ISDNIF_H__ */ |