kernelcapi.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $
  3. *
  4. * Kernel CAPI 2.0 Interface for Linux
  5. *
  6. * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
  7. *
  8. */
  9. #ifndef __KERNELCAPI_H__
  10. #define __KERNELCAPI_H__
  11. #define CAPI_MAXAPPL 240 /* maximum number of applications */
  12. #define CAPI_MAXCONTR 32 /* maximum number of controller */
  13. #define CAPI_MAXDATAWINDOW 8
  14. typedef struct kcapi_flagdef {
  15. int contr;
  16. int flag;
  17. } kcapi_flagdef;
  18. typedef struct kcapi_carddef {
  19. char driver[32];
  20. unsigned int port;
  21. unsigned irq;
  22. unsigned int membase;
  23. int cardnr;
  24. } kcapi_carddef;
  25. /* new ioctls >= 10 */
  26. #define KCAPI_CMD_TRACE 10
  27. #define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */
  28. /*
  29. * flag > 2 => trace also data
  30. * flag & 1 => show trace
  31. */
  32. #define KCAPI_TRACE_OFF 0
  33. #define KCAPI_TRACE_SHORT_NO_DATA 1
  34. #define KCAPI_TRACE_FULL_NO_DATA 2
  35. #define KCAPI_TRACE_SHORT 3
  36. #define KCAPI_TRACE_FULL 4
  37. #ifdef __KERNEL__
  38. #include <linux/list.h>
  39. #include <linux/skbuff.h>
  40. #include <linux/workqueue.h>
  41. #include <linux/notifier.h>
  42. struct capi20_appl {
  43. u16 applid;
  44. capi_register_params rparam;
  45. void (*recv_message)(struct capi20_appl *ap, struct sk_buff *skb);
  46. void *private;
  47. /* internal to kernelcapi.o */
  48. unsigned long nrecvctlpkt;
  49. unsigned long nrecvdatapkt;
  50. unsigned long nsentctlpkt;
  51. unsigned long nsentdatapkt;
  52. struct mutex recv_mtx;
  53. struct sk_buff_head recv_queue;
  54. struct work_struct recv_work;
  55. int release_in_progress;
  56. };
  57. u16 capi20_isinstalled(void);
  58. u16 capi20_register(struct capi20_appl *ap);
  59. u16 capi20_release(struct capi20_appl *ap);
  60. u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb);
  61. u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
  62. u16 capi20_get_version(u32 contr, struct capi_version *verp);
  63. u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
  64. u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
  65. int capi20_manufacturer(unsigned int cmd, void __user *data);
  66. #define CAPICTR_UP 0
  67. #define CAPICTR_DOWN 1
  68. int register_capictr_notifier(struct notifier_block *nb);
  69. int unregister_capictr_notifier(struct notifier_block *nb);
  70. #define CAPI_NOERROR 0x0000
  71. #define CAPI_TOOMANYAPPLS 0x1001
  72. #define CAPI_LOGBLKSIZETOSMALL 0x1002
  73. #define CAPI_BUFFEXECEEDS64K 0x1003
  74. #define CAPI_MSGBUFSIZETOOSMALL 0x1004
  75. #define CAPI_ANZLOGCONNNOTSUPPORTED 0x1005
  76. #define CAPI_REGRESERVED 0x1006
  77. #define CAPI_REGBUSY 0x1007
  78. #define CAPI_REGOSRESOURCEERR 0x1008
  79. #define CAPI_REGNOTINSTALLED 0x1009
  80. #define CAPI_REGCTRLERNOTSUPPORTEXTEQUIP 0x100a
  81. #define CAPI_REGCTRLERONLYSUPPORTEXTEQUIP 0x100b
  82. #define CAPI_ILLAPPNR 0x1101
  83. #define CAPI_ILLCMDORSUBCMDORMSGTOSMALL 0x1102
  84. #define CAPI_SENDQUEUEFULL 0x1103
  85. #define CAPI_RECEIVEQUEUEEMPTY 0x1104
  86. #define CAPI_RECEIVEOVERFLOW 0x1105
  87. #define CAPI_UNKNOWNNOTPAR 0x1106
  88. #define CAPI_MSGBUSY 0x1107
  89. #define CAPI_MSGOSRESOURCEERR 0x1108
  90. #define CAPI_MSGNOTINSTALLED 0x1109
  91. #define CAPI_MSGCTRLERNOTSUPPORTEXTEQUIP 0x110a
  92. #define CAPI_MSGCTRLERONLYSUPPORTEXTEQUIP 0x110b
  93. typedef enum {
  94. CapiMessageNotSupportedInCurrentState = 0x2001,
  95. CapiIllContrPlciNcci = 0x2002,
  96. CapiNoPlciAvailable = 0x2003,
  97. CapiNoNcciAvailable = 0x2004,
  98. CapiNoListenResourcesAvailable = 0x2005,
  99. CapiNoFaxResourcesAvailable = 0x2006,
  100. CapiIllMessageParmCoding = 0x2007,
  101. } RESOURCE_CODING_PROBLEM;
  102. typedef enum {
  103. CapiB1ProtocolNotSupported = 0x3001,
  104. CapiB2ProtocolNotSupported = 0x3002,
  105. CapiB3ProtocolNotSupported = 0x3003,
  106. CapiB1ProtocolParameterNotSupported = 0x3004,
  107. CapiB2ProtocolParameterNotSupported = 0x3005,
  108. CapiB3ProtocolParameterNotSupported = 0x3006,
  109. CapiBProtocolCombinationNotSupported = 0x3007,
  110. CapiNcpiNotSupported = 0x3008,
  111. CapiCipValueUnknown = 0x3009,
  112. CapiFlagsNotSupported = 0x300a,
  113. CapiFacilityNotSupported = 0x300b,
  114. CapiDataLengthNotSupportedByCurrentProtocol = 0x300c,
  115. CapiResetProcedureNotSupportedByCurrentProtocol = 0x300d,
  116. CapiTeiAssignmentFailed = 0x300e,
  117. } REQUESTED_SERVICES_PROBLEM;
  118. typedef enum {
  119. CapiSuccess = 0x0000,
  120. CapiSupplementaryServiceNotSupported = 0x300e,
  121. CapiRequestNotAllowedInThisState = 0x3010,
  122. } SUPPLEMENTARY_SERVICE_INFO;
  123. typedef enum {
  124. CapiProtocolErrorLayer1 = 0x3301,
  125. CapiProtocolErrorLayer2 = 0x3302,
  126. CapiProtocolErrorLayer3 = 0x3303,
  127. CapiTimeOut = 0x3303, // SuppServiceReason
  128. CapiCallGivenToOtherApplication = 0x3304,
  129. } CAPI_REASON;
  130. #endif /* __KERNEL__ */
  131. #endif /* __KERNELCAPI_H__ */