gpib_ioctl.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /***************************************************************************
  2. gpib_ioctl.h - header file for gpib library
  3. -------------------
  4. copyright : (C) 2002 by Frank Mori Hess
  5. email : fmhess@users.sourceforge.net
  6. ***************************************************************************/
  7. /***************************************************************************
  8. * *
  9. * This program is free software; you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation; either version 2 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. ***************************************************************************/
  15. #ifndef _GPIB_IOCTL_H
  16. #define _GPIB_IOCTL_H
  17. #include <asm/ioctl.h>
  18. #include <linux/types.h>
  19. #define GPIB_CODE 160
  20. typedef struct
  21. {
  22. char name[100];
  23. } board_type_ioctl_t;
  24. /* argument for read/write/command ioctls */
  25. typedef struct
  26. {
  27. uint64_t buffer_ptr;
  28. unsigned count;
  29. int end;
  30. int handle;
  31. int padding; // padding so struct size doesn't change between 32/64 bit compilation
  32. } read_write_ioctl_t;
  33. typedef struct
  34. {
  35. unsigned int handle;
  36. unsigned int pad;
  37. int sad;
  38. unsigned is_board : 1;
  39. } open_dev_ioctl_t;
  40. typedef struct
  41. {
  42. unsigned int handle;
  43. } close_dev_ioctl_t;
  44. typedef struct
  45. {
  46. unsigned int pad;
  47. int sad;
  48. uint8_t status_byte;
  49. } serial_poll_ioctl_t;
  50. typedef struct
  51. {
  52. int eos;
  53. int eos_flags;
  54. } eos_ioctl_t;
  55. typedef struct
  56. {
  57. int handle;
  58. int wait_mask;
  59. int clear_mask;
  60. int set_mask;
  61. int ibsta;
  62. int pad;
  63. int sad;
  64. unsigned usec_timeout;
  65. } wait_ioctl_t;
  66. typedef struct
  67. {
  68. uint64_t init_data_ptr;
  69. int init_data_length;
  70. int online;
  71. } online_ioctl_t;
  72. typedef struct
  73. {
  74. unsigned int num_bytes;
  75. unsigned int pad;
  76. int sad;
  77. } spoll_bytes_ioctl_t;
  78. typedef struct
  79. {
  80. unsigned int pad;
  81. int sad;
  82. int parallel_poll_configuration;
  83. int autopolling;
  84. int is_system_controller;
  85. unsigned int t1_delay;
  86. unsigned ist : 1;
  87. unsigned no_7_bit_eos : 1;
  88. } board_info_ioctl_t;
  89. typedef struct
  90. {
  91. int pci_bus;
  92. int pci_slot;
  93. } select_pci_ioctl_t;
  94. typedef struct
  95. {
  96. uint8_t config;
  97. unsigned set_ist : 1;
  98. unsigned clear_ist : 1;
  99. } ppoll_config_ioctl_t;
  100. typedef struct
  101. {
  102. unsigned int handle;
  103. unsigned int pad;
  104. } pad_ioctl_t;
  105. typedef struct
  106. {
  107. unsigned int handle;
  108. int sad;
  109. } sad_ioctl_t;
  110. typedef short event_ioctl_t;
  111. typedef int rsc_ioctl_t;
  112. typedef unsigned int t1_delay_ioctl_t;
  113. typedef short autospoll_ioctl_t;
  114. /* Standard functions. */
  115. enum gpib_ioctl
  116. {
  117. IBRD = _IOWR( GPIB_CODE, 0, read_write_ioctl_t ),
  118. IBWRT = _IOWR( GPIB_CODE, 1, read_write_ioctl_t ),
  119. IBCMD = _IOWR( GPIB_CODE, 2, read_write_ioctl_t ),
  120. IBOPENDEV = _IOWR( GPIB_CODE, 3, open_dev_ioctl_t ),
  121. IBCLOSEDEV = _IOW( GPIB_CODE, 4, close_dev_ioctl_t ),
  122. IBWAIT = _IOWR( GPIB_CODE, 5, wait_ioctl_t ),
  123. IBRPP = _IOWR( GPIB_CODE, 6, uint8_t ),
  124. IBSIC = _IOW( GPIB_CODE, 9, unsigned int ),
  125. IBSRE = _IOW( GPIB_CODE, 10, int ),
  126. IBGTS = _IO( GPIB_CODE, 11 ),
  127. IBCAC = _IOW( GPIB_CODE, 12, int ),
  128. IBLINES = _IOR( GPIB_CODE, 14, short ),
  129. IBPAD = _IOW( GPIB_CODE, 15, pad_ioctl_t ),
  130. IBSAD = _IOW( GPIB_CODE, 16, sad_ioctl_t ),
  131. IBTMO = _IOW( GPIB_CODE, 17, unsigned int ),
  132. IBRSP = _IOWR( GPIB_CODE, 18, serial_poll_ioctl_t ),
  133. IBEOS = _IOW( GPIB_CODE, 19, eos_ioctl_t ),
  134. IBRSV = _IOW( GPIB_CODE, 20, uint8_t ),
  135. CFCBASE = _IOW( GPIB_CODE, 21, uint64_t ),
  136. CFCIRQ = _IOW( GPIB_CODE, 22, unsigned int ),
  137. CFCDMA = _IOW( GPIB_CODE, 23, unsigned int ),
  138. CFCBOARDTYPE = _IOW( GPIB_CODE, 24, board_type_ioctl_t ),
  139. IBMUTEX = _IOW( GPIB_CODE, 26, int ),
  140. IBSPOLL_BYTES = _IOWR( GPIB_CODE, 27, spoll_bytes_ioctl_t ),
  141. IBPPC = _IOW( GPIB_CODE, 28, ppoll_config_ioctl_t ),
  142. IBBOARD_INFO = _IOR( GPIB_CODE, 29, board_info_ioctl_t ),
  143. IBQUERY_BOARD_RSV = _IOR( GPIB_CODE, 31, int ),
  144. IBSELECT_PCI = _IOWR( GPIB_CODE, 32, select_pci_ioctl_t ),
  145. IBEVENT = _IOR( GPIB_CODE, 33, event_ioctl_t ),
  146. IBRSC = _IOW( GPIB_CODE, 34, rsc_ioctl_t ),
  147. IB_T1_DELAY = _IOW( GPIB_CODE, 35, t1_delay_ioctl_t ),
  148. IBLOC = _IO( GPIB_CODE, 36 ),
  149. IBAUTOSPOLL = _IOW( GPIB_CODE, 38, autospoll_ioctl_t ),
  150. IBONL = _IOW( GPIB_CODE, 39, online_ioctl_t )
  151. };
  152. #endif /* _GPIB_IOCTL_H */