aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn/hardware/eicon/capi20.h
blob: 7ebcccda74d842187c726a35d1c03f270044f47c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
/*
 *
  Copyright (c) Eicon Networks, 2002.
 *
  This source file is supplied for the use with
  Eicon Networks range of DIVA Server Adapters.
 *
  Eicon File Revision :    2.1
 *
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2, or (at your option)
  any later version.
 *
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.
 *
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
#ifndef _INC_CAPI20  
#define _INC_CAPI20
        /* operations on message queues                             */
        /* the common device type for CAPI20 drivers */
#define FILE_DEVICE_CAPI20 0x8001
        /* DEVICE_CONTROL codes for user and kernel mode applications */
#define CAPI20_CTL_REGISTER             0x0801
#define CAPI20_CTL_RELEASE              0x0802
#define CAPI20_CTL_GET_MANUFACTURER     0x0805
#define CAPI20_CTL_GET_VERSION          0x0806
#define CAPI20_CTL_GET_SERIAL           0x0807
#define CAPI20_CTL_GET_PROFILE          0x0808
        /* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */
#define CAPI20_CTL_PUT_MESSAGE          0x0803
#define CAPI20_CTL_GET_MESSAGE          0x0804
        /* the wrapped codes as required by the system */
#define CAPI_CTL_CODE(f,m)              CTL_CODE(FILE_DEVICE_CAPI20,f,m,FILE_ANY_ACCESS)
#define IOCTL_CAPI_REGISTER             CAPI_CTL_CODE(CAPI20_CTL_REGISTER,METHOD_BUFFERED)
#define IOCTL_CAPI_RELEASE              CAPI_CTL_CODE(CAPI20_CTL_RELEASE,METHOD_BUFFERED)
#define IOCTL_CAPI_GET_MANUFACTURER     CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER,METHOD_BUFFERED)
#define IOCTL_CAPI_GET_VERSION          CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION,METHOD_BUFFERED)
#define IOCTL_CAPI_GET_SERIAL           CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL,METHOD_BUFFERED)
#define IOCTL_CAPI_GET_PROFILE          CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE,METHOD_BUFFERED)
#define IOCTL_CAPI_PUT_MESSAGE          CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE,METHOD_BUFFERED)
#define IOCTL_CAPI_GET_MESSAGE          CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE,METHOD_BUFFERED)
struct divas_capi_register_params  {
  word MessageBufferSize;
  word maxLogicalConnection;
  word maxBDataBlocks;
  word maxBDataLen;
};
struct divas_capi_version  {
  word CapiMajor;
  word CapiMinor;
  word ManuMajor;
  word ManuMinor;
};
typedef struct api_profile_s {
  word          Number;
  word          Channels;
  dword         Global_Options;
  dword         B1_Protocols;
  dword         B2_Protocols;
  dword         B3_Protocols;
} API_PROFILE;
        /* ISDN Common API message types                            */
#define _ALERT_R                        0x8001
#define _CONNECT_R                      0x8002
#define _CONNECT_I                      0x8202
#define _CONNECT_ACTIVE_I               0x8203
#define _DISCONNECT_R                   0x8004
#define _DISCONNECT_I                   0x8204
#define _LISTEN_R                       0x8005
#define _INFO_R                         0x8008
#define _INFO_I                         0x8208
#define _SELECT_B_REQ                   0x8041
#define _FACILITY_R                     0x8080
#define _FACILITY_I                     0x8280
#define _CONNECT_B3_R                   0x8082
#define _CONNECT_B3_I                   0x8282
#define _CONNECT_B3_ACTIVE_I            0x8283
#define _DISCONNECT_B3_R                0x8084
#define _DISCONNECT_B3_I                0x8284
#define _DATA_B3_R                      0x8086
#define _DATA_B3_I                      0x8286
#define _RESET_B3_R                     0x8087
#define _RESET_B3_I                     0x8287
#define _CONNECT_B3_T90_ACTIVE_I        0x8288
#define _MANUFACTURER_R                 0x80ff
#define _MANUFACTURER_I                 0x82ff
        /* OR this to convert a REQUEST to a CONFIRM                */
#define CONFIRM                 0x0100
        /* OR this to convert a INDICATION to a RESPONSE            */
#define RESPONSE                0x0100
/*------------------------------------------------------------------*/
/* diehl isdn private MANUFACTURER codes                            */
/*------------------------------------------------------------------*/
#define _DI_MANU_ID             0x44444944
#define _DI_ASSIGN_PLCI         0x0001
#define _DI_ADV_CODEC           0x0002
#define _DI_DSP_CTRL            0x0003
#define _DI_SIG_CTRL            0x0004
#define _DI_RXT_CTRL            0x0005
#define _DI_IDI_CTRL            0x0006
#define _DI_CFG_CTRL            0x0007
#define _DI_REMOVE_CODEC        0x0008
#define _DI_OPTIONS_REQUEST     0x0009
#define _DI_SSEXT_CTRL          0x000a
#define _DI_NEGOTIATE_B3        0x000b
/*------------------------------------------------------------------*/
/* parameter structures                                             */
/*------------------------------------------------------------------*/
        /* ALERT-REQUEST                                            */
typedef struct {
  byte structs[1];      /* Additional Info */
} _ALT_REQP;
        /* ALERT-CONFIRM                                            */
typedef struct {
  word Info;
} _ALT_CONP;
        /* CONNECT-REQUEST                                          */
typedef struct {
  word CIP_Value;
  byte structs[1];      /* Called party number,
                           Called party subaddress,
                           Calling party number,
                           Calling party subaddress,
                           B_protocol,
                           BC,
                           LLC,
                           HLC,
                           Additional Info */
} _CON_REQP;
        /* CONNECT-CONFIRM                                          */
typedef struct {
  word Info;
} _CON_CONP;
        /* CONNECT-INDICATION                                       */
typedef struct {
  word CIP_Value;
  byte structs[1];      /* Called party number,
                           Called party subaddress,
                           Calling party number,
                           Calling party subaddress,
                           BC,
                           LLC,
                           HLC,
                           Additional Info */
} _CON_INDP;
        /* CONNECT-RESPONSE                                         */
typedef struct {
  word Accept;
  byte structs[1];      /* B_protocol,
                           Connected party number,
                           Connected party subaddress,
                           LLC */
} _CON_RESP;
        /* CONNECT-ACTIVE-INDICATION                                */
typedef struct {
  byte structs[1];      /* Connected party number,
                           Connected party subaddress,
                           LLC */
} _CON_A_INDP;
        /* CONNECT-ACTIVE-RESPONSE                                  */
typedef struct {
  byte structs[1];      /* empty */
} _CON_A_RESP;
        /* DISCONNECT-REQUEST                                       */
typedef struct {
  byte structs[1];      /* Additional Info */
} _DIS_REQP;
        /* DISCONNECT-CONFIRM                                       */
typedef struct {
  word Info;
} _DIS_CONP;
        /* DISCONNECT-INDICATION                                    */
typedef struct {
  word Info;
} _DIS_INDP;
        /* DISCONNECT-RESPONSE                                      */
typedef struct {
  byte structs[1];      /* empty */
} _DIS_RESP;
        /* LISTEN-REQUEST                                           */
typedef struct {
  dword Info_Mask;
  dword CIP_Mask;
  byte structs[1];      /* Calling party number,
                           Calling party subaddress */
} _LIS_REQP;
        /* LISTEN-CONFIRM                                           */
typedef struct {
  word Info;
} _LIS_CONP;
        /* INFO-REQUEST                                             */
typedef struct {
  byte structs[1];      /* Called party number,
                           Additional Info */
} _INF_REQP;
        /* INFO-CONFIRM                                             */
typedef struct {
  word Info;
} _INF_CONP;
        /* INFO-INDICATION                                          */
typedef struct {
  word Number;
  byte structs[1];      /* Info element */
} _INF_INDP;
        /* INFO-RESPONSE                                            */
typedef struct {
  byte structs[1];      /* empty */
} _INF_RESP;
        /* SELECT-B-REQUEST                                         */
typedef struct {
  byte structs[1];      /* B-protocol */
} _SEL_B_REQP;
        /* SELECT-B-CONFIRM                                         */
typedef struct {
  word Info;
} _SEL_B_CONP;
        /* FACILITY-REQUEST */
typedef struct {
  word Selector;
  byte structs[1];      /* Facility parameters */
} _FAC_REQP;
        /* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
typedef struct {
  byte  struct_length;
  word  function;
  byte  length;
  word  SupplementaryServiceInfo;
  dword SupportedServices;
} _FAC_CON_STRUCTS;
        /* FACILITY-CONFIRM */
typedef struct {
  word Info;
  word Selector;
  byte structs[1];      /* Facility parameters */
} _FAC_CONP;
        /* FACILITY-INDICATION */
typedef struct {
  word Selector;
  byte structs[1];      /* Facility parameters */
} _FAC_INDP;
        /* FACILITY-RESPONSE */
typedef struct {
  word Selector;
  byte structs[1];      /* Facility parameters */
} _FAC_RESP;
        /* CONNECT-B3-REQUEST                                       */
typedef struct {
  byte structs[1];      /* NCPI */
} _CON_B3_REQP;
        /* CONNECT-B3-CONFIRM                                       */
typedef struct {
  word Info;
} _CON_B3_CONP;
        /* CONNECT-B3-INDICATION                                    */
typedef struct {
  byte structs[1];      /* NCPI */
} _CON_B3_INDP;
        /* CONNECT-B3-RESPONSE                                      */
typedef struct {
  word Accept;
  byte structs[1];      /* NCPI */
} _CON_B3_RESP;
        /* CONNECT-B3-ACTIVE-INDICATION                             */
typedef struct {
  byte structs[1];      /* NCPI */
} _CON_B3_A_INDP;
        /* CONNECT-B3-ACTIVE-RESPONSE                               */
typedef struct {
  byte structs[1];      /* empty */
} _CON_B3_A_RESP;
        /* DISCONNECT-B3-REQUEST                                    */
typedef struct {
  byte structs[1];      /* NCPI */
} _DIS_B3_REQP;
        /* DISCONNECT-B3-CONFIRM                                    */
typedef struct {
  word Info;
} _DIS_B3_CONP;
        /* DISCONNECT-B3-INDICATION                                 */
typedef struct {
  word Info;
  byte structs[1];      /* NCPI */
} _DIS_B3_INDP;
        /* DISCONNECT-B3-RESPONSE                                   */
typedef