- Stephen Rothwell: APM updates
[davej-history.git] / include / linux / capi.h
blob0c347e003b21dc0f02153ddc3eaf347c9acdc309
1 /*
2 * $Id: capi.h,v 1.4 2000/06/12 09:20:20 kai Exp $
3 *
4 * CAPI 2.0 Interface for Linux
5 *
6 * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
7 *
8 */
10 #ifndef __LINUX_CAPI_H__
11 #define __LINUX_CAPI_H__
13 #include <asm/types.h>
14 #include <linux/ioctl.h>
15 #ifndef __KERNEL__
16 #include <linux/kernelcapi.h>
17 #endif
20 * CAPI_REGISTER
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)
40 * CAPI_GET_VERSION
43 typedef struct capi_version {
44 __u32 majorversion;
45 __u32 minorversion;
46 __u32 majormanuversion;
47 __u32 minormanuversion;
48 } capi_version;
50 #define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
53 * CAPI_GET_SERIAL
56 #define CAPI_SERIAL_LEN 8
57 #define CAPI_GET_SERIAL _IOWR('C',0x08, CAPI_SERIAL_LEN)
60 * CAPI_GET_PROFILE
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 */
72 } capi_profile;
74 #define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
76 typedef struct capi_manufacturer_cmd {
77 unsigned long cmd;
78 void *data;
79 } capi_manufacturer_cmd;
82 * CAPI_MANUFACTURER_CMD
85 #define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
88 * CAPI_GET_ERRCODE
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)
96 * CAPI_INSTALLED
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 {
107 __u32 contr;
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;
114 __u16 errcode;
115 } capi_ioctl_struct;
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__ */