Home | History | Annotate | Download | only in linux
      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 (at) 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.
      9  *
     10  */
     11 
     12 #ifndef __LINUX_CAPI_H__
     13 #define __LINUX_CAPI_H__
     14 
     15 #include <asm/types.h>
     16 #include <linux/ioctl.h>
     17 #include <linux/kernelcapi.h>
     18 
     19 /*
     20  * CAPI_REGISTER
     21  */
     22 
     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;
     28 
     29 #define	CAPI_REGISTER	_IOW('C',0x01,struct capi_register_params)
     30 
     31 /*
     32  * CAPI_GET_MANUFACTURER
     33  */
     34 
     35 #define CAPI_MANUFACTURER_LEN		64
     36 
     37 #define	CAPI_GET_MANUFACTURER	_IOWR('C',0x06,int)	/* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
     38 
     39 /*
     40  * CAPI_GET_VERSION
     41  */
     42 
     43 typedef struct capi_version {
     44 	__u32 majorversion;
     45 	__u32 minorversion;
     46 	__u32 majormanuversion;
     47 	__u32 minormanuversion;
     48 } capi_version;
     49 
     50 #define CAPI_GET_VERSION	_IOWR('C',0x07,struct capi_version)
     51 
     52 /*
     53  * CAPI_GET_SERIAL
     54  */
     55 
     56 #define CAPI_SERIAL_LEN		8
     57 #define CAPI_GET_SERIAL		_IOWR('C',0x08,int)	/* broken: wanted size 8 (CAPI_SERIAL_LEN) */
     58 
     59 /*
     60  * CAPI_GET_PROFILE
     61  */
     62 
     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;
     73 
     74 #define CAPI_GET_PROFILE	_IOWR('C',0x09,struct capi_profile)
     75 
     76 typedef struct capi_manufacturer_cmd {
     77 	unsigned long cmd;
     78 	void *data;
     79 } capi_manufacturer_cmd;
     80 
     81 /*
     82  * CAPI_MANUFACTURER_CMD
     83  */
     84 
     85 #define CAPI_MANUFACTURER_CMD	_IOWR('C',0x20, struct capi_manufacturer_cmd)
     86 
     87 /*
     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
     91  */
     92 
     93 #define CAPI_GET_ERRCODE	_IOR('C',0x21, __u16)
     94 
     95 /*
     96  * CAPI_INSTALLED
     97  */
     98 #define CAPI_INSTALLED		_IOR('C',0x22, __u16)
     99 
    100 
    101 /*
    102  * member contr is input for
    103  * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
    104  * and CAPI_GET_PROFILE
    105  */
    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;
    116 
    117 /*
    118  * Middleware extension
    119  */
    120 
    121 #define CAPIFLAG_HIGHJACKING	0x0001
    122 
    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)
    126 
    127 #define CAPI_NCCI_OPENCOUNT	_IOR('C',0x26, unsigned)
    128 
    129 #define CAPI_NCCI_GETUNIT	_IOR('C',0x27, unsigned)
    130 
    131 #endif				/* __LINUX_CAPI_H__ */
    132