capi.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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@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. #ifndef __LINUX_CAPI_H__
  12. #define __LINUX_CAPI_H__
  13. #include <linux/types.h>
  14. #include <linux/ioctl.h>
  15. #include <linux/kernelcapi.h>
  16. /*
  17. * CAPI_REGISTER
  18. */
  19. typedef struct capi_register_params { /* CAPI_REGISTER */
  20. __u32 level3cnt; /* No. of simulatneous user data connections */
  21. __u32 datablkcnt; /* No. of buffered data messages */
  22. __u32 datablklen; /* Size of buffered data messages */
  23. } capi_register_params;
  24. #define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
  25. /*
  26. * CAPI_GET_MANUFACTURER
  27. */
  28. #define CAPI_MANUFACTURER_LEN 64
  29. #define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
  30. /*
  31. * CAPI_GET_VERSION
  32. */
  33. typedef struct capi_version {
  34. __u32 majorversion;
  35. __u32 minorversion;
  36. __u32 majormanuversion;
  37. __u32 minormanuversion;
  38. } capi_version;
  39. #define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
  40. /*
  41. * CAPI_GET_SERIAL
  42. */
  43. #define CAPI_SERIAL_LEN 8
  44. #define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
  45. /*
  46. * CAPI_GET_PROFILE
  47. */
  48. typedef struct capi_profile {
  49. __u16 ncontroller; /* number of installed controller */
  50. __u16 nbchannel; /* number of B-Channels */
  51. __u32 goptions; /* global options */
  52. __u32 support1; /* B1 protocols support */
  53. __u32 support2; /* B2 protocols support */
  54. __u32 support3; /* B3 protocols support */
  55. __u32 reserved[6]; /* reserved */
  56. __u32 manu[5]; /* manufacturer specific information */
  57. } capi_profile;
  58. #define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
  59. typedef struct capi_manufacturer_cmd {
  60. unsigned long cmd;
  61. void *data;
  62. } capi_manufacturer_cmd;
  63. /*
  64. * CAPI_MANUFACTURER_CMD
  65. */
  66. #define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
  67. /*
  68. * CAPI_GET_ERRCODE
  69. * capi errcode is set, * if read, write, or ioctl returns EIO,
  70. * ioctl returns errcode directly, and in arg, if != 0
  71. */
  72. #define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
  73. /*
  74. * CAPI_INSTALLED
  75. */
  76. #define CAPI_INSTALLED _IOR('C',0x22, __u16)
  77. /*
  78. * member contr is input for
  79. * CAPI_GET_MANUFACTURER, CAPI_GET_VERSION, CAPI_GET_SERIAL
  80. * and CAPI_GET_PROFILE
  81. */
  82. typedef union capi_ioctl_struct {
  83. __u32 contr;
  84. capi_register_params rparams;
  85. __u8 manufacturer[CAPI_MANUFACTURER_LEN];
  86. capi_version version;
  87. __u8 serial[CAPI_SERIAL_LEN];
  88. capi_profile profile;
  89. capi_manufacturer_cmd cmd;
  90. __u16 errcode;
  91. } capi_ioctl_struct;
  92. /*
  93. * Middleware extension
  94. */
  95. #define CAPIFLAG_HIGHJACKING 0x0001
  96. #define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
  97. #define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
  98. #define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
  99. #define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
  100. #define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
  101. #endif /* __LINUX_CAPI_H__ */