capi.h 3.0 KB

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