File: /usr/src/linux/drivers/isdn/pcbit/capi.h
1 /*
2 * Copyright (C) 1996 Universidade de Lisboa
3 *
4 * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
5 *
6 * This software may be used and distributed according to the terms of
7 * the GNU General Public License, incorporated herein by reference.
8 */
9
10 /*
11 * CAPI encode/decode prototypes and defines
12 */
13
14 #ifndef CAPI_H
15 #define CAPI_H
16
17
18 #define REQ_CAUSE 0x01
19 #define REQ_DISPLAY 0x04
20 #define REQ_USER_TO_USER 0x08
21
22 #define AppInfoMask REQ_CAUSE|REQ_DISPLAY|REQ_USER_TO_USER
23
24 /* Connection Setup */
25 extern int capi_conn_req(const char * calledPN, struct sk_buff **buf,
26 int proto);
27 extern int capi_decode_conn_conf(struct pcbit_chan * chan, struct sk_buff *skb,
28 int *complete);
29
30 extern int capi_decode_conn_ind(struct pcbit_chan * chan, struct sk_buff *skb,
31 struct callb_data *info);
32 extern int capi_conn_resp(struct pcbit_chan* chan, struct sk_buff **skb);
33
34 extern int capi_conn_active_req(struct pcbit_chan* chan, struct sk_buff **skb);
35 extern int capi_decode_conn_actv_conf(struct pcbit_chan * chan,
36 struct sk_buff *skb);
37
38 extern int capi_decode_conn_actv_ind(struct pcbit_chan * chan,
39 struct sk_buff *skb);
40 extern int capi_conn_active_resp(struct pcbit_chan* chan,
41 struct sk_buff **skb);
42
43 /* Data */
44 extern int capi_select_proto_req(struct pcbit_chan *chan, struct sk_buff **skb,
45 int outgoing);
46 extern int capi_decode_sel_proto_conf(struct pcbit_chan *chan,
47 struct sk_buff *skb);
48
49 extern int capi_activate_transp_req(struct pcbit_chan *chan,
50 struct sk_buff **skb);
51 extern int capi_decode_actv_trans_conf(struct pcbit_chan *chan,
52 struct sk_buff *skb);
53
54 extern int capi_tdata_req(struct pcbit_chan* chan, struct sk_buff *skb);
55 extern int capi_tdata_resp(struct pcbit_chan *chan, struct sk_buff ** skb);
56
57 /* Connection Termination */
58 extern int capi_disc_req(ushort callref, struct sk_buff **skb, u_char cause);
59 extern int capi_decode_disc_conf(struct pcbit_chan *chan, struct sk_buff *skb);
60
61 extern int capi_decode_disc_ind(struct pcbit_chan *chan, struct sk_buff *skb);
62 extern int capi_disc_resp(struct pcbit_chan *chan, struct sk_buff **skb);
63
64 #ifdef DEBUG
65 extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen);
66 #endif
67
68 extern __inline__
69 struct pcbit_chan *
70 capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
71 {
72 ushort callref;
73
74 callref = *((ushort*) skb->data);
75 skb_pull(skb, 2);
76
77 if (dev->b1->callref == callref)
78 return dev->b1;
79 else if (dev->b2->callref == callref)
80 return dev->b2;
81
82 return NULL;
83 }
84
85 #endif
86
87
88
89
90
91
92