File: /usr/src/linux/include/linux/kernelcapi.h

1     /*
2      * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $
3      * 
4      * Kernel CAPI 2.0 Interface for Linux
5      * 
6      * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
7      * 
8      */
9     
10     #ifndef __KERNELCAPI_H__
11     #define __KERNELCAPI_H__
12     
13     #define CAPI_MAXAPPL	128	/* maximum number of applications  */
14     #define CAPI_MAXCONTR	16	/* maximum number of controller    */
15     #define CAPI_MAXDATAWINDOW	8
16     
17     
18     typedef struct kcapi_flagdef {
19     	int contr;
20     	int flag;
21     } kcapi_flagdef;
22     
23     typedef struct kcapi_carddef {
24     	char		driver[32];
25     	unsigned int	port;
26     	unsigned	irq;
27     	unsigned int	membase;
28     	int		cardnr;
29     } kcapi_carddef;
30     
31     /* new ioctls >= 10 */
32     #define KCAPI_CMD_TRACE		10
33     #define KCAPI_CMD_ADDCARD	11	/* add card to named driver */
34     
35     /* 
36      * flag > 2 => trace also data
37      * flag & 1 => show trace
38      */
39     #define KCAPI_TRACE_OFF			0
40     #define KCAPI_TRACE_SHORT_NO_DATA	1
41     #define KCAPI_TRACE_FULL_NO_DATA	2
42     #define KCAPI_TRACE_SHORT		3
43     #define KCAPI_TRACE_FULL		4
44     
45     
46     #ifdef __KERNEL__
47     
48     struct capi_interface {
49     	__u16 (*capi_isinstalled) (void);
50     
51     	__u16 (*capi_register) (capi_register_params * rparam, __u16 * applidp);
52     	__u16 (*capi_release) (__u16 applid);
53     	__u16 (*capi_put_message) (__u16 applid, struct sk_buff * msg);
54     	__u16 (*capi_get_message) (__u16 applid, struct sk_buff ** msgp);
55     	__u16 (*capi_set_signal) (__u16 applid,
56     			      void (*signal) (__u16 applid, void *param),
57     				  void *param);
58     	__u16 (*capi_get_manufacturer) (__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN]);
59     	__u16 (*capi_get_version) (__u32 contr, struct capi_version * verp);
60     	 __u16(*capi_get_serial) (__u32 contr, __u8 serial[CAPI_SERIAL_LEN]);
61     	 __u16(*capi_get_profile) (__u32 contr, struct capi_profile * profp);
62     
63     	/*
64     	 * to init controllers, data is always in user memory
65     	 */
66     	int (*capi_manufacturer) (unsigned int cmd, void *data);
67     
68     };
69     
70     struct capi_ncciinfo {
71     	__u16 applid;
72     	__u32 ncci;
73     };
74     
75     #define	KCI_CONTRUP	0	/* struct capi_profile */
76     #define	KCI_CONTRDOWN	1	/* NULL */
77     #define	KCI_NCCIUP	2	/* struct capi_ncciinfo */
78     #define	KCI_NCCIDOWN	3	/* struct capi_ncciinfo */
79     
80     struct capi_interface_user {
81     	char name[20];
82     	void (*callback) (unsigned int cmd, __u32 contr, void *data);
83     	/* internal */
84     	struct capi_interface_user *next;
85     };
86     
87     struct capi_interface *attach_capi_interface(struct capi_interface_user *);
88     int detach_capi_interface(struct capi_interface_user *);
89     
90     
91     #define CAPI_NOERROR                      0x0000
92     
93     #define CAPI_TOOMANYAPPLS		  0x1001
94     #define CAPI_LOGBLKSIZETOSMALL	          0x1002
95     #define CAPI_BUFFEXECEEDS64K 	          0x1003
96     #define CAPI_MSGBUFSIZETOOSMALL	          0x1004
97     #define CAPI_ANZLOGCONNNOTSUPPORTED	  0x1005
98     #define CAPI_REGRESERVED		  0x1006
99     #define CAPI_REGBUSY 		          0x1007
100     #define CAPI_REGOSRESOURCEERR	          0x1008
101     #define CAPI_REGNOTINSTALLED 	          0x1009
102     #define CAPI_REGCTRLERNOTSUPPORTEXTEQUIP  0x100a
103     #define CAPI_REGCTRLERONLYSUPPORTEXTEQUIP 0x100b
104     
105     #define CAPI_ILLAPPNR		          0x1101
106     #define CAPI_ILLCMDORSUBCMDORMSGTOSMALL   0x1102
107     #define CAPI_SENDQUEUEFULL		  0x1103
108     #define CAPI_RECEIVEQUEUEEMPTY	          0x1104
109     #define CAPI_RECEIVEOVERFLOW 	          0x1105
110     #define CAPI_UNKNOWNNOTPAR		  0x1106
111     #define CAPI_MSGBUSY 		          0x1107
112     #define CAPI_MSGOSRESOURCEERR	          0x1108
113     #define CAPI_MSGNOTINSTALLED 	          0x1109
114     #define CAPI_MSGCTRLERNOTSUPPORTEXTEQUIP  0x110a
115     #define CAPI_MSGCTRLERONLYSUPPORTEXTEQUIP 0x110b
116     
117     typedef enum {
118             CapiMessageNotSupportedInCurrentState = 0x2001,
119             CapiIllContrPlciNcci                  = 0x2002,
120             CapiNoPlciAvailable                   = 0x2003,
121             CapiNoNcciAvailable                   = 0x2004,
122             CapiNoListenResourcesAvailable        = 0x2005,
123             CapiNoFaxResourcesAvailable           = 0x2006,
124             CapiIllMessageParmCoding              = 0x2007,
125     } RESOURCE_CODING_PROBLEM;
126     
127     typedef enum {
128             CapiB1ProtocolNotSupported                      = 0x3001,
129             CapiB2ProtocolNotSupported                      = 0x3002,
130             CapiB3ProtocolNotSupported                      = 0x3003,
131             CapiB1ProtocolParameterNotSupported             = 0x3004,
132             CapiB2ProtocolParameterNotSupported             = 0x3005,
133             CapiB3ProtocolParameterNotSupported             = 0x3006,
134             CapiBProtocolCombinationNotSupported            = 0x3007,
135             CapiNcpiNotSupported                            = 0x3008,
136             CapiCipValueUnknown                             = 0x3009,
137             CapiFlagsNotSupported                           = 0x300a,
138             CapiFacilityNotSupported                        = 0x300b,
139             CapiDataLengthNotSupportedByCurrentProtocol     = 0x300c,
140             CapiResetProcedureNotSupportedByCurrentProtocol = 0x300d,
141             CapiTeiAssignmentFailed                         = 0x300e,
142     } REQUESTED_SERVICES_PROBLEM;
143     
144     typedef enum {
145     	CapiSuccess                                     = 0x0000,
146     	CapiSupplementaryServiceNotSupported            = 0x300e,
147     	CapiRequestNotAllowedInThisState                = 0x3010,
148     } SUPPLEMENTARY_SERVICE_INFO;
149     
150     typedef enum {
151     	CapiProtocolErrorLayer1                         = 0x3301,
152     	CapiProtocolErrorLayer2                         = 0x3302,
153     	CapiProtocolErrorLayer3                         = 0x3303,
154     	CapiTimeOut                                     = 0x3303, // SuppServiceReason
155     	CapiCallGivenToOtherApplication                 = 0x3304,
156     } CAPI_REASON;
157     
158     #endif				/* __KERNEL__ */
159     
160     #endif				/* __KERNELCAPI_H__ */
161