xref: /linux/include/uapi/linux/capi.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
3607ca46eSDavid Howells  *
4607ca46eSDavid Howells  * CAPI 2.0 Interface for Linux
5607ca46eSDavid Howells  *
6607ca46eSDavid Howells  * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
7607ca46eSDavid Howells  *
8607ca46eSDavid Howells  * This software may be used and distributed according to the terms
9607ca46eSDavid Howells  * of the GNU General Public License, incorporated herein by reference.
10607ca46eSDavid Howells  *
11607ca46eSDavid Howells  */
12607ca46eSDavid Howells 
13607ca46eSDavid Howells #ifndef __LINUX_CAPI_H__
14607ca46eSDavid Howells #define __LINUX_CAPI_H__
15607ca46eSDavid Howells 
16607ca46eSDavid Howells #include <linux/types.h>
17607ca46eSDavid Howells #include <linux/ioctl.h>
18607ca46eSDavid Howells #ifndef __KERNEL__
19607ca46eSDavid Howells #include <linux/kernelcapi.h>
20607ca46eSDavid Howells #endif
21607ca46eSDavid Howells 
22607ca46eSDavid Howells /*
23607ca46eSDavid Howells  * CAPI_REGISTER
24607ca46eSDavid Howells  */
25607ca46eSDavid Howells 
26607ca46eSDavid Howells typedef struct capi_register_params {	/* CAPI_REGISTER */
27607ca46eSDavid Howells 	__u32 level3cnt;	/* No. of simulatneous user data connections */
28607ca46eSDavid Howells 	__u32 datablkcnt;	/* No. of buffered data messages */
29607ca46eSDavid Howells 	__u32 datablklen;	/* Size of buffered data messages */
30607ca46eSDavid Howells } capi_register_params;
31607ca46eSDavid Howells 
32607ca46eSDavid Howells #define	CAPI_REGISTER	_IOW('C',0x01,struct capi_register_params)
33607ca46eSDavid Howells 
34607ca46eSDavid Howells /*
35607ca46eSDavid Howells  * CAPI_GET_MANUFACTURER
36607ca46eSDavid Howells  */
37607ca46eSDavid Howells 
38607ca46eSDavid Howells #define CAPI_MANUFACTURER_LEN		64
39607ca46eSDavid Howells 
40607ca46eSDavid Howells #define	CAPI_GET_MANUFACTURER	_IOWR('C',0x06,int)	/* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
41607ca46eSDavid Howells 
42607ca46eSDavid Howells /*
43607ca46eSDavid Howells  * CAPI_GET_VERSION
44607ca46eSDavid Howells  */
45607ca46eSDavid Howells 
46607ca46eSDavid Howells typedef struct capi_version {
47607ca46eSDavid Howells 	__u32 majorversion;
48607ca46eSDavid Howells 	__u32 minorversion;
49607ca46eSDavid Howells 	__u32 majormanuversion;
50607ca46eSDavid Howells 	__u32 minormanuversion;
51607ca46eSDavid Howells } capi_version;
52607ca46eSDavid Howells 
53607ca46eSDavid Howells #define CAPI_GET_VERSION	_IOWR('C',0x07,struct capi_version)
54607ca46eSDavid Howells 
55607ca46eSDavid Howells /*
56607ca46eSDavid Howells  * CAPI_GET_SERIAL
57607ca46eSDavid Howells  */
58607ca46eSDavid Howells 
59607ca46eSDavid Howells #define CAPI_SERIAL_LEN		8
60607ca46eSDavid Howells #define CAPI_GET_SERIAL		_IOWR('C',0x08,int)	/* broken: wanted size 8 (CAPI_SERIAL_LEN) */
61607ca46eSDavid Howells 
62607ca46eSDavid Howells /*
63607ca46eSDavid Howells  * CAPI_GET_PROFILE
64607ca46eSDavid Howells  */
65607ca46eSDavid Howells 
66607ca46eSDavid Howells typedef struct capi_profile {
67607ca46eSDavid Howells 	__u16 ncontroller;	/* number of installed controller */
68607ca46eSDavid Howells 	__u16 nbchannel;	/* number of B-Channels */
69607ca46eSDavid Howells 	__u32 goptions;		/* global options */
70607ca46eSDavid Howells 	__u32 support1;		/* B1 protocols support */
71607ca46eSDavid Howells 	__u32 support2;		/* B2 protocols support */
72607ca46eSDavid Howells 	__u32 support3;		/* B3 protocols support */
73607ca46eSDavid Howells 	__u32 reserved[6];	/* reserved */
74607ca46eSDavid Howells 	__u32 manu[5];		/* manufacturer specific information */
75607ca46eSDavid Howells } capi_profile;
76607ca46eSDavid Howells 
77607ca46eSDavid Howells #define CAPI_GET_PROFILE	_IOWR('C',0x09,struct capi_profile)
78607ca46eSDavid Howells 
79607ca46eSDavid Howells typedef struct capi_manufacturer_cmd {
80607ca46eSDavid Howells 	unsigned long cmd;
81607ca46eSDavid Howells 	void __user *data;
82607ca46eSDavid Howells } capi_manufacturer_cmd;
83607ca46eSDavid Howells 
84607ca46eSDavid Howells /*
85607ca46eSDavid Howells  * CAPI_MANUFACTURER_CMD
86607ca46eSDavid Howells  */
87607ca46eSDavid Howells 
88607ca46eSDavid Howells #define CAPI_MANUFACTURER_CMD	_IOWR('C',0x20, struct capi_manufacturer_cmd)
89607ca46eSDavid Howells 
90607ca46eSDavid Howells /*
91607ca46eSDavid Howells  * CAPI_GET_ERRCODE
92607ca46eSDavid Howells  * capi errcode is set, * if read, write, or ioctl returns EIO,
93607ca46eSDavid Howells  * ioctl returns errcode directly, and in arg, if != 0
94607ca46eSDavid Howells  */
95607ca46eSDavid Howells 
96607ca46eSDavid Howells #define CAPI_GET_ERRCODE	_IOR('C',0x21, __u16)
97607ca46eSDavid Howells 
98607ca46eSDavid Howells /*
99607ca46eSDavid Howells  * CAPI_INSTALLED
100607ca46eSDavid Howells  */
101607ca46eSDavid Howells #define CAPI_INSTALLED		_IOR('C',0x22, __u16)
102607ca46eSDavid Howells 
103607ca46eSDavid Howells 
104607ca46eSDavid Howells /*
105607ca46eSDavid Howells  * member contr is input for
1062509671dSPaul Bolle  * CAPI_GET_MANUFACTURER, CAPI_GET_VERSION, CAPI_GET_SERIAL
107607ca46eSDavid Howells  * and CAPI_GET_PROFILE
108607ca46eSDavid Howells  */
109607ca46eSDavid Howells typedef union capi_ioctl_struct {
110607ca46eSDavid Howells 	__u32 contr;
111607ca46eSDavid Howells 	capi_register_params rparams;
112607ca46eSDavid Howells 	__u8 manufacturer[CAPI_MANUFACTURER_LEN];
113607ca46eSDavid Howells 	capi_version version;
114607ca46eSDavid Howells 	__u8 serial[CAPI_SERIAL_LEN];
115607ca46eSDavid Howells 	capi_profile profile;
116607ca46eSDavid Howells 	capi_manufacturer_cmd cmd;
117607ca46eSDavid Howells 	__u16 errcode;
118607ca46eSDavid Howells } capi_ioctl_struct;
119607ca46eSDavid Howells 
120607ca46eSDavid Howells /*
121607ca46eSDavid Howells  * Middleware extension
122607ca46eSDavid Howells  */
123607ca46eSDavid Howells 
124607ca46eSDavid Howells #define CAPIFLAG_HIGHJACKING	0x0001
125607ca46eSDavid Howells 
126607ca46eSDavid Howells #define CAPI_GET_FLAGS		_IOR('C',0x23, unsigned)
127607ca46eSDavid Howells #define CAPI_SET_FLAGS		_IOR('C',0x24, unsigned)
128607ca46eSDavid Howells #define CAPI_CLR_FLAGS		_IOR('C',0x25, unsigned)
129607ca46eSDavid Howells 
130607ca46eSDavid Howells #define CAPI_NCCI_OPENCOUNT	_IOR('C',0x26, unsigned)
131607ca46eSDavid Howells 
132607ca46eSDavid Howells #define CAPI_NCCI_GETUNIT	_IOR('C',0x27, unsigned)
133607ca46eSDavid Howells 
134607ca46eSDavid Howells #endif				/* __LINUX_CAPI_H__ */
135