File: /usr/src/linux/drivers/isdn/hisax/l3ni1.h

1     // $Id: l3ni1.h,v 2.3.6.1 2001/02/16 16:43:28 kai Exp $
2     //-----------------------------------------------------------------------------
3     //
4     // NI1 D-channel protocol
5     //
6     // Author       Matt Henderson & Guy Ellis - Traverse Tecnologies Pty Ltd
7     //              www.traverse.com.au
8     //
9     // 2000.6.6 Initial implementation of routines for US NI1 
10     // Layer 3 protocol based on the EURO/DSS1 D-channel protocol 
11     // driver written by Karsten Keil et al.  Thanks also for the 
12     // code provided by Ragnar Paulson.
13     //
14     //
15     // This file is (c) under GNU General Public License
16     //
17     //-----------------------------------------------------------------------------
18     
19     #ifndef l3ni1_process
20     
21     #define T302	15000
22     #define T303	4000
23     #define T304	30000
24     #define T305	30000
25     #define T308	4000
26     /* for layer 1 certification T309 < layer1 T3 (e.g. 4000) */
27     /* This makes some tests easier and quicker */
28     #define T309	40000
29     #define T310	30000
30     #define T313	4000
31     #define T318	4000
32     #define T319	4000
33     #define TSPID	5000 /* was 2000 - Guy Ellis */
34     
35     /*
36      * Message-Types
37      */
38     
39     #define MT_ALERTING		0x01
40     #define MT_CALL_PROCEEDING	0x02
41     #define MT_CONNECT		0x07
42     #define MT_CONNECT_ACKNOWLEDGE	0x0f
43     #define MT_PROGRESS		0x03
44     #define MT_SETUP		0x05
45     #define MT_SETUP_ACKNOWLEDGE	0x0d
46     #define MT_RESUME		0x26
47     #define MT_RESUME_ACKNOWLEDGE	0x2e
48     #define MT_RESUME_REJECT	0x22
49     #define MT_SUSPEND		0x25
50     #define MT_SUSPEND_ACKNOWLEDGE	0x2d
51     #define MT_SUSPEND_REJECT	0x21
52     #define MT_USER_INFORMATION	0x20
53     #define MT_DISCONNECT		0x45
54     #define MT_RELEASE		0x4d
55     #define MT_RELEASE_COMPLETE	0x5a
56     #define MT_RESTART		0x46
57     #define MT_RESTART_ACKNOWLEDGE	0x4e
58     #define MT_SEGMENT		0x60
59     #define MT_CONGESTION_CONTROL	0x79
60     #define MT_INFORMATION		0x7b
61     #define MT_FACILITY		0x62
62     #define MT_NOTIFY		0x6e
63     #define MT_STATUS		0x7d
64     #define MT_STATUS_ENQUIRY	0x75
65     #define MT_DL_ESTABLISHED	0xfe
66     
67     #define IE_SEGMENT	0x00
68     #define IE_BEARER	0x04
69     #define IE_CAUSE	0x08
70     #define IE_CALL_ID	0x10
71     #define IE_CALL_STATE	0x14
72     #define IE_CHANNEL_ID	0x18
73     #define IE_FACILITY	0x1c
74     #define IE_PROGRESS	0x1e
75     #define IE_NET_FAC	0x20
76     #define IE_NOTIFY	0x27
77     #define IE_DISPLAY	0x28
78     #define IE_DATE		0x29
79     #define IE_KEYPAD	0x2c
80     #define IE_SIGNAL	0x34
81     #define IE_SPID		0x3a
82     #define IE_ENDPOINT_ID	0x3b
83     #define IE_INFORATE	0x40
84     #define IE_E2E_TDELAY	0x42
85     #define IE_TDELAY_SEL	0x43
86     #define IE_PACK_BINPARA	0x44
87     #define IE_PACK_WINSIZE	0x45
88     #define IE_PACK_SIZE	0x46
89     #define IE_CUG		0x47
90     #define	IE_REV_CHARGE	0x4a
91     #define IE_CONNECT_PN	0x4c
92     #define IE_CONNECT_SUB	0x4d
93     #define IE_CALLING_PN	0x6c
94     #define IE_CALLING_SUB	0x6d
95     #define IE_CALLED_PN	0x70
96     #define IE_CALLED_SUB	0x71
97     #define IE_REDIR_NR	0x74
98     #define IE_TRANS_SEL	0x78
99     #define IE_RESTART_IND	0x79
100     #define IE_LLC		0x7c
101     #define IE_HLC		0x7d
102     #define IE_USER_USER	0x7e
103     #define IE_ESCAPE	0x7f
104     #define IE_SHIFT	0x90
105     #define IE_MORE_DATA	0xa0
106     #define IE_COMPLETE	0xa1
107     #define IE_CONGESTION	0xb0
108     #define IE_REPEAT	0xd0
109     
110     #define IE_MANDATORY	0x0100
111     /* mandatory not in every case */
112     #define IE_MANDATORY_1	0x0200
113     
114     #define ERR_IE_COMPREHENSION	 1
115     #define ERR_IE_UNRECOGNIZED	-1
116     #define ERR_IE_LENGTH		-2
117     #define ERR_IE_SEQUENCE		-3
118     
119     #else /* only l3ni1_process */
120     
121     /* l3ni1 specific data in l3 process */
122     typedef struct
123       { unsigned char invoke_id; /* used invoke id in remote ops, 0 = not active */
124         ulong ll_id; /* remebered ll id */
125         u_char remote_operation; /* handled remote operation, 0 = not active */ 
126         int proc; /* rememered procedure */  
127         ulong remote_result; /* result of remote operation for statcallb */
128         char uus1_data[35]; /* data send during alerting or disconnect */
129       } ni1_proc_priv;
130     
131     /* l3dni1 specific data in protocol stack */
132     typedef struct
133       { unsigned char last_invoke_id; /* last used value for invoking */
134         unsigned char invoke_used[32]; /* 256 bits for 256 values */
135       } ni1_stk_priv;        
136     
137     #endif /* only l3dni1_process */
138