Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 1
/*
2
 * $Id: kernelcapi.h,v 1.1 2004-01-28 15:25:51 giacomo 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
#include <linux/list.h>
14
 
15
#define CAPI_MAXAPPL    128     /* maximum number of applications  */
16
#define CAPI_MAXCONTR   16      /* maximum number of controller    */
17
#define CAPI_MAXDATAWINDOW      8
18
 
19
 
20
typedef struct kcapi_flagdef {
21
        int contr;
22
        int flag;
23
} kcapi_flagdef;
24
 
25
typedef struct kcapi_carddef {
26
        char            driver[32];
27
        unsigned int    port;
28
        unsigned        irq;
29
        unsigned int    membase;
30
        int             cardnr;
31
} kcapi_carddef;
32
 
33
/* new ioctls >= 10 */
34
#define KCAPI_CMD_TRACE         10
35
#define KCAPI_CMD_ADDCARD       11      /* OBSOLETE */
36
 
37
/*
38
 * flag > 2 => trace also data
39
 * flag & 1 => show trace
40
 */
41
#define KCAPI_TRACE_OFF                 0
42
#define KCAPI_TRACE_SHORT_NO_DATA       1
43
#define KCAPI_TRACE_FULL_NO_DATA        2
44
#define KCAPI_TRACE_SHORT               3
45
#define KCAPI_TRACE_FULL                4
46
 
47
 
48
#ifdef __KERNEL__
49
 
50
#include <linux/skbuff.h>
51
 
52
#define KCI_CONTRUP     0       /* arg: struct capi_profile */
53
#define KCI_CONTRDOWN   1       /* arg: NULL */
54
 
55
struct capi20_appl {
56
        u16 applid;
57
        capi_register_params rparam;
58
        void (*recv_message)(struct capi20_appl *ap, struct sk_buff *skb);
59
        void *private;
60
 
61
        /* internal to kernelcapi.o */
62
        unsigned long nrecvctlpkt;
63
        unsigned long nrecvdatapkt;
64
        unsigned long nsentctlpkt;
65
        unsigned long nsentdatapkt;
66
 
67
        /* ugly hack to allow for notification of added/removed
68
         * controllers. The Right Way (tm) is known. XXX
69
         */
70
        void (*callback) (unsigned int cmd, __u32 contr, void *data);
71
};
72
 
73
u16 capi20_isinstalled(void);
74
u16 capi20_register(struct capi20_appl *ap);
75
u16 capi20_release(struct capi20_appl *ap);
76
u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb);
77
u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
78
u16 capi20_get_version(u32 contr, struct capi_version *verp);
79
u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
80
u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
81
int capi20_manufacturer(unsigned int cmd, void *data);
82
 
83
/* temporary hack XXX */
84
void capi20_set_callback(struct capi20_appl *ap,
85
                         void (*callback) (unsigned int cmd, __u32 contr, void *data));
86
 
87
 
88
 
89
#define CAPI_NOERROR                      0x0000
90
 
91
#define CAPI_TOOMANYAPPLS                 0x1001
92
#define CAPI_LOGBLKSIZETOSMALL            0x1002
93
#define CAPI_BUFFEXECEEDS64K              0x1003
94
#define CAPI_MSGBUFSIZETOOSMALL           0x1004
95
#define CAPI_ANZLOGCONNNOTSUPPORTED       0x1005
96
#define CAPI_REGRESERVED                  0x1006
97
#define CAPI_REGBUSY                      0x1007
98
#define CAPI_REGOSRESOURCEERR             0x1008
99
#define CAPI_REGNOTINSTALLED              0x1009
100
#define CAPI_REGCTRLERNOTSUPPORTEXTEQUIP  0x100a
101
#define CAPI_REGCTRLERONLYSUPPORTEXTEQUIP 0x100b
102
 
103
#define CAPI_ILLAPPNR                     0x1101
104
#define CAPI_ILLCMDORSUBCMDORMSGTOSMALL   0x1102
105
#define CAPI_SENDQUEUEFULL                0x1103
106
#define CAPI_RECEIVEQUEUEEMPTY            0x1104
107
#define CAPI_RECEIVEOVERFLOW              0x1105
108
#define CAPI_UNKNOWNNOTPAR                0x1106
109
#define CAPI_MSGBUSY                      0x1107
110
#define CAPI_MSGOSRESOURCEERR             0x1108
111
#define CAPI_MSGNOTINSTALLED              0x1109
112
#define CAPI_MSGCTRLERNOTSUPPORTEXTEQUIP  0x110a
113
#define CAPI_MSGCTRLERONLYSUPPORTEXTEQUIP 0x110b
114
 
115
typedef enum {
116
        CapiMessageNotSupportedInCurrentState = 0x2001,
117
        CapiIllContrPlciNcci                  = 0x2002,
118
        CapiNoPlciAvailable                   = 0x2003,
119
        CapiNoNcciAvailable                   = 0x2004,
120
        CapiNoListenResourcesAvailable        = 0x2005,
121
        CapiNoFaxResourcesAvailable           = 0x2006,
122
        CapiIllMessageParmCoding              = 0x2007,
123
} RESOURCE_CODING_PROBLEM;
124
 
125
typedef enum {
126
        CapiB1ProtocolNotSupported                      = 0x3001,
127
        CapiB2ProtocolNotSupported                      = 0x3002,
128
        CapiB3ProtocolNotSupported                      = 0x3003,
129
        CapiB1ProtocolParameterNotSupported             = 0x3004,
130
        CapiB2ProtocolParameterNotSupported             = 0x3005,
131
        CapiB3ProtocolParameterNotSupported             = 0x3006,
132
        CapiBProtocolCombinationNotSupported            = 0x3007,
133
        CapiNcpiNotSupported                            = 0x3008,
134
        CapiCipValueUnknown                             = 0x3009,
135
        CapiFlagsNotSupported                           = 0x300a,
136
        CapiFacilityNotSupported                        = 0x300b,
137
        CapiDataLengthNotSupportedByCurrentProtocol     = 0x300c,
138
        CapiResetProcedureNotSupportedByCurrentProtocol = 0x300d,
139
        CapiTeiAssignmentFailed                         = 0x300e,
140
} REQUESTED_SERVICES_PROBLEM;
141
 
142
typedef enum {
143
        CapiSuccess                                     = 0x0000,
144
        CapiSupplementaryServiceNotSupported            = 0x300e,
145
        CapiRequestNotAllowedInThisState                = 0x3010,
146
} SUPPLEMENTARY_SERVICE_INFO;
147
 
148
typedef enum {
149
        CapiProtocolErrorLayer1                         = 0x3301,
150
        CapiProtocolErrorLayer2                         = 0x3302,
151
        CapiProtocolErrorLayer3                         = 0x3303,
152
        CapiTimeOut                                     = 0x3303, // SuppServiceReason
153
        CapiCallGivenToOtherApplication                 = 0x3304,
154
} CAPI_REASON;
155
 
156
#endif                          /* __KERNEL__ */
157
 
158
#endif                          /* __KERNELCAPI_H__ */