Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
0003  * 
0004  * CAPI 2.0 Interface for Linux
0005  * 
0006  * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
0007  * 
0008  * This software may be used and distributed according to the terms
0009  * of the GNU General Public License, incorporated herein by reference.
0010  *
0011  */
0012 
0013 #ifndef __LINUX_CAPI_H__
0014 #define __LINUX_CAPI_H__
0015 
0016 #include <linux/types.h>
0017 #include <linux/ioctl.h>
0018 #ifndef __KERNEL__
0019 #include <linux/kernelcapi.h>
0020 #endif
0021 
0022 /*
0023  * CAPI_REGISTER
0024  */
0025 
0026 typedef struct capi_register_params {   /* CAPI_REGISTER */
0027     __u32 level3cnt;    /* No. of simulatneous user data connections */
0028     __u32 datablkcnt;   /* No. of buffered data messages */
0029     __u32 datablklen;   /* Size of buffered data messages */
0030 } capi_register_params;
0031 
0032 #define CAPI_REGISTER   _IOW('C',0x01,struct capi_register_params)
0033 
0034 /*
0035  * CAPI_GET_MANUFACTURER
0036  */
0037 
0038 #define CAPI_MANUFACTURER_LEN       64
0039 
0040 #define CAPI_GET_MANUFACTURER   _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
0041 
0042 /*
0043  * CAPI_GET_VERSION
0044  */
0045 
0046 typedef struct capi_version {
0047     __u32 majorversion;
0048     __u32 minorversion;
0049     __u32 majormanuversion;
0050     __u32 minormanuversion;
0051 } capi_version;
0052 
0053 #define CAPI_GET_VERSION    _IOWR('C',0x07,struct capi_version)
0054 
0055 /*
0056  * CAPI_GET_SERIAL
0057  */
0058 
0059 #define CAPI_SERIAL_LEN     8
0060 #define CAPI_GET_SERIAL     _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
0061 
0062 /*
0063  * CAPI_GET_PROFILE
0064  */
0065 
0066 typedef struct capi_profile {
0067     __u16 ncontroller;  /* number of installed controller */
0068     __u16 nbchannel;    /* number of B-Channels */
0069     __u32 goptions;     /* global options */
0070     __u32 support1;     /* B1 protocols support */
0071     __u32 support2;     /* B2 protocols support */
0072     __u32 support3;     /* B3 protocols support */
0073     __u32 reserved[6];  /* reserved */
0074     __u32 manu[5];      /* manufacturer specific information */
0075 } capi_profile;
0076 
0077 #define CAPI_GET_PROFILE    _IOWR('C',0x09,struct capi_profile)
0078 
0079 typedef struct capi_manufacturer_cmd {
0080     unsigned long cmd;
0081     void __user *data;
0082 } capi_manufacturer_cmd;
0083 
0084 /*
0085  * CAPI_MANUFACTURER_CMD
0086  */
0087 
0088 #define CAPI_MANUFACTURER_CMD   _IOWR('C',0x20, struct capi_manufacturer_cmd)
0089 
0090 /*
0091  * CAPI_GET_ERRCODE
0092  * capi errcode is set, * if read, write, or ioctl returns EIO,
0093  * ioctl returns errcode directly, and in arg, if != 0
0094  */
0095 
0096 #define CAPI_GET_ERRCODE    _IOR('C',0x21, __u16)
0097 
0098 /*
0099  * CAPI_INSTALLED
0100  */
0101 #define CAPI_INSTALLED      _IOR('C',0x22, __u16)
0102 
0103 
0104 /*
0105  * member contr is input for
0106  * CAPI_GET_MANUFACTURER, CAPI_GET_VERSION, CAPI_GET_SERIAL
0107  * and CAPI_GET_PROFILE
0108  */
0109 typedef union capi_ioctl_struct {
0110     __u32 contr;
0111     capi_register_params rparams;
0112     __u8 manufacturer[CAPI_MANUFACTURER_LEN];
0113     capi_version version;
0114     __u8 serial[CAPI_SERIAL_LEN];
0115     capi_profile profile;
0116     capi_manufacturer_cmd cmd;
0117     __u16 errcode;
0118 } capi_ioctl_struct;
0119 
0120 /*
0121  * Middleware extension
0122  */
0123 
0124 #define CAPIFLAG_HIGHJACKING    0x0001
0125 
0126 #define CAPI_GET_FLAGS      _IOR('C',0x23, unsigned)
0127 #define CAPI_SET_FLAGS      _IOR('C',0x24, unsigned)
0128 #define CAPI_CLR_FLAGS      _IOR('C',0x25, unsigned)
0129 
0130 #define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
0131 
0132 #define CAPI_NCCI_GETUNIT   _IOR('C',0x27, unsigned)
0133 
0134 #endif              /* __LINUX_CAPI_H__ */