2 * Kernel CAPI 2.0 Module
4 * Copyright 1999 by Carsten Paeth <calle@calle.de>
5 * Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
13 #include <linux/kernel.h>
14 #include <linux/spinlock.h>
15 #include <linux/list.h>
16 #include <linux/isdn/capilli.h>
19 #define DBG(format, arg...) do { \
20 printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
23 #define DBG(format, arg...) /* */
27 CAPI_CTR_DETACHED
= 0,
28 CAPI_CTR_DETECTED
= 1,
33 extern struct capi_ctr
*capi_controller
[CAPI_MAXCONTR
];
34 extern struct mutex capi_controller_lock
;
36 extern struct capi20_appl
*capi_applications
[CAPI_MAXAPPL
];
38 void kcapi_proc_init(void);
39 void kcapi_proc_exit(void);
43 capi_register_params rparam
;
44 void (*recv_message
)(struct capi20_appl
*ap
, struct sk_buff
*skb
);
47 /* internal to kernelcapi.o */
48 unsigned long nrecvctlpkt
;
49 unsigned long nrecvdatapkt
;
50 unsigned long nsentctlpkt
;
51 unsigned long nsentdatapkt
;
52 struct mutex recv_mtx
;
53 struct sk_buff_head recv_queue
;
54 struct work_struct recv_work
;
55 int release_in_progress
;
58 u16
capi20_isinstalled(void);
59 u16
capi20_register(struct capi20_appl
*ap
);
60 u16
capi20_release(struct capi20_appl
*ap
);
61 u16
capi20_put_message(struct capi20_appl
*ap
, struct sk_buff
*skb
);
62 u16
capi20_get_manufacturer(u32 contr
, u8 buf
[CAPI_MANUFACTURER_LEN
]);
63 u16
capi20_get_version(u32 contr
, struct capi_version
*verp
);
64 u16
capi20_get_serial(u32 contr
, u8 serial
[CAPI_SERIAL_LEN
]);
65 u16
capi20_get_profile(u32 contr
, struct capi_profile
*profp
);
66 int capi20_manufacturer(unsigned long cmd
, void __user
*data
);
69 #define CAPICTR_DOWN 1
72 void kcapi_exit(void);
74 /*----- basic-type definitions -----*/
76 typedef __u8
*_cstruct
;
84 The _cmsg structure contains all possible CAPI 2.0 parameter.
85 All parameters are stored here first. The function CAPI_CMSG_2_MESSAGE
86 assembles the parameter and builds CAPI2.0 conform messages.
87 CAPI_MESSAGE_2_CMSG disassembles CAPI 2.0 messages and stores the
88 parameter in the _cmsg structure
105 _cmstruct AdditionalInfo
;
106 _cstruct B1configuration
;
108 _cstruct B2configuration
;
110 _cstruct B3configuration
;
113 _cstruct BChannelinformation
;
115 _cstruct CalledPartyNumber
;
116 _cstruct CalledPartySubaddress
;
117 _cstruct CallingPartyNumber
;
118 _cstruct CallingPartySubaddress
;
123 _cstruct ConnectedNumber
;
124 _cstruct ConnectedSubaddress
;
128 _cstruct FacilityConfirmationParameter
;
129 _cstruct Facilitydataarray
;
130 _cstruct FacilityIndicationParameter
;
131 _cstruct FacilityRequestParameter
;
132 __u16 FacilitySelector
;
137 _cstruct InfoElement
;
140 _cstruct Keypadfacility
;
148 _cstruct Useruserdata
;
155 /* buffer to construct message */
160 /*-----------------------------------------------------------------------*/
163 * Debugging / Tracing functions
166 char *capi_cmd2str(__u8 cmd
, __u8 subcmd
);
175 #define CDEBUG_SIZE 1024
176 #define CDEBUG_GSIZE 4096
178 void cdebbuf_free(_cdebbuf
*cdb
);
179 int cdebug_init(void);
180 void cdebug_exit(void);
182 _cdebbuf
*capi_message2str(__u8
*msg
);