2 * $Id: capi.h,v 1.4 2000/06/12 09:20:20 kai Exp $
4 * CAPI 2.0 Interface for Linux
6 * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
10 #ifndef __LINUX_CAPI_H__
11 #define __LINUX_CAPI_H__
13 #include <asm/types.h>
14 #include <linux/ioctl.h>
16 #include <linux/kernelcapi.h>
23 typedef struct capi_register_params
{ /* CAPI_REGISTER */
24 __u32 level3cnt
; /* No. of simulatneous user data connections */
25 __u32 datablkcnt
; /* No. of buffered data messages */
26 __u32 datablklen
; /* Size of buffered data messages */
27 } capi_register_params
;
29 #define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
32 * CAPI_GET_MANUFACTURER
35 #define CAPI_MANUFACTURER_LEN 64
37 #define CAPI_GET_MANUFACTURER _IOWR('C',0x06,CAPI_MANUFACTURER_LEN)
43 typedef struct capi_version
{
46 __u32 majormanuversion
;
47 __u32 minormanuversion
;
50 #define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
56 #define CAPI_SERIAL_LEN 8
57 #define CAPI_GET_SERIAL _IOWR('C',0x08, CAPI_SERIAL_LEN)
63 typedef struct capi_profile
{
64 __u16 ncontroller
; /* number of installed controller */
65 __u16 nbchannel
; /* number of B-Channels */
66 __u32 goptions
; /* global options */
67 __u32 support1
; /* B1 protocols support */
68 __u32 support2
; /* B2 protocols support */
69 __u32 support3
; /* B3 protocols support */
70 __u32 reserved
[6]; /* reserved */
71 __u32 manu
[5]; /* manufacturer specific information */
74 #define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
76 typedef struct capi_manufacturer_cmd
{
79 } capi_manufacturer_cmd
;
82 * CAPI_MANUFACTURER_CMD
85 #define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
89 * capi errcode is set, * if read, write, or ioctl returns EIO,
90 * ioctl returns errcode directly, and in arg, if != 0
93 #define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
98 #define CAPI_INSTALLED _IOR('C',0x22, __u16)
102 * member contr is input for
103 * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
104 * and CAPI_GET_PROFILE
106 typedef union capi_ioctl_struct
{
108 capi_register_params rparams
;
109 __u8 manufacturer
[CAPI_MANUFACTURER_LEN
];
110 capi_version version
;
111 __u8 serial
[CAPI_SERIAL_LEN
];
112 capi_profile profile
;
113 capi_manufacturer_cmd cmd
;
118 * Middleware extension
121 #define CAPIFLAG_HIGHJACKING 0x0001
123 #define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
124 #define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
125 #define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
127 #define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
129 #define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
131 #endif /* __LINUX_CAPI_H__ */