1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
4 * CAPI 2.0 Interface for Linux
6 * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
13 #ifndef __LINUX_CAPI_H__
14 #define __LINUX_CAPI_H__
16 #include <linux/types.h>
17 #include <linux/ioctl.h>
19 #include <linux/kernelcapi.h>
26 typedef struct capi_register_params { /* CAPI_REGISTER */
27 __u32 level3cnt; /* No. of simulatneous user data connections */
28 __u32 datablkcnt; /* No. of buffered data messages */
29 __u32 datablklen; /* Size of buffered data messages */
30 } capi_register_params;
32 #define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
35 * CAPI_GET_MANUFACTURER
38 #define CAPI_MANUFACTURER_LEN 64
40 #define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
46 typedef struct capi_version {
49 __u32 majormanuversion;
50 __u32 minormanuversion;
53 #define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
59 #define CAPI_SERIAL_LEN 8
60 #define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
66 typedef struct capi_profile {
67 __u16 ncontroller; /* number of installed controller */
68 __u16 nbchannel; /* number of B-Channels */
69 __u32 goptions; /* global options */
70 __u32 support1; /* B1 protocols support */
71 __u32 support2; /* B2 protocols support */
72 __u32 support3; /* B3 protocols support */
73 __u32 reserved[6]; /* reserved */
74 __u32 manu[5]; /* manufacturer specific information */
77 #define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
79 typedef struct capi_manufacturer_cmd {
82 } capi_manufacturer_cmd;
85 * CAPI_MANUFACTURER_CMD
88 #define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
92 * capi errcode is set, * if read, write, or ioctl returns EIO,
93 * ioctl returns errcode directly, and in arg, if != 0
96 #define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
101 #define CAPI_INSTALLED _IOR('C',0x22, __u16)
105 * member contr is input for
106 * CAPI_GET_MANUFACTURER, CAPI_GET_VERSION, CAPI_GET_SERIAL
107 * and CAPI_GET_PROFILE
109 typedef union capi_ioctl_struct {
111 capi_register_params rparams;
112 __u8 manufacturer[CAPI_MANUFACTURER_LEN];
113 capi_version version;
114 __u8 serial[CAPI_SERIAL_LEN];
115 capi_profile profile;
116 capi_manufacturer_cmd cmd;
121 * Middleware extension
124 #define CAPIFLAG_HIGHJACKING 0x0001
126 #define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
127 #define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
128 #define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
130 #define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
132 #define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
134 #endif /* __LINUX_CAPI_H__ */