linux-headers (unknown)

(root)/
include/
linux/
capi.h
       1  /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
       2  /* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
       3   * 
       4   * CAPI 2.0 Interface for Linux
       5   * 
       6   * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
       7   * 
       8   * This software may be used and distributed according to the terms
       9   * of the GNU General Public License, incorporated herein by reference.
      10   *
      11   */
      12  
      13  #ifndef __LINUX_CAPI_H__
      14  #define __LINUX_CAPI_H__
      15  
      16  #include <linux/types.h>
      17  #include <linux/ioctl.h>
      18  #include <linux/kernelcapi.h>
      19  
      20  /*
      21   * CAPI_REGISTER
      22   */
      23  
      24  typedef struct capi_register_params {	/* CAPI_REGISTER */
      25  	__u32 level3cnt;	/* No. of simulatneous user data connections */
      26  	__u32 datablkcnt;	/* No. of buffered data messages */
      27  	__u32 datablklen;	/* Size of buffered data messages */
      28  } capi_register_params;
      29  
      30  #define	CAPI_REGISTER	_IOW('C',0x01,struct capi_register_params)
      31  
      32  /*
      33   * CAPI_GET_MANUFACTURER
      34   */
      35  
      36  #define CAPI_MANUFACTURER_LEN		64
      37  
      38  #define	CAPI_GET_MANUFACTURER	_IOWR('C',0x06,int)	/* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
      39  
      40  /*
      41   * CAPI_GET_VERSION
      42   */
      43  
      44  typedef struct capi_version {
      45  	__u32 majorversion;
      46  	__u32 minorversion;
      47  	__u32 majormanuversion;
      48  	__u32 minormanuversion;
      49  } capi_version;
      50  
      51  #define CAPI_GET_VERSION	_IOWR('C',0x07,struct capi_version)
      52  
      53  /*
      54   * CAPI_GET_SERIAL
      55   */
      56  
      57  #define CAPI_SERIAL_LEN		8
      58  #define CAPI_GET_SERIAL		_IOWR('C',0x08,int)	/* broken: wanted size 8 (CAPI_SERIAL_LEN) */
      59  
      60  /*
      61   * CAPI_GET_PROFILE
      62   */
      63  
      64  typedef struct capi_profile {
      65  	__u16 ncontroller;	/* number of installed controller */
      66  	__u16 nbchannel;	/* number of B-Channels */
      67  	__u32 goptions;		/* global options */
      68  	__u32 support1;		/* B1 protocols support */
      69  	__u32 support2;		/* B2 protocols support */
      70  	__u32 support3;		/* B3 protocols support */
      71  	__u32 reserved[6];	/* reserved */
      72  	__u32 manu[5];		/* manufacturer specific information */
      73  } capi_profile;
      74  
      75  #define CAPI_GET_PROFILE	_IOWR('C',0x09,struct capi_profile)
      76  
      77  typedef struct capi_manufacturer_cmd {
      78  	unsigned long cmd;
      79  	void *data;
      80  } capi_manufacturer_cmd;
      81  
      82  /*
      83   * CAPI_MANUFACTURER_CMD
      84   */
      85  
      86  #define CAPI_MANUFACTURER_CMD	_IOWR('C',0x20, struct capi_manufacturer_cmd)
      87  
      88  /*
      89   * CAPI_GET_ERRCODE
      90   * capi errcode is set, * if read, write, or ioctl returns EIO,
      91   * ioctl returns errcode directly, and in arg, if != 0
      92   */
      93  
      94  #define CAPI_GET_ERRCODE	_IOR('C',0x21, __u16)
      95  
      96  /*
      97   * CAPI_INSTALLED
      98   */
      99  #define CAPI_INSTALLED		_IOR('C',0x22, __u16)
     100  
     101  
     102  /*
     103   * member contr is input for
     104   * CAPI_GET_MANUFACTURER, CAPI_GET_VERSION, CAPI_GET_SERIAL
     105   * and CAPI_GET_PROFILE
     106   */
     107  typedef union capi_ioctl_struct {
     108  	__u32 contr;
     109  	capi_register_params rparams;
     110  	__u8 manufacturer[CAPI_MANUFACTURER_LEN];
     111  	capi_version version;
     112  	__u8 serial[CAPI_SERIAL_LEN];
     113  	capi_profile profile;
     114  	capi_manufacturer_cmd cmd;
     115  	__u16 errcode;
     116  } capi_ioctl_struct;
     117  
     118  /*
     119   * Middleware extension
     120   */
     121  
     122  #define CAPIFLAG_HIGHJACKING	0x0001
     123  
     124  #define CAPI_GET_FLAGS		_IOR('C',0x23, unsigned)
     125  #define CAPI_SET_FLAGS		_IOR('C',0x24, unsigned)
     126  #define CAPI_CLR_FLAGS		_IOR('C',0x25, unsigned)
     127  
     128  #define CAPI_NCCI_OPENCOUNT	_IOR('C',0x26, unsigned)
     129  
     130  #define CAPI_NCCI_GETUNIT	_IOR('C',0x27, unsigned)
     131  
     132  #endif				/* __LINUX_CAPI_H__ */