aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/isdn
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/isdn
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/isdn')
-rw-r--r--include/linux/isdn/capicmd.h115
-rw-r--r--include/linux/isdn/capilli.h113
-rw-r--r--include/linux/isdn/capiutil.h505
-rw-r--r--include/linux/isdn/tpam.h56
4 files changed, 789 insertions, 0 deletions
diff --git a/include/linux/isdn/capicmd.h b/include/linux/isdn/capicmd.h
new file mode 100644
index 000000000000..b58635f722da
--- /dev/null
+++ b/include/linux/isdn/capicmd.h
@@ -0,0 +1,115 @@
1/* $Id: capicmd.h,v 1.2.6.2 2001/09/23 22:24:33 kai Exp $
2 *
3 * CAPI 2.0 Interface for Linux
4 *
5 * Copyright 1997 by Carsten Paeth <calle@calle.de>
6 *
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
9 *
10 */
11
12#ifndef __CAPICMD_H__
13#define __CAPICMD_H__
14
15#define CAPI_MSG_BASELEN 8
16#define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2)
17#define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2)
18
19/*----- CAPI commands -----*/
20#define CAPI_ALERT 0x01
21#define CAPI_CONNECT 0x02
22#define CAPI_CONNECT_ACTIVE 0x03
23#define CAPI_CONNECT_B3_ACTIVE 0x83
24#define CAPI_CONNECT_B3 0x82
25#define CAPI_CONNECT_B3_T90_ACTIVE 0x88
26#define CAPI_DATA_B3 0x86
27#define CAPI_DISCONNECT_B3 0x84
28#define CAPI_DISCONNECT 0x04
29#define CAPI_FACILITY 0x80
30#define CAPI_INFO 0x08
31#define CAPI_LISTEN 0x05
32#define CAPI_MANUFACTURER 0xff
33#define CAPI_RESET_B3 0x87
34#define CAPI_SELECT_B_PROTOCOL 0x41
35
36/*----- CAPI subcommands -----*/
37
38#define CAPI_REQ 0x80
39#define CAPI_CONF 0x81
40#define CAPI_IND 0x82
41#define CAPI_RESP 0x83
42
43/*----- CAPI combined commands -----*/
44
45#define CAPICMD(cmd,subcmd) (((cmd)<<8)|(subcmd))
46
47#define CAPI_DISCONNECT_REQ CAPICMD(CAPI_DISCONNECT,CAPI_REQ)
48#define CAPI_DISCONNECT_CONF CAPICMD(CAPI_DISCONNECT,CAPI_CONF)
49#define CAPI_DISCONNECT_IND CAPICMD(CAPI_DISCONNECT,CAPI_IND)
50#define CAPI_DISCONNECT_RESP CAPICMD(CAPI_DISCONNECT,CAPI_RESP)
51
52#define CAPI_ALERT_REQ CAPICMD(CAPI_ALERT,CAPI_REQ)
53#define CAPI_ALERT_CONF CAPICMD(CAPI_ALERT,CAPI_CONF)
54
55#define CAPI_CONNECT_REQ CAPICMD(CAPI_CONNECT,CAPI_REQ)
56#define CAPI_CONNECT_CONF CAPICMD(CAPI_CONNECT,CAPI_CONF)
57#define CAPI_CONNECT_IND CAPICMD(CAPI_CONNECT,CAPI_IND)
58#define CAPI_CONNECT_RESP CAPICMD(CAPI_CONNECT,CAPI_RESP)
59
60#define CAPI_CONNECT_ACTIVE_REQ CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_REQ)
61#define CAPI_CONNECT_ACTIVE_CONF CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_CONF)
62#define CAPI_CONNECT_ACTIVE_IND CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_IND)
63#define CAPI_CONNECT_ACTIVE_RESP CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_RESP)
64
65#define CAPI_SELECT_B_PROTOCOL_REQ CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_REQ)
66#define CAPI_SELECT_B_PROTOCOL_CONF CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_CONF)
67
68#define CAPI_CONNECT_B3_ACTIVE_REQ CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_REQ)
69#define CAPI_CONNECT_B3_ACTIVE_CONF CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_CONF)
70#define CAPI_CONNECT_B3_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_IND)
71#define CAPI_CONNECT_B3_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_RESP)
72
73#define CAPI_CONNECT_B3_REQ CAPICMD(CAPI_CONNECT_B3,CAPI_REQ)
74#define CAPI_CONNECT_B3_CONF CAPICMD(CAPI_CONNECT_B3,CAPI_CONF)
75#define CAPI_CONNECT_B3_IND CAPICMD(CAPI_CONNECT_B3,CAPI_IND)
76#define CAPI_CONNECT_B3_RESP CAPICMD(CAPI_CONNECT_B3,CAPI_RESP)
77
78
79#define CAPI_CONNECT_B3_T90_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_IND)
80#define CAPI_CONNECT_B3_T90_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_RESP)
81
82#define CAPI_DATA_B3_REQ CAPICMD(CAPI_DATA_B3,CAPI_REQ)
83#define CAPI_DATA_B3_CONF CAPICMD(CAPI_DATA_B3,CAPI_CONF)
84#define CAPI_DATA_B3_IND CAPICMD(CAPI_DATA_B3,CAPI_IND)
85#define CAPI_DATA_B3_RESP CAPICMD(CAPI_DATA_B3,CAPI_RESP)
86
87#define CAPI_DISCONNECT_B3_REQ CAPICMD(CAPI_DISCONNECT_B3,CAPI_REQ)
88#define CAPI_DISCONNECT_B3_CONF CAPICMD(CAPI_DISCONNECT_B3,CAPI_CONF)
89#define CAPI_DISCONNECT_B3_IND CAPICMD(CAPI_DISCONNECT_B3,CAPI_IND)
90#define CAPI_DISCONNECT_B3_RESP CAPICMD(CAPI_DISCONNECT_B3,CAPI_RESP)
91
92#define CAPI_RESET_B3_REQ CAPICMD(CAPI_RESET_B3,CAPI_REQ)
93#define CAPI_RESET_B3_CONF CAPICMD(CAPI_RESET_B3,CAPI_CONF)
94#define CAPI_RESET_B3_IND CAPICMD(CAPI_RESET_B3,CAPI_IND)
95#define CAPI_RESET_B3_RESP CAPICMD(CAPI_RESET_B3,CAPI_RESP)
96
97#define CAPI_LISTEN_REQ CAPICMD(CAPI_LISTEN,CAPI_REQ)
98#define CAPI_LISTEN_CONF CAPICMD(CAPI_LISTEN,CAPI_CONF)
99
100#define CAPI_MANUFACTURER_REQ CAPICMD(CAPI_MANUFACTURER,CAPI_REQ)
101#define CAPI_MANUFACTURER_CONF CAPICMD(CAPI_MANUFACTURER,CAPI_CONF)
102#define CAPI_MANUFACTURER_IND CAPICMD(CAPI_MANUFACTURER,CAPI_IND)
103#define CAPI_MANUFACTURER_RESP CAPICMD(CAPI_MANUFACTURER,CAPI_RESP)
104
105#define CAPI_FACILITY_REQ CAPICMD(CAPI_FACILITY,CAPI_REQ)
106#define CAPI_FACILITY_CONF CAPICMD(CAPI_FACILITY,CAPI_CONF)
107#define CAPI_FACILITY_IND CAPICMD(CAPI_FACILITY,CAPI_IND)
108#define CAPI_FACILITY_RESP CAPICMD(CAPI_FACILITY,CAPI_RESP)
109
110#define CAPI_INFO_REQ CAPICMD(CAPI_INFO,CAPI_REQ)
111#define CAPI_INFO_CONF CAPICMD(CAPI_INFO,CAPI_CONF)
112#define CAPI_INFO_IND CAPICMD(CAPI_INFO,CAPI_IND)
113#define CAPI_INFO_RESP CAPICMD(CAPI_INFO,CAPI_RESP)
114
115#endif /* __CAPICMD_H__ */
diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h
new file mode 100644
index 000000000000..35e9b0fd014b
--- /dev/null
+++ b/include/linux/isdn/capilli.h
@@ -0,0 +1,113 @@
1/* $Id: capilli.h,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
2 *
3 * Kernel CAPI 2.0 Driver Interface for Linux
4 *
5 * Copyright 1999 by Carsten Paeth <calle@calle.de>
6 *
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
9 *
10 */
11
12#ifndef __CAPILLI_H__
13#define __CAPILLI_H__
14
15#include <linux/kernel.h>
16#include <linux/list.h>
17#include <linux/capi.h>
18#include <linux/kernelcapi.h>
19
20typedef struct capiloaddatapart {
21 int user; /* data in userspace ? */
22 int len;
23 unsigned char *data;
24} capiloaddatapart;
25
26typedef struct capiloaddata {
27 capiloaddatapart firmware;
28 capiloaddatapart configuration;
29} capiloaddata;
30
31typedef struct capicardparams {
32 unsigned int port;
33 unsigned irq;
34 int cardtype;
35 int cardnr;
36 unsigned int membase;
37} capicardparams;
38
39struct capi_ctr {
40 /* filled in before calling attach_capi_ctr */
41 struct module *owner;
42 void *driverdata; /* driver specific */
43 char name[32]; /* name of controller */
44 char *driver_name; /* name of driver */
45 int (*load_firmware)(struct capi_ctr *, capiloaddata *);
46 void (*reset_ctr)(struct capi_ctr *);
47 void (*register_appl)(struct capi_ctr *, u16 appl,
48 capi_register_params *);
49 void (*release_appl)(struct capi_ctr *, u16 appl);
50 u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb);
51
52 char *(*procinfo)(struct capi_ctr *);
53 int (*ctr_read_proc)(char *page, char **start, off_t off,
54 int count, int *eof, struct capi_ctr *card);
55
56 /* filled in before calling ready callback */
57 u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
58 capi_version version; /* CAPI_GET_VERSION */
59 capi_profile profile; /* CAPI_GET_PROFILE */
60 u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */
61
62 /* management information for kcapi */
63
64 unsigned long nrecvctlpkt;
65 unsigned long nrecvdatapkt;
66 unsigned long nsentctlpkt;
67 unsigned long nsentdatapkt;
68
69 int cnr; /* controller number */
70 volatile unsigned short cardstate; /* controller state */
71 volatile int blocked; /* output blocked */
72 int traceflag; /* capi trace */
73
74 struct proc_dir_entry *procent;
75 char procfn[128];
76};
77
78int attach_capi_ctr(struct capi_ctr *);
79int detach_capi_ctr(struct capi_ctr *);
80
81void capi_ctr_ready(struct capi_ctr * card);
82void capi_ctr_reseted(struct capi_ctr * card);
83void capi_ctr_suspend_output(struct capi_ctr * card);
84void capi_ctr_resume_output(struct capi_ctr * card);
85void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb);
86
87// ---------------------------------------------------------------------------
88// needed for AVM capi drivers
89
90struct capi_driver {
91 char name[32]; /* driver name */
92 char revision[32];
93
94 int (*add_card)(struct capi_driver *driver, capicardparams *data);
95
96 /* management information for kcapi */
97 struct list_head list;
98};
99
100void register_capi_driver(struct capi_driver *driver);
101void unregister_capi_driver(struct capi_driver *driver);
102
103// ---------------------------------------------------------------------------
104// library functions for use by hardware controller drivers
105
106void capilib_new_ncci(struct list_head *head, u16 applid, u32 ncci, u32 winsize);
107void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci);
108void capilib_release_appl(struct list_head *head, u16 applid);
109void capilib_release(struct list_head *head);
110void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgid);
111u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid);
112
113#endif /* __CAPILLI_H__ */
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h
new file mode 100644
index 000000000000..2e79f816703b
--- /dev/null
+++ b/include/linux/isdn/capiutil.h
@@ -0,0 +1,505 @@
1/* $Id: capiutil.h,v 1.5.6.2 2001/09/23 22:24:33 kai Exp $
2 *
3 * CAPI 2.0 defines & types
4 *
5 * From CAPI 2.0 Development Kit AVM 1995 (msg.c)
6 * Rewritten for Linux 1996 by Carsten Paeth <calle@calle.de>
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12
13#ifndef __CAPIUTIL_H__
14#define __CAPIUTIL_H__
15
16#include <asm/types.h>
17
18#define CAPIMSG_BASELEN 8
19#define CAPIMSG_U8(m, off) (m[off])
20#define CAPIMSG_U16(m, off) (m[off]|(m[(off)+1]<<8))
21#define CAPIMSG_U32(m, off) (m[off]|(m[(off)+1]<<8)|(m[(off)+2]<<16)|(m[(off)+3]<<24))
22#define CAPIMSG_LEN(m) CAPIMSG_U16(m,0)
23#define CAPIMSG_APPID(m) CAPIMSG_U16(m,2)
24#define CAPIMSG_COMMAND(m) CAPIMSG_U8(m,4)
25#define CAPIMSG_SUBCOMMAND(m) CAPIMSG_U8(m,5)
26#define CAPIMSG_CMD(m) (((m[4])<<8)|(m[5]))
27#define CAPIMSG_MSGID(m) CAPIMSG_U16(m,6)
28#define CAPIMSG_CONTROLLER(m) (m[8] & 0x7f)
29#define CAPIMSG_CONTROL(m) CAPIMSG_U32(m, 8)
30#define CAPIMSG_NCCI(m) CAPIMSG_CONTROL(m)
31#define CAPIMSG_DATALEN(m) CAPIMSG_U16(m,16) /* DATA_B3_REQ */
32
33static inline void capimsg_setu8(void *m, int off, __u8 val)
34{
35 ((__u8 *)m)[off] = val;
36}
37
38static inline void capimsg_setu16(void *m, int off, __u16 val)
39{
40 ((__u8 *)m)[off] = val & 0xff;
41 ((__u8 *)m)[off+1] = (val >> 8) & 0xff;
42}
43
44static inline void capimsg_setu32(void *m, int off, __u32 val)
45{
46 ((__u8 *)m)[off] = val & 0xff;
47 ((__u8 *)m)[off+1] = (val >> 8) & 0xff;
48 ((__u8 *)m)[off+2] = (val >> 16) & 0xff;
49 ((__u8 *)m)[off+3] = (val >> 24) & 0xff;
50}
51
52#define CAPIMSG_SETLEN(m, len) capimsg_setu16(m, 0, len)
53#define CAPIMSG_SETAPPID(m, applid) capimsg_setu16(m, 2, applid)
54#define CAPIMSG_SETCOMMAND(m,cmd) capimsg_setu8(m, 4, cmd)
55#define CAPIMSG_SETSUBCOMMAND(m, cmd) capimsg_setu8(m, 5, cmd)
56#define CAPIMSG_SETMSGID(m, msgid) capimsg_setu16(m, 6, msgid)
57#define CAPIMSG_SETCONTROL(m, contr) capimsg_setu32(m, 8, contr)
58#define CAPIMSG_SETDATALEN(m, len) capimsg_setu16(m, 16, len)
59
60/*----- basic-type definitions -----*/
61
62typedef __u8 *_cstruct;
63
64typedef enum {
65 CAPI_COMPOSE,
66 CAPI_DEFAULT
67} _cmstruct;
68
69/*
70 The _cmsg structure contains all possible CAPI 2.0 parameter.
71 All parameters are stored here first. The function CAPI_CMSG_2_MESSAGE
72 assembles the parameter and builds CAPI2.0 conform messages.
73 CAPI_MESSAGE_2_CMSG disassembles CAPI 2.0 messages and stores the
74 parameter in the _cmsg structure
75 */
76
77typedef struct {
78 /* Header */
79 __u16 ApplId;
80 __u8 Command;
81 __u8 Subcommand;
82 __u16 Messagenumber;
83
84 /* Parameter */
85 union {
86 __u32 adrController;
87 __u32 adrPLCI;
88 __u32 adrNCCI;
89 } adr;
90
91 _cmstruct AdditionalInfo;
92 _cstruct B1configuration;
93 __u16 B1protocol;
94 _cstruct B2configuration;
95 __u16 B2protocol;
96 _cstruct B3configuration;
97 __u16 B3protocol;
98 _cstruct BC;
99 _cstruct BChannelinformation;
100 _cmstruct BProtocol;
101 _cstruct CalledPartyNumber;
102 _cstruct CalledPartySubaddress;
103 _cstruct CallingPartyNumber;
104 _cstruct CallingPartySubaddress;
105 __u32 CIPmask;
106 __u32 CIPmask2;
107 __u16 CIPValue;
108 __u32 Class;
109 _cstruct ConnectedNumber;
110 _cstruct ConnectedSubaddress;
111 __u32 Data;
112 __u16 DataHandle;
113 __u16 DataLength;
114 _cstruct FacilityConfirmationParameter;
115 _cstruct Facilitydataarray;
116 _cstruct FacilityIndicationParameter;
117 _cstruct FacilityRequestParameter;
118 __u16 FacilitySelector;
119 __u16 Flags;
120 __u32 Function;
121 _cstruct HLC;
122 __u16 Info;
123 _cstruct InfoElement;
124 __u32 InfoMask;
125 __u16 InfoNumber;
126 _cstruct Keypadfacility;
127 _cstruct LLC;
128 _cstruct ManuData;
129 __u32 ManuID;
130 _cstruct NCPI;
131 __u16 Reason;
132 __u16 Reason_B3;
133 __u16 Reject;
134 _cstruct Useruserdata;
135
136 /* intern */
137 unsigned l, p;
138 unsigned char *par;
139 __u8 *m;
140
141 /* buffer to construct message */
142 __u8 buf[180];
143
144} _cmsg;
145
146/*
147 * capi_cmsg2message() assembles the parameter from _cmsg to a CAPI 2.0
148 * conform message
149 */
150unsigned capi_cmsg2message(_cmsg * cmsg, __u8 * msg);
151
152/*
153 * capi_message2cmsg disassembles a CAPI message an writes the parameter
154 * into _cmsg for easy access
155 */
156unsigned capi_message2cmsg(_cmsg * cmsg, __u8 * msg);
157
158/*
159 * capi_cmsg_header() fills the _cmsg structure with default values, so only
160 * parameter with non default values must be changed before sending the
161 * message.
162 */
163unsigned capi_cmsg_header(_cmsg * cmsg, __u16 _ApplId,
164 __u8 _Command, __u8 _Subcommand,
165 __u16 _Messagenumber, __u32 _Controller);
166
167/*
168 * capi_info2str generated a readable string for Capi2.0 reasons.
169 */
170char *capi_info2str(__u16 reason);
171
172/*-----------------------------------------------------------------------*/
173
174/*
175 * Debugging / Tracing functions
176 */
177char *capi_cmd2str(__u8 cmd, __u8 subcmd);
178char *capi_cmsg2str(_cmsg * cmsg);
179char *capi_message2str(__u8 * msg);
180
181/*-----------------------------------------------------------------------*/
182
183static inline void capi_cmsg_answer(_cmsg * cmsg)
184{
185 cmsg->Subcommand |= 0x01;
186}
187
188/*-----------------------------------------------------------------------*/
189
190static inline void capi_fill_CONNECT_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
191 __u32 adr,
192 _cstruct NCPI)
193{
194 capi_cmsg_header(cmsg, ApplId, 0x82, 0x80, Messagenumber, adr);
195 cmsg->NCPI = NCPI;
196}
197
198static inline void capi_fill_FACILITY_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
199 __u32 adr,
200 __u16 FacilitySelector,
201 _cstruct FacilityRequestParameter)
202{
203 capi_cmsg_header(cmsg, ApplId, 0x80, 0x80, Messagenumber, adr);
204 cmsg->FacilitySelector = FacilitySelector;
205 cmsg->FacilityRequestParameter = FacilityRequestParameter;
206}
207
208static inline void capi_fill_INFO_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
209 __u32 adr,
210 _cstruct CalledPartyNumber,
211 _cstruct BChannelinformation,
212 _cstruct Keypadfacility,
213 _cstruct Useruserdata,
214 _cstruct Facilitydataarray)
215{
216 capi_cmsg_header(cmsg, ApplId, 0x08, 0x80, Messagenumber, adr);
217 cmsg->CalledPartyNumber = CalledPartyNumber;
218 cmsg->BChannelinformation = BChannelinformation;
219 cmsg->Keypadfacility = Keypadfacility;
220 cmsg->Useruserdata = Useruserdata;
221 cmsg->Facilitydataarray = Facilitydataarray;
222}
223
224static inline void capi_fill_LISTEN_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
225 __u32 adr,
226 __u32 InfoMask,
227 __u32 CIPmask,
228 __u32 CIPmask2,
229 _cstruct CallingPartyNumber,
230 _cstruct CallingPartySubaddress)
231{
232 capi_cmsg_header(cmsg, ApplId, 0x05, 0x80, Messagenumber, adr);
233 cmsg->InfoMask = InfoMask;
234 cmsg->CIPmask = CIPmask;
235 cmsg->CIPmask2 = CIPmask2;
236 cmsg->CallingPartyNumber = CallingPartyNumber;
237 cmsg->CallingPartySubaddress = CallingPartySubaddress;
238}
239
240static inline void capi_fill_ALERT_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
241 __u32 adr,
242 _cstruct BChannelinformation,
243 _cstruct Keypadfacility,
244 _cstruct Useruserdata,
245 _cstruct Facilitydataarray)
246{
247 capi_cmsg_header(cmsg, ApplId, 0x01, 0x80, Messagenumber, adr);
248 cmsg->BChannelinformation = BChannelinformation;
249 cmsg->Keypadfacility = Keypadfacility;
250 cmsg->Useruserdata = Useruserdata;
251 cmsg->Facilitydataarray = Facilitydataarray;
252}
253
254static inline void capi_fill_CONNECT_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
255 __u32 adr,
256 __u16 CIPValue,
257 _cstruct CalledPartyNumber,
258 _cstruct CallingPartyNumber,
259 _cstruct CalledPartySubaddress,
260 _cstruct CallingPartySubaddress,
261 __u16 B1protocol,
262 __u16 B2protocol,
263 __u16 B3protocol,
264 _cstruct B1configuration,
265 _cstruct B2configuration,
266 _cstruct B3configuration,
267 _cstruct BC,
268 _cstruct LLC,
269 _cstruct HLC,
270 _cstruct BChannelinformation,
271 _cstruct Keypadfacility,
272 _cstruct Useruserdata,
273 _cstruct Facilitydataarray)
274{
275
276 capi_cmsg_header(cmsg, ApplId, 0x02, 0x80, Messagenumber, adr);
277 cmsg->CIPValue = CIPValue;
278 cmsg->CalledPartyNumber = CalledPartyNumber;
279 cmsg->CallingPartyNumber = CallingPartyNumber;
280 cmsg->CalledPartySubaddress = CalledPartySubaddress;
281 cmsg->CallingPartySubaddress = CallingPartySubaddress;
282 cmsg->B1protocol = B1protocol;
283 cmsg->B2protocol = B2protocol;
284 cmsg->B3protocol = B3protocol;
285 cmsg->B1configuration = B1configuration;
286 cmsg->B2configuration = B2configuration;
287 cmsg->B3configuration = B3configuration;
288 cmsg->BC = BC;
289 cmsg->LLC = LLC;
290 cmsg->HLC = HLC;
291 cmsg->BChannelinformation = BChannelinformation;
292 cmsg->Keypadfacility = Keypadfacility;
293 cmsg->Useruserdata = Useruserdata;
294 cmsg->Facilitydataarray = Facilitydataarray;
295}
296
297static inline void capi_fill_DATA_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
298 __u32 adr,
299 __u32 Data,
300 __u16 DataLength,
301 __u16 DataHandle,
302 __u16 Flags)
303{
304
305 capi_cmsg_header(cmsg, ApplId, 0x86, 0x80, Messagenumber, adr);
306 cmsg->Data = Data;
307 cmsg->DataLength = DataLength;
308 cmsg->DataHandle = DataHandle;
309 cmsg->Flags = Flags;
310}
311
312static inline void capi_fill_DISCONNECT_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
313 __u32 adr,
314 _cstruct BChannelinformation,
315 _cstruct Keypadfacility,
316 _cstruct Useruserdata,
317 _cstruct Facilitydataarray)
318{
319
320 capi_cmsg_header(cmsg, ApplId, 0x04, 0x80, Messagenumber, adr);
321 cmsg->BChannelinformation = BChannelinformation;
322 cmsg->Keypadfacility = Keypadfacility;
323 cmsg->Useruserdata = Useruserdata;
324 cmsg->Facilitydataarray = Facilitydataarray;
325}
326
327static inline void capi_fill_DISCONNECT_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
328 __u32 adr,
329 _cstruct NCPI)
330{
331
332 capi_cmsg_header(cmsg, ApplId, 0x84, 0x80, Messagenumber, adr);
333 cmsg->NCPI = NCPI;
334}
335
336static inline void capi_fill_MANUFACTURER_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
337 __u32 adr,
338 __u32 ManuID,
339 __u32 Class,
340 __u32 Function,
341 _cstruct ManuData)
342{
343
344 capi_cmsg_header(cmsg, ApplId, 0xff, 0x80, Messagenumber, adr);
345 cmsg->ManuID = ManuID;
346 cmsg->Class = Class;
347 cmsg->Function = Function;
348 cmsg->ManuData = ManuData;
349}
350
351static inline void capi_fill_RESET_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
352 __u32 adr,
353 _cstruct NCPI)
354{
355
356 capi_cmsg_header(cmsg, ApplId, 0x87, 0x80, Messagenumber, adr);
357 cmsg->NCPI = NCPI;
358}
359
360static inline void capi_fill_SELECT_B_PROTOCOL_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
361 __u32 adr,
362 __u16 B1protocol,
363 __u16 B2protocol,
364 __u16 B3protocol,
365 _cstruct B1configuration,
366 _cstruct B2configuration,
367 _cstruct B3configuration)
368{
369
370 capi_cmsg_header(cmsg, ApplId, 0x41, 0x80, Messagenumber, adr);
371 cmsg->B1protocol = B1protocol;
372 cmsg->B2protocol = B2protocol;
373 cmsg->B3protocol = B3protocol;
374 cmsg->B1configuration = B1configuration;
375 cmsg->B2configuration = B2configuration;
376 cmsg->B3configuration = B3configuration;
377}
378
379static inline void capi_fill_CONNECT_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
380 __u32 adr,
381 __u16 Reject,
382 __u16 B1protocol,
383 __u16 B2protocol,
384 __u16 B3protocol,
385 _cstruct B1configuration,
386 _cstruct B2configuration,
387 _cstruct B3configuration,
388 _cstruct ConnectedNumber,
389 _cstruct ConnectedSubaddress,
390 _cstruct LLC,
391 _cstruct BChannelinformation,
392 _cstruct Keypadfacility,
393 _cstruct Useruserdata,
394 _cstruct Facilitydataarray)
395{
396 capi_cmsg_header(cmsg, ApplId, 0x02, 0x83, Messagenumber, adr);
397 cmsg->Reject = Reject;
398 cmsg->B1protocol = B1protocol;
399 cmsg->B2protocol = B2protocol;
400 cmsg->B3protocol = B3protocol;
401 cmsg->B1configuration = B1configuration;
402 cmsg->B2configuration = B2configuration;
403 cmsg->B3configuration = B3configuration;
404 cmsg->ConnectedNumber = ConnectedNumber;
405 cmsg->ConnectedSubaddress = ConnectedSubaddress;
406 cmsg->LLC = LLC;
407 cmsg->BChannelinformation = BChannelinformation;
408 cmsg->Keypadfacility = Keypadfacility;
409 cmsg->Useruserdata = Useruserdata;
410 cmsg->Facilitydataarray = Facilitydataarray;
411}
412
413static inline void capi_fill_CONNECT_ACTIVE_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
414 __u32 adr)
415{
416
417 capi_cmsg_header(cmsg, ApplId, 0x03, 0x83, Messagenumber, adr);
418}
419
420static inline void capi_fill_CONNECT_B3_ACTIVE_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
421 __u32 adr)
422{
423
424 capi_cmsg_header(cmsg, ApplId, 0x83, 0x83, Messagenumber, adr);
425}
426
427static inline void capi_fill_CONNECT_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
428 __u32 adr,
429 __u16 Reject,
430 _cstruct NCPI)
431{
432 capi_cmsg_header(cmsg, ApplId, 0x82, 0x83, Messagenumber, adr);
433 cmsg->Reject = Reject;
434 cmsg->NCPI = NCPI;
435}
436
437static inline void capi_fill_CONNECT_B3_T90_ACTIVE_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
438 __u32 adr)
439{
440
441 capi_cmsg_header(cmsg, ApplId, 0x88, 0x83, Messagenumber, adr);
442}
443
444static inline void capi_fill_DATA_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
445 __u32 adr,
446 __u16 DataHandle)
447{
448
449 capi_cmsg_header(cmsg, ApplId, 0x86, 0x83, Messagenumber, adr);
450 cmsg->DataHandle = DataHandle;
451}
452
453static inline void capi_fill_DISCONNECT_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
454 __u32 adr)
455{
456
457 capi_cmsg_header(cmsg, ApplId, 0x84, 0x83, Messagenumber, adr);
458}
459
460static inline void capi_fill_DISCONNECT_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
461 __u32 adr)
462{
463
464 capi_cmsg_header(cmsg, ApplId, 0x04, 0x83, Messagenumber, adr);
465}
466
467static inline void capi_fill_FACILITY_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
468 __u32 adr,
469 __u16 FacilitySelector)
470{
471
472 capi_cmsg_header(cmsg, ApplId, 0x80, 0x83, Messagenumber, adr);
473 cmsg->FacilitySelector = FacilitySelector;
474}
475
476static inline void capi_fill_INFO_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
477 __u32 adr)
478{
479
480 capi_cmsg_header(cmsg, ApplId, 0x08, 0x83, Messagenumber, adr);
481}
482
483static inline void capi_fill_MANUFACTURER_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
484 __u32 adr,
485 __u32 ManuID,
486 __u32 Class,
487 __u32 Function,
488 _cstruct ManuData)
489{
490
491 capi_cmsg_header(cmsg, ApplId, 0xff, 0x83, Messagenumber, adr);
492 cmsg->ManuID = ManuID;
493 cmsg->Class = Class;
494 cmsg->Function = Function;
495 cmsg->ManuData = ManuData;
496}
497
498static inline void capi_fill_RESET_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber,
499 __u32 adr)
500{
501
502 capi_cmsg_header(cmsg, ApplId, 0x87, 0x83, Messagenumber, adr);
503}
504
505#endif /* __CAPIUTIL_H__ */
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h
new file mode 100644
index 000000000000..9f65bea49d11
--- /dev/null
+++ b/include/linux/isdn/tpam.h
@@ -0,0 +1,56 @@
1/* $Id: tpam.h,v 1.1.2.1 2001/06/08 08:23:46 kai Exp $
2 *
3 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
4 *
5 * Copyright 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve
6 *
7 * For all support questions please contact: <support@auvertech.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25#ifndef _TPAM_H_
26#define _TPAM_H_
27
28#include <linux/types.h>
29#include <linux/pci.h>
30
31/* IOCTL commands */
32#define TPAM_CMD_DSPLOAD 0x0001
33#define TPAM_CMD_DSPSAVE 0x0002
34#define TPAM_CMD_DSPRUN 0x0003
35#define TPAM_CMD_LOOPMODEON 0x0004
36#define TPAM_CMD_LOOPMODEOFF 0x0005
37
38/* addresses of debug information zones on board */
39#define TPAM_TRAPAUDIT_REGISTER 0x005493e4
40#define TPAM_NCOAUDIT_REGISTER 0x00500000
41#define TPAM_MSGAUDIT_REGISTER 0x008E30F0
42
43/* length of debug information zones on board */
44#define TPAM_TRAPAUDIT_LENGTH 10000
45#define TPAM_NCOAUDIT_LENGTH 300000
46#define TPAM_NCOAUDIT_COUNT 30
47#define TPAM_MSGAUDIT_LENGTH 60000
48
49/* IOCTL load/save parameter */
50typedef struct tpam_dsp_ioctl {
51 __u32 address; /* address to load/save data */
52 __u32 data_len; /* size of data to be loaded/saved */
53 __u8 data[0]; /* data */
54} tpam_dsp_ioctl;
55
56#endif /* _TPAM_H_ */