n_r3964.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* r3964 linediscipline for linux
  2. *
  3. * -----------------------------------------------------------
  4. * Copyright by
  5. * Philips Automation Projects
  6. * Kassel (Germany)
  7. * -----------------------------------------------------------
  8. * This software may be used and distributed according to the terms of
  9. * the GNU General Public License, incorporated herein by reference.
  10. *
  11. * Author:
  12. * L. Haag
  13. *
  14. * $Log: r3964.h,v $
  15. * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
  16. * Fixed HZ usage on 2.6 kernels
  17. * Removed unnecessary include
  18. *
  19. * Revision 1.3 2001/03/18 13:02:24 dwmw2
  20. * Fix timer usage, use spinlocks properly.
  21. *
  22. * Revision 1.2 2001/03/18 12:53:15 dwmw2
  23. * Merge changes in 2.4.2
  24. *
  25. * Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
  26. * This'll screw the version control
  27. *
  28. * Revision 1.6 1998/09/30 00:40:38 dwmw2
  29. * Updated to use kernel's N_R3964 if available
  30. *
  31. * Revision 1.4 1998/04/02 20:29:44 lhaag
  32. * select, blocking, ...
  33. *
  34. * Revision 1.3 1998/02/12 18:58:43 root
  35. * fixed some memory leaks
  36. * calculation of checksum characters
  37. *
  38. * Revision 1.2 1998/02/07 13:03:17 root
  39. * ioctl read_telegram
  40. *
  41. * Revision 1.1 1998/02/06 19:19:43 root
  42. * Initial revision
  43. *
  44. *
  45. */
  46. #ifndef _UAPI__LINUX_N_R3964_H__
  47. #define _UAPI__LINUX_N_R3964_H__
  48. /* line disciplines for r3964 protocol */
  49. /*
  50. * Ioctl-commands
  51. */
  52. #define R3964_ENABLE_SIGNALS 0x5301
  53. #define R3964_SETPRIORITY 0x5302
  54. #define R3964_USE_BCC 0x5303
  55. #define R3964_READ_TELEGRAM 0x5304
  56. /* Options for R3964_SETPRIORITY */
  57. #define R3964_MASTER 0
  58. #define R3964_SLAVE 1
  59. /* Options for R3964_ENABLE_SIGNALS */
  60. #define R3964_SIG_ACK 0x0001
  61. #define R3964_SIG_DATA 0x0002
  62. #define R3964_SIG_ALL 0x000f
  63. #define R3964_SIG_NONE 0x0000
  64. #define R3964_USE_SIGIO 0x1000
  65. /*
  66. * r3964 operation states:
  67. */
  68. /* types for msg_id: */
  69. enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
  70. #define R3964_MAX_MSG_COUNT 32
  71. /* error codes for client messages */
  72. #define R3964_OK 0 /* no error. */
  73. #define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
  74. #define R3964_OVERFLOW -2 /* msg queue overflow */
  75. /* the client gets this struct when calling read(fd,...): */
  76. struct r3964_client_message {
  77. int msg_id;
  78. int arg;
  79. int error_code;
  80. };
  81. #define R3964_MTU 256
  82. #endif /* _UAPI__LINUX_N_R3964_H__ */