File: /usr/src/linux/drivers/isdn/eicon/pc.h

1     
2     /*
3      *
4      * Copyright (C) Eicon Technology Corporation, 2000.
5      *
6      * Eicon File Revision :    1.2  
7      *
8      * This program is free software; you can redistribute it and/or modify
9      * it under the terms of the GNU General Public License as published by
10      * the Free Software Foundation; either version 2, or (at your option)
11      * any later version.
12      *
13      * This program is distributed in the hope that it will be useful,
14      * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY 
15      * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
16      * See the GNU General Public License for more details.
17      *
18      * You should have received a copy of the GNU General Public License
19      * along with this program; if not, write to the Free Software
20      * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21      *
22      */
23     
24     
25     #ifndef PC_H_INCLUDED
26     #define PC_H_INCLUDED
27     
28     
29     #define byte unsigned char
30     #define word unsigned short
31     #define dword unsigned long
32     
33     /*------------------------------------------------------------------*/
34     /* buffer definition                                                */
35     /*------------------------------------------------------------------*/
36     
37     typedef struct {
38       word length;          /* length of data/parameter field           */
39       byte P[270];          /* data/parameter field                     */
40     } PBUFFER;
41     
42     /*------------------------------------------------------------------*/
43     /* dual port ram structure                                          */
44     /*------------------------------------------------------------------*/
45     
46     struct dual
47     {
48       byte Req;             /* request register                         */
49       byte ReqId;           /* request task/entity identification       */
50       byte Rc;              /* return code register                     */
51       byte RcId;            /* return code task/entity identification   */
52       byte Ind;             /* Indication register                      */
53       byte IndId;           /* Indication task/entity identification    */
54       byte IMask;           /* Interrupt Mask Flag                      */
55       byte RNR;             /* Receiver Not Ready (set by PC)           */
56       byte XLock;           /* XBuffer locked Flag                      */
57       byte Int;             /* ISDN-S interrupt                         */
58       byte ReqCh;           /* Channel field for layer-3 Requests       */
59       byte RcCh;            /* Channel field for layer-3 Returncodes    */
60       byte IndCh;           /* Channel field for layer-3 Indications    */
61       byte MInd;            /* more data indication field               */
62       word MLength;         /* more data total packet length            */
63       byte ReadyInt;        /* request field for ready interrupt        */
64       byte SWReg;           /* Software register for special purposes   */  
65       byte Reserved[11];    /* reserved space                           */
66       byte InterfaceType;   /* interface type 1=16K interface           */
67       word Signature;       /* ISDN-S adapter Signature (GD)            */
68       PBUFFER XBuffer;      /* Transmit Buffer                          */
69       PBUFFER RBuffer;      /* Receive Buffer                           */
70     };
71     
72     /*------------------------------------------------------------------*/
73     /* SWReg Values (0 means no command)                                */
74     /*------------------------------------------------------------------*/
75     #define SWREG_DIE_WITH_LEDON  0x01
76     #define SWREG_HALT_CPU        0x02 /* Push CPU into a while(1) loop */         
77     
78     /*------------------------------------------------------------------*/
79     /* Id Fields Coding                                                 */
80     /*------------------------------------------------------------------*/
81     
82     #define ID_MASK 0xe0    /* Mask for the ID field                    */
83     #define GL_ERR_ID 0x1f  /* ID for error reporting on global requests*/
84     
85     #define DSIG_ID  0x00   /* ID for D-channel signaling               */
86     #define NL_ID    0x20   /* ID for network-layer access (B or D)     */
87     #define BLLC_ID  0x60   /* ID for B-channel link level access       */
88     #define TASK_ID  0x80   /* ID for dynamic user tasks                */
89     #define TIMER_ID 0xa0   /* ID for timer task                        */
90     #define TEL_ID   0xc0   /* ID for telephone support                 */
91     #define MAN_ID   0xe0   /* ID for management                        */
92     
93     /*------------------------------------------------------------------*/
94     /* ASSIGN and REMOVE requests are the same for all entities         */
95     /*------------------------------------------------------------------*/
96     
97     #define ASSIGN  0x01
98     #define UREMOVE  0xfe   /* without returncode */  
99     #define REMOVE  0xff
100     
101     /*------------------------------------------------------------------*/
102     /* Timer Interrupt Task Interface                                   */
103     /*------------------------------------------------------------------*/
104     
105     #define ASSIGN_TIM 0x01
106     #define REMOVE_TIM 0xff
107     
108     /*------------------------------------------------------------------*/
109     /* dynamic user task interface                                      */
110     /*------------------------------------------------------------------*/
111     
112     #define ASSIGN_TSK 0x01
113     #define REMOVE_TSK 0xff
114     
115     #define LOAD 0xf0
116     #define RELOCATE 0xf1
117     #define START 0xf2
118     #define LOAD2 0xf3
119     #define RELOCATE2 0xf4
120     
121     /*------------------------------------------------------------------*/
122     /* dynamic user task messages                                       */
123     /*------------------------------------------------------------------*/
124     
125     #define TSK_B2          0x0000
126     #define TSK_WAKEUP      0x2000
127     #define TSK_TIMER       0x4000
128     #define TSK_TSK         0x6000
129     #define TSK_PC          0xe000
130     
131     /*------------------------------------------------------------------*/
132     /* LL management primitives                                         */
133     /*------------------------------------------------------------------*/
134     
135     #define ASSIGN_LL 1     /* assign logical link                      */
136     #define REMOVE_LL 0xff  /* remove logical link                      */
137     
138     /*------------------------------------------------------------------*/
139     /* LL service primitives                                            */
140     /*------------------------------------------------------------------*/
141     
142     #define LL_UDATA 1      /* link unit data request/indication        */
143     #define LL_ESTABLISH 2  /* link establish request/indication        */
144     #define LL_RELEASE 3    /* link release request/indication          */
145     #define LL_DATA 4       /* data request/indication                  */
146     #define LL_LOCAL 5      /* switch to local operation (COM only)     */
147     #define LL_DATA_PEND 5  /* data pending indication (SDLC SHM only)  */
148     #define LL_REMOTE 6     /* switch to remote operation (COM only)    */
149     #define LL_TEST 8       /* link test request                        */
150     #define LL_MDATA 9      /* more data request/indication             */
151     #define LL_BUDATA 10    /* broadcast unit data request/indication   */
152     #define LL_XID 12       /* XID command request/indication           */
153     #define LL_XID_R 13     /* XID response request/indication          */
154     
155     /*------------------------------------------------------------------*/
156     /* NL service primitives                                            */
157     /*------------------------------------------------------------------*/
158     
159     #define N_MDATA         1       /* more data to come REQ/IND        */
160     #define N_CONNECT       2       /* OSI N-CONNECT REQ/IND            */
161     #define N_CONNECT_ACK   3       /* OSI N-CONNECT CON/RES            */
162     #define N_DISC          4       /* OSI N-DISC REQ/IND               */
163     #define N_DISC_ACK      5       /* OSI N-DISC CON/RES               */
164     #define N_RESET         6       /* OSI N-RESET REQ/IND              */
165     #define N_RESET_ACK     7       /* OSI N-RESET CON/RES              */
166     #define N_DATA          8       /* OSI N-DATA REQ/IND               */
167     #define N_EDATA         9       /* OSI N-EXPEDITED DATA REQ/IND     */
168     #define N_UDATA         10      /* OSI D-UNIT-DATA REQ/IND          */
169     #define N_BDATA         11      /* BROADCAST-DATA REQ/IND           */
170     #define N_DATA_ACK      12      /* data ack ind for D-bit procedure */
171     #define N_EDATA_ACK     13      /* data ack ind for INTERRUPT       */
172     
173     #define N_Q_BIT         0x10    /* Q-bit for req/ind                */
174     #define N_M_BIT         0x20    /* M-bit for req/ind                */
175     #define N_D_BIT         0x40    /* D-bit for req/ind                */
176     
177     /*------------------------------------------------------------------*/
178     /* Signaling management primitives                                  */
179     /*------------------------------------------------------------------*/
180     
181     #define ASSIGN_SIG 1    /* assign signaling task                    */
182     #define UREMOVE_SIG 0xfe /* remove signaling task without returncode */
183     #define REMOVE_SIG 0xff /* remove signaling task                    */
184     
185     /*------------------------------------------------------------------*/
186     /* Signaling service primitives                                     */
187     /*------------------------------------------------------------------*/
188     
189     #define CALL_REQ 1      /* call request                             */
190     #define CALL_CON 1      /* call confirmation                        */
191     #define CALL_IND 2      /* incoming call connected                  */
192     #define LISTEN_REQ 2    /* listen request                           */
193     #define HANGUP 3        /* hangup request/indication                */
194     #define SUSPEND 4       /* call suspend request/confirm             */
195     #define RESUME 5        /* call resume request/confirm              */
196     #define SUSPEND_REJ 6   /* suspend rejected indication              */
197     #define USER_DATA 8     /* user data for user to user signaling     */
198     #define CONGESTION 9    /* network congestion indication            */
199     #define INDICATE_REQ 10 /* request to indicate an incoming call     */
200     #define INDICATE_IND 10 /* indicates that there is an incoming call */
201     #define CALL_RES 11     /* accept an incoming call                  */
202     #define CALL_ALERT 12   /* send ALERT for incoming call             */
203     #define INFO_REQ 13     /* INFO request                             */
204     #define INFO_IND 13     /* INFO indication                          */
205     #define REJECT 14       /* reject an incoming call                  */
206     #define RESOURCES 15    /* reserve B-Channel hardware resources     */
207     #define TEL_CTRL 16     /* Telephone control request/indication     */
208     #define STATUS_REQ 17   /* Request D-State (returned in INFO_IND)   */
209     #define FAC_REG_REQ 18  /* connection idependent fac registration   */
210     #define FAC_REG_ACK 19  /* fac registration acknowledge             */
211     #define FAC_REG_REJ 20  /* fac registration reject                  */
212     #define CALL_COMPLETE 21/* send a CALL_PROC for incoming call       */
213     #define FACILITY_REQ 22 /* send a Facility Message type             */
214     #define FACILITY_IND 22 /* Facility Message type indication         */
215     #define SIG_CTRL     29 /* Control for signalling hardware          */
216     #define DSP_CTRL     30 /* Control for DSPs                         */
217     #define LAW_REQ      31 /* Law config request for (returns info_i)  */ 
218     
219      
220     /*------------------------------------------------------------------*/
221     /* management service primitives                                    */
222     /*------------------------------------------------------------------*/
223     
224     #define MAN_READ        2
225     #define MAN_WRITE       3
226     #define MAN_EXECUTE     4
227     #define MAN_EVENT_ON    5
228     #define MAN_EVENT_OFF   6
229     #define MAN_LOCK        7
230     #define MAN_UNLOCK      8   
231     
232     #define MAN_INFO_IND    2
233     #define MAN_EVENT_IND   3
234     #define MAN_TRACE_IND   4  
235     
236     #define MAN_ESC         0x80
237     
238     /*------------------------------------------------------------------*/
239     /* return code coding                                               */
240     /*------------------------------------------------------------------*/
241     
242     #define UNKNOWN_COMMAND         0x01    /* unknown command          */
243     #define WRONG_COMMAND           0x02    /* wrong command            */
244     #define WRONG_ID                0x03    /* unknown task/entity id   */
245     #define WRONG_CH                0x04    /* wrong task/entity id     */
246     #define UNKNOWN_IE              0x05    /* unknown information el.  */
247     #define WRONG_IE                0x06    /* wrong information el.    */
248     #define OUT_OF_RESOURCES        0x07    /* ISDN-S card out of res.  */
249     #define ADAPTER_DEAD            0x08    /* ISDN card CPU halted     */ 
250     #define N_FLOW_CONTROL          0x10    /* Flow-Control, retry      */
251     #define ASSIGN_RC               0xe0    /* ASSIGN acknowledgement   */
252     #define ASSIGN_OK               0xef    /* ASSIGN OK                */
253     #define OK_FC                   0xfc    /* Flow-Control RC          */
254     #define READY_INT               0xfd    /* Ready interrupt          */
255     #define TIMER_INT               0xfe    /* timer interrupt          */
256     #define OK                      0xff    /* command accepted         */
257     
258     /*------------------------------------------------------------------*/
259     /* information elements                                             */
260     /*------------------------------------------------------------------*/
261     
262     #define SHIFT 0x90              /* codeset shift                    */
263     #define MORE 0xa0               /* more data                        */
264     #define CL 0xb0                 /* congestion level                 */
265     
266             /* codeset 0                                                */
267     
268     #define BC  0x04                /* Bearer Capability                */
269     #define CAU 0x08                /* cause                            */
270     #define CAD 0x0c                /* Connected address                */
271     #define CAI 0x10                /* call identity                    */
272     #define CHI 0x18                /* channel identification           */
273     #define LLI 0x19                /* logical link id                  */
274     #define CHA 0x1a                /* charge advice                    */
275     #define DT  0x29                /* ETSI date/time                   */
276     #define KEY 0x2c                /* keypad information element       */
277     #define FTY 0x1c                /* facility information element     */ 
278     #define DSP 0x28                /* display                          */
279     #define OAD 0x6c                /* origination address              */
280     #define OSA 0x6d                /* origination sub-address          */
281     #define CPN 0x70                /* called party number              */
282     #define DSA 0x71                /* destination sub-address          */
283     #define RDX 0x73                /* redirected number extended       */
284     #define RDN 0x74                /* redirected number                */  
285     #define LLC 0x7c                /* low layer compatibility          */
286     #define HLC 0x7d                /* high layer compatibility         */
287     #define UUI 0x7e                /* user user information            */
288     #define ESC 0x7f                /* escape extension                 */
289     
290     #define DLC 0x20                /* data link layer configuration    */
291     #define NLC 0x21                /* network layer configuration      */
292     
293             /* codeset 6                                                */
294     
295     #define SIN 0x01                /* service indicator                */
296     #define CIF 0x02                /* charging information             */
297     #define DATE 0x03               /* date                             */
298     #define CPS 0x07                /* called party status              */
299     
300     /*------------------------------------------------------------------*/
301     /* TEL_CTRL contents                                                */
302     /*------------------------------------------------------------------*/
303     
304     #define RING_ON         0x01
305     #define RING_OFF        0x02
306     #define HANDS_FREE_ON   0x03
307     #define HANDS_FREE_OFF  0x04
308     #define ON_HOOK         0x80
309     #define OFF_HOOK        0x90
310     
311     #endif
312