kernelcapi.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. #include <linux/list.h>
  12. #include <linux/skbuff.h>
  13. #include <linux/workqueue.h>
  14. #include <linux/notifier.h>
  15. #include <uapi/linux/kernelcapi.h>
  16. struct capi20_appl {
  17. u16 applid;
  18. capi_register_params rparam;
  19. void (*recv_message)(struct capi20_appl *ap, struct sk_buff *skb);
  20. void *private;
  21. /* internal to kernelcapi.o */
  22. unsigned long nrecvctlpkt;
  23. unsigned long nrecvdatapkt;
  24. unsigned long nsentctlpkt;
  25. unsigned long nsentdatapkt;
  26. struct mutex recv_mtx;
  27. struct sk_buff_head recv_queue;
  28. struct work_struct recv_work;
  29. int release_in_progress;
  30. };
  31. u16 capi20_isinstalled(void);
  32. u16 capi20_register(struct capi20_appl *ap);
  33. u16 capi20_release(struct capi20_appl *ap);
  34. u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb);
  35. u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
  36. u16 capi20_get_version(u32 contr, struct capi_version *verp);
  37. u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
  38. u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
  39. int capi20_manufacturer(unsigned long cmd, void __user *data);
  40. #define CAPICTR_UP 0
  41. #define CAPICTR_DOWN 1
  42. int register_capictr_notifier(struct notifier_block *nb);
  43. int unregister_capictr_notifier(struct notifier_block *nb);
  44. #define CAPI_NOERROR 0x0000
  45. #define CAPI_TOOMANYAPPLS 0x1001
  46. #define CAPI_LOGBLKSIZETOSMALL 0x1002
  47. #define CAPI_BUFFEXECEEDS64K 0x1003
  48. #define CAPI_MSGBUFSIZETOOSMALL 0x1004
  49. #define CAPI_ANZLOGCONNNOTSUPPORTED 0x1005
  50. #define CAPI_REGRESERVED 0x1006
  51. #define CAPI_REGBUSY 0x1007
  52. #define CAPI_REGOSRESOURCEERR 0x1008
  53. #define CAPI_REGNOTINSTALLED 0x1009
  54. #define CAPI_REGCTRLERNOTSUPPORTEXTEQUIP 0x100a
  55. #define CAPI_REGCTRLERONLYSUPPORTEXTEQUIP 0x100b
  56. #define CAPI_ILLAPPNR 0x1101
  57. #define CAPI_ILLCMDORSUBCMDORMSGTOSMALL 0x1102
  58. #define CAPI_SENDQUEUEFULL 0x1103
  59. #define CAPI_RECEIVEQUEUEEMPTY 0x1104
  60. #define CAPI_RECEIVEOVERFLOW 0x1105
  61. #define CAPI_UNKNOWNNOTPAR 0x1106
  62. #define CAPI_MSGBUSY 0x1107
  63. #define CAPI_MSGOSRESOURCEERR 0x1108
  64. #define CAPI_MSGNOTINSTALLED 0x1109
  65. #define CAPI_MSGCTRLERNOTSUPPORTEXTEQUIP 0x110a
  66. #define CAPI_MSGCTRLERONLYSUPPORTEXTEQUIP 0x110b
  67. typedef enum {
  68. CapiMessageNotSupportedInCurrentState = 0x2001,
  69. CapiIllContrPlciNcci = 0x2002,
  70. CapiNoPlciAvailable = 0x2003,
  71. CapiNoNcciAvailable = 0x2004,
  72. CapiNoListenResourcesAvailable = 0x2005,
  73. CapiNoFaxResourcesAvailable = 0x2006,
  74. CapiIllMessageParmCoding = 0x2007,
  75. } RESOURCE_CODING_PROBLEM;
  76. typedef enum {
  77. CapiB1ProtocolNotSupported = 0x3001,
  78. CapiB2ProtocolNotSupported = 0x3002,
  79. CapiB3ProtocolNotSupported = 0x3003,
  80. CapiB1ProtocolParameterNotSupported = 0x3004,
  81. CapiB2ProtocolParameterNotSupported = 0x3005,
  82. CapiB3ProtocolParameterNotSupported = 0x3006,
  83. CapiBProtocolCombinationNotSupported = 0x3007,
  84. CapiNcpiNotSupported = 0x3008,
  85. CapiCipValueUnknown = 0x3009,
  86. CapiFlagsNotSupported = 0x300a,
  87. CapiFacilityNotSupported = 0x300b,
  88. CapiDataLengthNotSupportedByCurrentProtocol = 0x300c,
  89. CapiResetProcedureNotSupportedByCurrentProtocol = 0x300d,
  90. CapiTeiAssignmentFailed = 0x300e,
  91. } REQUESTED_SERVICES_PROBLEM;
  92. typedef enum {
  93. CapiSuccess = 0x0000,
  94. CapiSupplementaryServiceNotSupported = 0x300e,
  95. CapiRequestNotAllowedInThisState = 0x3010,
  96. } SUPPLEMENTARY_SERVICE_INFO;
  97. typedef enum {
  98. CapiProtocolErrorLayer1 = 0x3301,
  99. CapiProtocolErrorLayer2 = 0x3302,
  100. CapiProtocolErrorLayer3 = 0x3303,
  101. CapiTimeOut = 0x3303, // SuppServiceReason
  102. CapiCallGivenToOtherApplication = 0x3304,
  103. } CAPI_REASON;
  104. #endif /* __KERNELCAPI_H__ */