| rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame] | 1 | $Id: INTERFACE,v 1.15.8.2 2001/03/13 16:17:07 kai Exp $ | 
|  | 2 |  | 
|  | 3 | Description of the Interface between Linklevel and Hardwarelevel | 
|  | 4 | of isdn4linux: | 
|  | 5 |  | 
|  | 6 |  | 
|  | 7 | The Communication between Linklevel (LL) and Hardwarelevel (HL) | 
|  | 8 | is based on the struct isdn_if (defined in isdnif.h). | 
|  | 9 |  | 
|  | 10 | An HL-driver can register itself at LL by calling the function | 
|  | 11 | register_isdn() with a pointer to that struct. Prior to that, it has | 
|  | 12 | to preset some of the fields of isdn_if. The LL sets the rest of | 
|  | 13 | the fields. All further communication is done via callbacks using | 
|  | 14 | the function-pointers defined in isdn_if. | 
|  | 15 |  | 
|  | 16 | Changes/Version numbering: | 
|  | 17 |  | 
|  | 18 | During development of the ISDN subsystem, several changes have been | 
|  | 19 | made to the interface. Before it went into kernel, the package | 
|  | 20 | had a unique version number. The last version, distributed separately | 
|  | 21 | was 0.7.4. When the subsystem went into kernel, every functional unit | 
|  | 22 | got a separate version number. These numbers are shown at initialization, | 
|  | 23 | separated by slashes: | 
|  | 24 |  | 
|  | 25 | c.c/t.t/n.n/p.p/a.a/v.v | 
|  | 26 |  | 
|  | 27 | where | 
|  | 28 |  | 
|  | 29 | c.c is the revision of the common code. | 
|  | 30 | t.t is the revision of the tty related code. | 
|  | 31 | n.n is the revision of the network related code. | 
|  | 32 | p.p is the revision of the ppp related code. | 
|  | 33 | a.a is the revision of the audio related code. | 
|  | 34 | v.v is the revision of the V.110 related code. | 
|  | 35 |  | 
|  | 36 | Changes in this document are marked with '***CHANGEx' where x representing | 
|  | 37 | the version number. If that number starts with 0, it refers to the old, | 
|  | 38 | separately distributed package. If it starts with one of the letters | 
|  | 39 | above, it refers to the revision of the corresponding module. | 
|  | 40 | ***CHANGEIx refers to the revision number of the isdnif.h | 
|  | 41 |  | 
|  | 42 | 1. Description of the fields of isdn_if: | 
|  | 43 |  | 
|  | 44 | int channels; | 
|  | 45 |  | 
|  | 46 | This field has to be set by the HL-driver to the number of channels | 
|  | 47 | supported prior to calling register_isdn(). Upon return of the call, | 
|  | 48 | the LL puts an id there, which has to be used by the HL-driver when | 
|  | 49 | invoking the other callbacks. | 
|  | 50 |  | 
|  | 51 | int maxbufsize; | 
|  | 52 |  | 
|  | 53 | ***CHANGE0.6: New since this version. | 
|  | 54 |  | 
|  | 55 | Also to be preset by the HL-driver. With this value the HL-driver | 
|  | 56 | tells the LL the maximum size of a data-packet it will accept. | 
|  | 57 |  | 
|  | 58 | unsigned long features; | 
|  | 59 |  | 
|  | 60 | To be preset by the HL-driver. Using this field, the HL-driver | 
|  | 61 | announces the features supported. At the moment this is limited to | 
|  | 62 | report the supported layer2 and layer3-protocols. For setting this | 
|  | 63 | field the constants ISDN_FEATURE..., declared in isdnif.h have to be | 
|  | 64 | used. | 
|  | 65 |  | 
|  | 66 | ***CHANGE0.7.1: The line type (1TR6, EDSS1) has to be set. | 
|  | 67 |  | 
|  | 68 | unsigned short hl_hdrlen; | 
|  | 69 |  | 
|  | 70 | ***CHANGE0.7.4: New field. | 
|  | 71 |  | 
|  | 72 | To be preset by the HL-driver, if it supports sk_buff's. The driver | 
|  | 73 | should put here the amount of additional space needed in sk_buff's for | 
|  | 74 | its internal purposes. Drivers not supporting sk_buff's should | 
|  | 75 | initialize this field to 0. | 
|  | 76 |  | 
|  | 77 | void (*rcvcallb_skb)(int, int, struct sk_buff *) | 
|  | 78 |  | 
|  | 79 | ***CHANGE0.7.4: New field. | 
|  | 80 |  | 
|  | 81 | This field will be set by LL. The HL-driver delivers received data- | 
|  | 82 | packets by calling this function. Upon calling, the HL-driver must | 
|  | 83 | already have its private data pulled off the head of the sk_buff. | 
|  | 84 |  | 
|  | 85 | Parameter: | 
|  | 86 | int              driver-Id | 
|  | 87 | int              Channel-number locally to the driver. (starting with 0) | 
|  | 88 | struct sk_buff * Pointer to sk_buff, containing received data. | 
|  | 89 |  | 
|  | 90 | int (*statcallb)(isdn_ctrl*); | 
|  | 91 |  | 
|  | 92 | This field will be set by LL. This function has to be called by the | 
|  | 93 | HL-driver for signaling status-changes or other events to the LL. | 
|  | 94 |  | 
|  | 95 | Parameter: | 
|  | 96 | isdn_ctrl* | 
|  | 97 |  | 
|  | 98 | The struct isdn_ctrl also defined in isdn_if. The exact meanings of its | 
|  | 99 | fields are described together with the descriptions of the possible | 
|  | 100 | events. Here is only a short description of the fields: | 
|  | 101 |  | 
|  | 102 | driver  = driver Id. | 
|  | 103 | command = event-type. (one of the constants ISDN_STAT_...) | 
|  | 104 | arg     = depends on event-type. | 
|  | 105 | num     = depends on event-type. | 
|  | 106 |  | 
|  | 107 | Returnvalue: | 
|  | 108 | 0 on success, else -1 | 
|  | 109 |  | 
|  | 110 | int (*command)(isdn_ctrl*); | 
|  | 111 |  | 
|  | 112 | This field has to be preset by the HL-driver. It points to a function, | 
|  | 113 | to be called by LL to perform functions like dialing, B-channel | 
|  | 114 | setup, etc. The exact meaning of the parameters is described with the | 
|  | 115 | descriptions of the possible commands. | 
|  | 116 |  | 
|  | 117 | Parameter: | 
|  | 118 | isdn_ctrl* | 
|  | 119 | driver  = driver-Id | 
|  | 120 | command = command to perform. (one of the constants ISDN_CMD_...) | 
|  | 121 | arg     = depends on command. | 
|  | 122 | num     = depends on command. | 
|  | 123 |  | 
|  | 124 | Returnvalue: | 
|  | 125 | >=0 on success, else error-code (-ENODEV etc.) | 
|  | 126 |  | 
|  | 127 | int (*writebuf_skb)(int, int, int, struct sk_buff *) | 
|  | 128 |  | 
|  | 129 | ***CHANGE0.7.4: New field. | 
|  | 130 | ***CHANGEI.1.21: New field. | 
|  | 131 |  | 
|  | 132 | This field has to be preset by the HL-driver. The given function will | 
|  | 133 | be called by the LL for delivering data to be send via B-Channel. | 
|  | 134 |  | 
|  | 135 |  | 
|  | 136 | Parameter: | 
|  | 137 | int              driver-Id ***CHANGE0.7.4: New parameter. | 
|  | 138 | int              channel-number locally to the HL-driver. (starts with 0) | 
|  | 139 | int	       ack ***ChangeI1.21: New parameter | 
|  | 140 | If this is !0, the driver has to signal the delivery | 
|  | 141 | by sending an ISDN_STAT_BSENT. If this is 0, the driver | 
|  | 142 | MUST NOT send an ISDN_STAT_BSENT. | 
|  | 143 | struct sk_buff * Pointer to sk_buff containing data to be send via | 
|  | 144 | B-channel. | 
|  | 145 |  | 
|  | 146 | Returnvalue: | 
|  | 147 | Length of data accepted on success, else error-code (-EINVAL on | 
|  | 148 | oversized packets etc.) | 
|  | 149 |  | 
|  | 150 | int (*writecmd)(u_char*, int, int, int, int); | 
|  | 151 |  | 
|  | 152 | This field has to be preset by the HL-driver. The given function will be | 
|  | 153 | called to perform write-requests on /dev/isdnctrl (i.e. sending commands | 
|  | 154 | to the card) The data-format is hardware-specific. This function is | 
|  | 155 | intended for debugging only. It is not necessary for normal operation | 
|  | 156 | and never will be called by the tty-emulation- or network-code. If | 
|  | 157 | this function is not supported, the driver has to set NULL here. | 
|  | 158 |  | 
|  | 159 | Parameter: | 
|  | 160 | u_char* pointer to data. | 
|  | 161 | int     length of data. | 
|  | 162 | int     flag: 0 = call from within kernel-space. (HL-driver must use | 
|  | 163 | memcpy, may NOT use schedule()) | 
|  | 164 | 1 = call from user-space. (HL-driver must use | 
|  | 165 | memcpy_fromfs, use of schedule() allowed) | 
|  | 166 | int     driver-Id. | 
|  | 167 | int     channel-number locally to the HL-driver. (starts with 0) | 
|  | 168 |  | 
|  | 169 | ***CHANGEI1.14: The driver-Id and channel-number are new since this revision. | 
|  | 170 |  | 
|  | 171 | Returnvalue: | 
|  | 172 | Length of data accepted on success, else error-code (-EINVAL etc.) | 
|  | 173 |  | 
|  | 174 | int (*readstat)(u_char*, int, int, int, int); | 
|  | 175 |  | 
|  | 176 | This field has to be preset by the HL-driver. The given function will be | 
|  | 177 | called to perform read-requests on /dev/isdnctrl (i.e. reading replies | 
|  | 178 | from the card) The data-format is hardware-specific. This function is | 
|  | 179 | intended for debugging only. It is not necessary for normal operation | 
|  | 180 | and never will be called by the tty-emulation- or network-code. If | 
|  | 181 | this function is not supported, the driver has to set NULL here. | 
|  | 182 |  | 
|  | 183 | Parameter: | 
|  | 184 | u_char* pointer to data. | 
|  | 185 | int     length of data. | 
|  | 186 | int     flag: 0 = call from within kernel-space. (HL-driver must use | 
|  | 187 | memcpy, may NOT use schedule()) | 
|  | 188 | 1 = call from user-space. (HL-driver must use | 
|  | 189 | memcpy_fromfs, use of schedule() allowed) | 
|  | 190 | int     driver-Id. | 
|  | 191 | int     channel-number locally to the HL-driver. (starts with 0) | 
|  | 192 |  | 
|  | 193 | ***CHANGEI1.14: The driver-Id and channel-number are new since this revision. | 
|  | 194 |  | 
|  | 195 | Returnvalue: | 
|  | 196 | Length of data on success, else error-code (-EINVAL etc.) | 
|  | 197 |  | 
|  | 198 | char id[20]; | 
|  | 199 | ***CHANGE0.7: New since this version. | 
|  | 200 |  | 
|  | 201 | This string has to be preset by the HL-driver. Its purpose is for | 
|  | 202 | identification of the driver by the user. Eg.: it is shown in the | 
|  | 203 | status-info of /dev/isdninfo. Furthermore it is used as Id for binding | 
|  | 204 | net-interfaces to a specific channel. If a string of length zero is | 
|  | 205 | given, upon return, isdn4linux will replace it by a generic name. (line0, | 
|  | 206 | line1 etc.) It is recommended to make this string configurable during | 
|  | 207 | module-load-time. (copy a global variable to this string.) For doing that, | 
|  | 208 | modules 1.2.8 or newer are necessary. | 
|  | 209 |  | 
|  | 210 | 2. Description of the commands, a HL-driver has to support: | 
|  | 211 |  | 
|  | 212 | All commands will be performed by calling the function command() described | 
|  | 213 | above from within the LL. The field command of the struct-parameter will | 
|  | 214 | contain the desired command, the field driver is always set to the | 
|  | 215 | appropriate driver-Id. | 
|  | 216 |  | 
|  | 217 | Until now, the following commands are defined: | 
|  | 218 |  | 
|  | 219 | ***CHANGEI1.34: The parameter "num" has been replaced by a union "parm" containing | 
|  | 220 | the old "num" and a new setup_type struct used for ISDN_CMD_DIAL | 
|  | 221 | and ISDN_STAT_ICALL callback. | 
|  | 222 |  | 
|  | 223 | ISDN_CMD_IOCTL: | 
|  | 224 |  | 
|  | 225 | This command is intended for performing ioctl-calls for configuring | 
|  | 226 | hardware or similar purposes (setting port-addresses, loading firmware | 
|  | 227 | etc.) For this purpose, in the LL all ioctl-calls with an argument | 
|  | 228 | >= IIOCDRVCTL (0x100) will be handed transparently to this | 
|  | 229 | function after subtracting 0x100 and placing the result in arg. | 
|  | 230 | Example: | 
|  | 231 | If a userlevel-program calls ioctl(0x101,...) the function gets | 
|  | 232 | called with the field command set to 1. | 
|  | 233 |  | 
|  | 234 | Parameter: | 
|  | 235 | driver   = driver-Id. | 
|  | 236 | command  = ISDN_CMD_IOCTL | 
|  | 237 | arg      = Original ioctl-cmd - IIOCDRVCTL | 
|  | 238 | parm.num = first bytes filled with (unsigned long)arg | 
|  | 239 |  | 
|  | 240 | Returnvalue: | 
|  | 241 | Depending on driver. | 
|  | 242 |  | 
|  | 243 |  | 
|  | 244 | ISDN_CMD_DIAL: | 
|  | 245 |  | 
|  | 246 | This command is used to tell the HL-driver it should dial a given | 
|  | 247 | number. | 
|  | 248 |  | 
|  | 249 | Parameter: | 
|  | 250 | driver      = driver-Id. | 
|  | 251 | command     = ISDN_CMD_DIAL | 
|  | 252 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 253 |  | 
|  | 254 | parm.setup.phone  = An ASCII-String containing the number to dial. | 
|  | 255 | parm.setup.eazmsn = An ASCII-Sting containing the own EAZ or MSN. | 
|  | 256 | parm.setup.si1    = The Service-Indicator. | 
|  | 257 | parm.setup.si2    = Additional Service-Indicator. | 
|  | 258 |  | 
|  | 259 | If the Line has been designed as SPV (a special german | 
|  | 260 | feature, meaning semi-leased-line) the phone has to | 
|  | 261 | start with an "S". | 
|  | 262 | ***CHANGE0.6: In previous versions the EAZ has been given in the | 
|  | 263 | highbyte of arg. | 
|  | 264 | ***CHANGE0.7.1: New since this version: ServiceIndicator and AddInfo. | 
|  | 265 |  | 
|  | 266 | ISDN_CMD_ACCEPTD: | 
|  | 267 |  | 
|  | 268 | With this command, the HL-driver is told to accept a D-Channel-setup. | 
|  | 269 | (Response to an incoming call) | 
|  | 270 |  | 
|  | 271 | Parameter: | 
|  | 272 | driver      = driver-Id. | 
|  | 273 | command     = ISDN_CMD_ACCEPTD | 
|  | 274 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 275 | parm        = unused. | 
|  | 276 |  | 
|  | 277 | ISDN_CMD_ACCEPTB: | 
|  | 278 |  | 
|  | 279 | With this command, the HL-driver is told to perform a B-Channel-setup. | 
|  | 280 | (after establishing D-Channel-Connection) | 
|  | 281 |  | 
|  | 282 | Parameter: | 
|  | 283 | driver      = driver-Id. | 
|  | 284 | command     = ISDN_CMD_ACCEPTB | 
|  | 285 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 286 | parm        = unused. | 
|  | 287 |  | 
|  | 288 | ISDN_CMD_HANGUP: | 
|  | 289 |  | 
|  | 290 | With this command, the HL-driver is told to hangup (B-Channel if | 
|  | 291 | established first, then D-Channel). This command is also used for | 
|  | 292 | actively rejecting an incoming call. | 
|  | 293 |  | 
|  | 294 | Parameter: | 
|  | 295 | driver      = driver-Id. | 
|  | 296 | command     = ISDN_CMD_HANGUP | 
|  | 297 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 298 | parm        = unused. | 
|  | 299 |  | 
|  | 300 | ISDN_CMD_CLREAZ: | 
|  | 301 |  | 
|  | 302 | With this command, the HL-driver is told not to signal incoming | 
|  | 303 | calls to the LL. | 
|  | 304 |  | 
|  | 305 | Parameter: | 
|  | 306 | driver      = driver-Id. | 
|  | 307 | command     = ISDN_CMD_CLREAZ | 
|  | 308 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 309 | parm        = unused. | 
|  | 310 |  | 
|  | 311 | ISDN_CMD_SETEAZ: | 
|  | 312 |  | 
|  | 313 | With this command, the HL-driver is told to signal incoming calls for | 
|  | 314 | the given EAZs/MSNs to the LL. | 
|  | 315 |  | 
|  | 316 | Parameter: | 
|  | 317 | driver      = driver-Id. | 
|  | 318 | command     = ISDN_CMD_SETEAZ | 
|  | 319 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 320 | parm.num    = ASCII-String, containing the desired EAZ's/MSN's | 
|  | 321 | (comma-separated). If an empty String is given, the | 
|  | 322 | HL-driver should respond to ALL incoming calls, | 
|  | 323 | regardless of the destination-address. | 
|  | 324 | ***CHANGE0.6: New since this version the "empty-string"-feature. | 
|  | 325 |  | 
|  | 326 | ISDN_CMD_GETEAZ: (currently unused) | 
|  | 327 |  | 
|  | 328 | With this command, the HL-driver is told to report the current setting | 
|  | 329 | given with ISDN_CMD_SETEAZ. | 
|  | 330 |  | 
|  | 331 | Parameter: | 
|  | 332 | driver      = driver-Id. | 
|  | 333 | command     = ISDN_CMD_GETEAZ | 
|  | 334 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 335 | parm.num    = ASCII-String, containing the current EAZ's/MSN's | 
|  | 336 |  | 
|  | 337 | ISDN_CMD_SETSIL: (currently unused) | 
|  | 338 |  | 
|  | 339 | With this command, the HL-driver is told to signal only incoming | 
|  | 340 | calls with the given Service-Indicators. | 
|  | 341 |  | 
|  | 342 | Parameter: | 
|  | 343 | driver      = driver-Id. | 
|  | 344 | command     = ISDN_CMD_SETSIL | 
|  | 345 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 346 | parm.num    = ASCII-String, containing the desired Service-Indicators. | 
|  | 347 |  | 
|  | 348 | ISDN_CMD_GETSIL: (currently unused) | 
|  | 349 |  | 
|  | 350 | With this command, the HL-driver is told to return the current | 
|  | 351 | Service-Indicators it will respond to. | 
|  | 352 |  | 
|  | 353 | Parameter: | 
|  | 354 | driver      = driver-Id. | 
|  | 355 | command     = ISDN_CMD_SETSIL | 
|  | 356 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 357 | parm.num    = ASCII-String, containing the current Service-Indicators. | 
|  | 358 |  | 
|  | 359 | ISDN_CMD_SETL2: | 
|  | 360 |  | 
|  | 361 | With this command, the HL-driver is told to select the given Layer-2- | 
|  | 362 | protocol. This command is issued by the LL prior to ISDN_CMD_DIAL or | 
|  | 363 | ISDN_CMD_ACCEPTD. | 
|  | 364 |  | 
|  | 365 |  | 
|  | 366 | Parameter: | 
|  | 367 | driver      = driver-Id. | 
|  | 368 | command     = ISDN_CMD_SETL2 | 
|  | 369 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 370 | logical or'ed with (protocol-Id << 8) | 
|  | 371 | protocol-Id is one of the constants ISDN_PROTO_L2... | 
|  | 372 | parm        = unused. | 
|  | 373 |  | 
|  | 374 | ISDN_CMD_GETL2: (currently unused) | 
|  | 375 |  | 
|  | 376 | With this command, the HL-driver is told to return the current | 
|  | 377 | setting of the Layer-2-protocol. | 
|  | 378 |  | 
|  | 379 | Parameter: | 
|  | 380 | driver      = driver-Id. | 
|  | 381 | command     = ISDN_CMD_GETL2 | 
|  | 382 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 383 | parm        = unused. | 
|  | 384 | Returnvalue: | 
|  | 385 | current protocol-Id (one of the constants ISDN_L2_PROTO) | 
|  | 386 |  | 
|  | 387 | ISDN_CMD_SETL3: | 
|  | 388 |  | 
|  | 389 | With this command, the HL-driver is told to select the given Layer-3- | 
|  | 390 | protocol. This command is issued by the LL prior to ISDN_CMD_DIAL or | 
|  | 391 | ISDN_CMD_ACCEPTD. | 
|  | 392 |  | 
|  | 393 |  | 
|  | 394 | Parameter: | 
|  | 395 | driver      = driver-Id. | 
|  | 396 | command     = ISDN_CMD_SETL3 | 
|  | 397 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 398 | logical or'ed with (protocol-Id << 8) | 
|  | 399 | protocol-Id is one of the constants ISDN_PROTO_L3... | 
|  | 400 | parm.fax    = Pointer to T30_s fax struct. (fax usage only) | 
|  | 401 |  | 
|  | 402 | ISDN_CMD_GETL2: (currently unused) | 
|  | 403 |  | 
|  | 404 | With this command, the HL-driver is told to return the current | 
|  | 405 | setting of the Layer-3-protocol. | 
|  | 406 |  | 
|  | 407 | Parameter: | 
|  | 408 | driver      = driver-Id. | 
|  | 409 | command     = ISDN_CMD_GETL3 | 
|  | 410 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 411 | parm        = unused. | 
|  | 412 | Returnvalue: | 
|  | 413 | current protocol-Id (one of the constants ISDN_L3_PROTO) | 
|  | 414 |  | 
|  | 415 | ISDN_CMD_PROCEED: | 
|  | 416 |  | 
|  | 417 | With this command, the HL-driver is told to proceed with a incoming call. | 
|  | 418 |  | 
|  | 419 | Parameter: | 
|  | 420 | driver      = driver-Id. | 
|  | 421 | command     = ISDN_CMD_PROCEED | 
|  | 422 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 423 | setup.eazmsn= empty string or string send as uus1 in DSS1 with | 
|  | 424 | PROCEED message | 
|  | 425 |  | 
|  | 426 | ISDN_CMD_ALERT: | 
|  | 427 |  | 
|  | 428 | With this command, the HL-driver is told to alert a proceeding call. | 
|  | 429 |  | 
|  | 430 | Parameter: | 
|  | 431 | driver      = driver-Id. | 
|  | 432 | command     = ISDN_CMD_ALERT | 
|  | 433 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 434 | setup.eazmsn= empty string or string send as uus1 in DSS1 with | 
|  | 435 | ALERT message | 
|  | 436 |  | 
|  | 437 | ISDN_CMD_REDIR: | 
|  | 438 |  | 
|  | 439 | With this command, the HL-driver is told to redirect a call in proceeding | 
|  | 440 | or alerting state. | 
|  | 441 |  | 
|  | 442 | Parameter: | 
|  | 443 | driver      = driver-Id. | 
|  | 444 | command     = ISDN_CMD_REDIR | 
|  | 445 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 446 | setup.eazmsn= empty string or string send as uus1 in DSS1 protocol | 
|  | 447 | setup.screen= screening indicator | 
|  | 448 | setup.phone = redirected to party number | 
|  | 449 |  | 
|  | 450 | ISDN_CMD_PROT_IO: | 
|  | 451 |  | 
|  | 452 | With this call, the LL-driver invokes protocol specific features through | 
|  | 453 | the LL. | 
|  | 454 | The call is not implicitely bound to a connection. | 
|  | 455 |  | 
|  | 456 | Parameter: | 
|  | 457 | driver      = driver-Id | 
|  | 458 | command     = ISDN_CMD_PROT_IO | 
|  | 459 | arg         = The lower 8 Bits define the addressed protocol as defined | 
|  | 460 | in ISDN_PTYPE..., the upper bits are used to differentiate | 
|  | 461 | the protocol specific CMD. | 
|  | 462 |  | 
|  | 463 | para        = protocol and function specific. See isdnif.h for detail. | 
|  | 464 |  | 
|  | 465 |  | 
|  | 466 | ISDN_CMD_FAXCMD: | 
|  | 467 |  | 
|  | 468 | With this command the HL-driver receives a fax sub-command. | 
|  | 469 | For details refer to INTERFACE.fax | 
|  | 470 |  | 
|  | 471 | Parameter: | 
|  | 472 | driver      = driver-Id. | 
|  | 473 | command     = ISDN_CMD_FAXCMD | 
|  | 474 | arg         = channel-number locally to the driver. (starting with 0) | 
|  | 475 | parm        = unused. | 
|  | 476 |  | 
|  | 477 |  | 
|  | 478 | 3. Description of the events to be signaled by the HL-driver to the LL. | 
|  | 479 |  | 
|  | 480 | All status-changes are signaled via calling the previously described | 
|  | 481 | function statcallb(). The field command of the struct isdn_cmd has | 
|  | 482 | to be set by the HL-driver with the appropriate Status-Id (event-number). | 
|  | 483 | The field arg has to be set to the channel-number (locally to the driver, | 
|  | 484 | starting with 0) to which this event applies. (Exception: STAVAIL-event) | 
|  | 485 |  | 
|  | 486 | Until now, the following Status-Ids are defined: | 
|  | 487 |  | 
|  | 488 | ISDN_STAT_AVAIL: | 
|  | 489 |  | 
|  | 490 | With this call, the HL-driver signals the availability of new data | 
|  | 491 | for readstat(). Used only for debugging-purposes, see description | 
|  | 492 | of readstat(). | 
|  | 493 |  | 
|  | 494 | Parameter: | 
|  | 495 | driver      = driver-Id | 
|  | 496 | command     = ISDN_STAT_STAVAIL | 
|  | 497 | arg         = length of available data. | 
|  | 498 | parm        = unused. | 
|  | 499 |  | 
|  | 500 | ISDN_STAT_ICALL: | 
|  | 501 | ISDN_STAT_ICALLW: | 
|  | 502 |  | 
|  | 503 | With this call, the HL-driver signals an incoming call to the LL. | 
|  | 504 | If ICALLW is signalled the incoming call is a waiting call without | 
|  | 505 | a available B-chan. | 
|  | 506 |  | 
|  | 507 | Parameter: | 
|  | 508 | driver            = driver-Id | 
|  | 509 | command           = ISDN_STAT_ICALL | 
|  | 510 | arg               = channel-number, locally to the driver. (starting with 0) | 
|  | 511 | para.setup.phone  = Callernumber. | 
|  | 512 | para.setup.eazmsn = CalledNumber. | 
|  | 513 | para.setup.si1    = Service Indicator. | 
|  | 514 | para.setup.si2    = Additional Service Indicator. | 
|  | 515 | para.setup.plan   = octet 3 from Calling party number Information Element. | 
|  | 516 | para.setup.screen = octet 3a from Calling party number Information Element. | 
|  | 517 |  | 
|  | 518 | Return: | 
|  | 519 | 0           = No device matching this call. | 
|  | 520 | 1           = At least one device matching this call (RING on ttyI). | 
|  | 521 | HL-driver may send ALERTING on the D-channel in this case. | 
|  | 522 | 2           = Call will be rejected. | 
|  | 523 | 3           = Incoming called party number is currently incomplete. | 
|  | 524 | Additional digits are required. | 
|  | 525 | Used for signalling with PtP connections. | 
|  | 526 | 4	          = Call will be held in a proceeding state | 
|  | 527 | (HL driver sends PROCEEDING) | 
|  | 528 | Used when a user space prog needs time to interpret a call | 
|  | 529 | para.setup.eazmsn may be filled with an uus1 message of | 
|  | 530 | 30 octets maximum. Empty string if no uus. | 
|  | 531 | 5           = Call will be actively deflected to another party | 
|  | 532 | Only available in DSS1/EURO protocol | 
|  | 533 | para.setup.phone must be set to destination party number | 
|  | 534 | para.setup.eazmsn may be filled with an uus1 message of | 
|  | 535 | 30 octets maximum. Empty string if no uus. | 
|  | 536 | -1          = An error happened. (Invalid parameters for example.) | 
|  | 537 | The keypad support now is included in the dial command. | 
|  | 538 |  | 
|  | 539 |  | 
|  | 540 | ISDN_STAT_RUN: | 
|  | 541 |  | 
|  | 542 | With this call, the HL-driver signals availability of the ISDN-card. | 
|  | 543 | (after initializing, loading firmware) | 
|  | 544 |  | 
|  | 545 | Parameter: | 
|  | 546 | driver      = driver-Id | 
|  | 547 | command     = ISDN_STAT_RUN | 
|  | 548 | arg         = unused. | 
|  | 549 | parm        = unused. | 
|  | 550 |  | 
|  | 551 | ISDN_STAT_STOP: | 
|  | 552 |  | 
|  | 553 | With this call, the HL-driver signals unavailability of the ISDN-card. | 
|  | 554 | (before unloading, while resetting/reconfiguring the card) | 
|  | 555 |  | 
|  | 556 | Parameter: | 
|  | 557 | driver      = driver-Id | 
|  | 558 | command     = ISDN_STAT_STOP | 
|  | 559 | arg         = unused. | 
|  | 560 | parm        = unused. | 
|  | 561 |  | 
|  | 562 | ISDN_STAT_DCONN: | 
|  | 563 |  | 
|  | 564 | With this call, the HL-driver signals the successful establishment of | 
|  | 565 | a D-Channel-connection. (Response to ISDN_CMD_ACCEPTD or ISDN_CMD_DIAL) | 
|  | 566 |  | 
|  | 567 | Parameter: | 
|  | 568 | driver      = driver-Id | 
|  | 569 | command     = ISDN_STAT_DCONN | 
|  | 570 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 571 | parm        = unused. | 
|  | 572 |  | 
|  | 573 | ISDN_STAT_BCONN: | 
|  | 574 |  | 
|  | 575 | With this call, the HL-driver signals the successful establishment of | 
|  | 576 | a B-Channel-connection. (Response to ISDN_CMD_ACCEPTB or because the | 
|  | 577 | remote-station has initiated establishment) | 
|  | 578 |  | 
|  | 579 | The HL driver should call this when the logical l2/l3 protocol | 
|  | 580 | connection on top of the physical B-channel is established. | 
|  | 581 |  | 
|  | 582 | Parameter: | 
|  | 583 | driver      = driver-Id | 
|  | 584 | command     = ISDN_STAT_BCONN | 
|  | 585 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 586 | parm.num    = ASCII-String, containing type of connection (for analog | 
|  | 587 | modem only). This will be appended to the CONNECT message | 
|  | 588 | e.g. 14400/V.32bis | 
|  | 589 |  | 
|  | 590 | ISDN_STAT_DHUP: | 
|  | 591 |  | 
|  | 592 | With this call, the HL-driver signals the shutdown of a | 
|  | 593 | D-Channel-connection. This could be a response to a prior ISDN_CMD_HANGUP, | 
|  | 594 | or caused by a remote-hangup or if the remote-station has actively | 
|  | 595 | rejected a call. | 
|  | 596 |  | 
|  | 597 | Parameter: | 
|  | 598 | driver      = driver-Id | 
|  | 599 | command     = ISDN_STAT_DHUP | 
|  | 600 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 601 | parm        = unused. | 
|  | 602 |  | 
|  | 603 | ISDN_STAT_BHUP: | 
|  | 604 |  | 
|  | 605 | With this call, the HL-driver signals the shutdown of a | 
|  | 606 | B-Channel-connection. This could be a response to a prior ISDN_CMD_HANGUP, | 
|  | 607 | or caused by a remote-hangup. | 
|  | 608 |  | 
|  | 609 | The HL driver should call this as soon as the logical l2/l3 protocol | 
|  | 610 | connection on top of the physical B-channel is released. | 
|  | 611 |  | 
|  | 612 | Parameter: | 
|  | 613 | driver      = driver-Id | 
|  | 614 | command     = ISDN_STAT_BHUP | 
|  | 615 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 616 | parm        = unused. | 
|  | 617 |  | 
|  | 618 | ISDN_STAT_CINF: | 
|  | 619 |  | 
|  | 620 | With this call, the HL-driver delivers charge-unit information to the | 
|  | 621 | LL. | 
|  | 622 |  | 
|  | 623 | Parameter: | 
|  | 624 | driver      = driver-Id | 
|  | 625 | command     = ISDN_STAT_CINF | 
|  | 626 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 627 | parm.num    = ASCII string containing charge-units (digits only). | 
|  | 628 |  | 
|  | 629 | ISDN_STAT_LOAD: (currently unused) | 
|  | 630 |  | 
|  | 631 | ISDN_STAT_UNLOAD: | 
|  | 632 |  | 
|  | 633 | With this call, the HL-driver signals that it will be unloaded now. This | 
|  | 634 | tells the LL to release all corresponding data-structures. | 
|  | 635 |  | 
|  | 636 | Parameter: | 
|  | 637 | driver      = driver-Id | 
|  | 638 | command     = ISDN_STAT_UNLOAD | 
|  | 639 | arg         = unused. | 
|  | 640 | parm        = unused. | 
|  | 641 |  | 
|  | 642 | ISDN_STAT_BSENT: | 
|  | 643 |  | 
|  | 644 | With this call the HL-driver signals the delivery of a data-packet. | 
|  | 645 | This callback is used by the network-interfaces only, tty-Emulation | 
|  | 646 | does not need this call. | 
|  | 647 |  | 
|  | 648 | Parameter: | 
|  | 649 | driver      = driver-Id | 
|  | 650 | command     = ISDN_STAT_BSENT | 
|  | 651 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 652 | parm.length = ***CHANGEI.1.21: New field. | 
|  | 653 | the driver has to set this to the original length | 
|  | 654 | of the skb at the time of receiving it from the linklevel. | 
|  | 655 |  | 
|  | 656 | ISDN_STAT_NODCH: | 
|  | 657 |  | 
|  | 658 | With this call, the driver has to respond to a prior ISDN_CMD_DIAL, if | 
|  | 659 | no D-Channel is available. | 
|  | 660 |  | 
|  | 661 | Parameter: | 
|  | 662 | driver      = driver-Id | 
|  | 663 | command     = ISDN_STAT_NODCH | 
|  | 664 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 665 | parm        = unused. | 
|  | 666 |  | 
|  | 667 | ISDN_STAT_ADDCH: | 
|  | 668 |  | 
|  | 669 | This call is for HL-drivers, which are unable to check card-type | 
|  | 670 | or numbers of supported channels before they have loaded any firmware | 
|  | 671 | using ioctl. Those HL-driver simply set the channel-parameter to a | 
|  | 672 | minimum channel-number when registering, and later if they know | 
|  | 673 | the real amount, perform this call, allocating additional channels. | 
|  | 674 |  | 
|  | 675 | Parameter: | 
|  | 676 | driver      = driver-Id | 
|  | 677 | command     = ISDN_STAT_ADDCH | 
|  | 678 | arg         = number of channels to be added. | 
|  | 679 | parm        = unused. | 
|  | 680 |  | 
|  | 681 | ISDN_STAT_CAUSE: | 
|  | 682 |  | 
|  | 683 | With this call, the HL-driver delivers CAUSE-messages to the LL. | 
|  | 684 | Currently the LL does not use this messages. Their contents is simply | 
|  | 685 | logged via kernel-messages. Therefore, currently the format of the | 
|  | 686 | messages is completely free. However they should be printable. | 
|  | 687 |  | 
|  | 688 | Parameter: | 
|  | 689 | driver      = driver-Id | 
|  | 690 | command     = ISDN_STAT_NODCH | 
|  | 691 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 692 | parm.num    = ASCII string containing CAUSE-message. | 
|  | 693 |  | 
|  | 694 | ISDN_STAT_DISPLAY: | 
|  | 695 |  | 
|  | 696 | With this call, the HL-driver delivers DISPLAY-messages to the LL. | 
|  | 697 | Currently the LL does not use this messages. | 
|  | 698 |  | 
|  | 699 | Parameter: | 
|  | 700 | driver      = driver-Id | 
|  | 701 | command     = ISDN_STAT_DISPLAY | 
|  | 702 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 703 | para.display= string containing DISPLAY-message. | 
|  | 704 |  | 
|  | 705 | ISDN_STAT_PROT: | 
|  | 706 |  | 
|  | 707 | With this call, the HL-driver delivers protocol specific infos to the LL. | 
|  | 708 | The call is not implicitely bound to a connection. | 
|  | 709 |  | 
|  | 710 | Parameter: | 
|  | 711 | driver      = driver-Id | 
|  | 712 | command     = ISDN_STAT_PROT | 
|  | 713 | arg         = The lower 8 Bits define the addressed protocol as defined | 
|  | 714 | in ISDN_PTYPE..., the upper bits are used to differentiate | 
|  | 715 | the protocol specific STAT. | 
|  | 716 |  | 
|  | 717 | para        = protocol and function specific. See isdnif.h for detail. | 
|  | 718 |  | 
|  | 719 | ISDN_STAT_DISCH: | 
|  | 720 |  | 
|  | 721 | With this call, the HL-driver signals the LL to disable or enable the | 
|  | 722 | use of supplied channel and driver. | 
|  | 723 | The call may be used to reduce the available number of B-channels after | 
|  | 724 | loading the driver. The LL has to ignore a disabled channel when searching | 
|  | 725 | for free channels. The HL driver itself never delivers STAT callbacks for | 
|  | 726 | disabled channels. | 
|  | 727 | The LL returns a nonzero code if the operation was not successful or the | 
|  | 728 | selected channel is actually regarded as busy. | 
|  | 729 |  | 
|  | 730 | Parameter: | 
|  | 731 | driver      = driver-Id | 
|  | 732 | command     = ISDN_STAT_DISCH | 
|  | 733 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 734 | parm.num[0] = 0 if channel shall be disabled, else enabled. | 
|  | 735 |  | 
|  | 736 | ISDN_STAT_L1ERR: | 
|  | 737 |  | 
|  | 738 | ***CHANGEI1.21 new status message. | 
|  | 739 | A signal can be sent to the linklevel if an Layer1-error results in | 
|  | 740 | packet-loss on receive or send. The field errcode of the cmd.parm | 
|  | 741 | union describes the error more precisely. | 
|  | 742 |  | 
|  | 743 | Parameter: | 
|  | 744 | driver      = driver-Id | 
|  | 745 | command     = ISDN_STAT_L1ERR | 
|  | 746 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 747 | parm.errcode= ISDN_STAT_L1ERR_SEND:     Packet lost while sending. | 
|  | 748 | ISDN_STAT_L1ERR_RECV:     Packet lost while receiving. | 
|  | 749 | ISDN_STAT_FAXIND: | 
|  | 750 |  | 
|  | 751 | With this call the HL-driver signals a fax sub-command to the LL. | 
|  | 752 | For details refer to INTERFACE.fax | 
|  | 753 |  | 
|  | 754 | Parameter: | 
|  | 755 | driver      = driver-Id. | 
|  | 756 | command     = ISDN_STAT_FAXIND | 
|  | 757 | arg         = channel-number, locally to the driver. (starting with 0) | 
|  | 758 | parm        = unused. | 
|  | 759 |  |