Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6/mini2440.git] / include / linux / capi.h
blobfdebaaa9f66e81eb9261602e3fa88498b6f12ff2
1 /* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
2 *
3 * CAPI 2.0 Interface for Linux
4 *
5 * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
6 *
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
12 #ifndef __LINUX_CAPI_H__
13 #define __LINUX_CAPI_H__
15 #include <asm/types.h>
16 #include <linux/ioctl.h>
17 #ifndef __KERNEL__
18 #include <linux/kernelcapi.h>
19 #endif
22 * CAPI_REGISTER
25 typedef struct capi_register_params { /* CAPI_REGISTER */
26 __u32 level3cnt; /* No. of simulatneous user data connections */
27 __u32 datablkcnt; /* No. of buffered data messages */
28 __u32 datablklen; /* Size of buffered data messages */
29 } capi_register_params;
31 #define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
34 * CAPI_GET_MANUFACTURER
37 #define CAPI_MANUFACTURER_LEN 64
39 #define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
42 * CAPI_GET_VERSION
45 typedef struct capi_version {
46 __u32 majorversion;
47 __u32 minorversion;
48 __u32 majormanuversion;
49 __u32 minormanuversion;
50 } capi_version;
52 #define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
55 * CAPI_GET_SERIAL
58 #define CAPI_SERIAL_LEN 8
59 #define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
62 * CAPI_GET_PROFILE
65 typedef struct capi_profile {
66 __u16 ncontroller; /* number of installed controller */
67 __u16 nbchannel; /* number of B-Channels */
68 __u32 goptions; /* global options */
69 __u32 support1; /* B1 protocols support */
70 __u32 support2; /* B2 protocols support */
71 __u32 support3; /* B3 protocols support */
72 __u32 reserved[6]; /* reserved */
73 __u32 manu[5]; /* manufacturer specific information */
74 } capi_profile;
76 #define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
78 typedef struct capi_manufacturer_cmd {
79 unsigned long cmd;
80 void __user *data;
81 } capi_manufacturer_cmd;
84 * CAPI_MANUFACTURER_CMD
87 #define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
90 * CAPI_GET_ERRCODE
91 * capi errcode is set, * if read, write, or ioctl returns EIO,
92 * ioctl returns errcode directly, and in arg, if != 0
95 #define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
98 * CAPI_INSTALLED
100 #define CAPI_INSTALLED _IOR('C',0x22, __u16)
104 * member contr is input for
105 * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
106 * and CAPI_GET_PROFILE
108 typedef union capi_ioctl_struct {
109 __u32 contr;
110 capi_register_params rparams;
111 __u8 manufacturer[CAPI_MANUFACTURER_LEN];
112 capi_version version;
113 __u8 serial[CAPI_SERIAL_LEN];
114 capi_profile profile;
115 capi_manufacturer_cmd cmd;
116 __u16 errcode;
117 } capi_ioctl_struct;
120 * Middleware extension
123 #define CAPIFLAG_HIGHJACKING 0x0001
125 #define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
126 #define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
127 #define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
129 #define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
131 #define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
133 #endif /* __LINUX_CAPI_H__ */