| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 2 | |
| 3 | /*************************************************************************** |
| 4 | * copyright : (C) 2002 by Frank Mori Hess |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #ifndef _GPIB_IOCTL_H |
| 8 | #define _GPIB_IOCTL_H |
| 9 | |
| 10 | #include <asm/ioctl.h> |
| 11 | #include <linux/types.h> |
| 12 | |
| 13 | #define GPIB_CODE 160 |
| 14 | |
| 15 | struct gpib_board_type_ioctl { |
| 16 | char name[100]; |
| 17 | }; |
| 18 | |
| 19 | /* argument for read/write/command ioctls */ |
| 20 | struct gpib_read_write_ioctl { |
| 21 | __u64 buffer_ptr; |
| 22 | __u32 requested_transfer_count; |
| 23 | __u32 completed_transfer_count; |
| 24 | __s32 end; /* end flag return for reads, end io suppression request for cmd*/ |
| 25 | __s32 handle; |
| 26 | }; |
| 27 | |
| 28 | struct gpib_open_dev_ioctl { |
| 29 | __u32 handle; |
| 30 | __u32 pad; |
| 31 | __s32 sad; |
| 32 | __u32 is_board; |
| 33 | }; |
| 34 | |
| 35 | struct gpib_close_dev_ioctl { |
| 36 | __u32 handle; |
| 37 | }; |
| 38 | |
| 39 | struct gpib_serial_poll_ioctl { |
| 40 | __u32 pad; |
| 41 | __s32 sad; |
| 42 | __u8 status_byte; |
| 43 | __u8 padding[3]; /* align to 32 bit boundary */ |
| 44 | }; |
| 45 | |
| 46 | struct gpib_eos_ioctl { |
| 47 | __s32 eos; |
| 48 | __s32 eos_flags; |
| 49 | }; |
| 50 | |
| 51 | struct gpib_wait_ioctl { |
| 52 | __s32 handle; |
| 53 | __s32 wait_mask; |
| 54 | __s32 clear_mask; |
| 55 | __s32 set_mask; |
| 56 | __s32 ibsta; |
| 57 | __s32 pad; |
| 58 | __s32 sad; |
| 59 | __u32 usec_timeout; |
| 60 | }; |
| 61 | |
| 62 | struct gpib_online_ioctl { |
| 63 | __u64 init_data_ptr; |
| 64 | __s32 init_data_length; |
| 65 | __s32 online; |
| 66 | }; |
| 67 | |
| 68 | struct gpib_spoll_bytes_ioctl { |
| 69 | __u32 num_bytes; |
| 70 | __u32 pad; |
| 71 | __s32 sad; |
| 72 | }; |
| 73 | |
| 74 | struct gpib_board_info_ioctl { |
| 75 | __u32 pad; |
| 76 | __s32 sad; |
| 77 | __s32 parallel_poll_configuration; |
| 78 | __s32 autopolling; |
| 79 | __s32 is_system_controller; |
| 80 | __u32 t1_delay; |
| 81 | unsigned ist : 1; |
| 82 | unsigned no_7_bit_eos : 1; |
| 83 | unsigned padding :30; /* align to 32 bit boundary */ |
| 84 | }; |
| 85 | |
| 86 | struct gpib_select_pci_ioctl { |
| 87 | __s32 pci_bus; |
| 88 | __s32 pci_slot; |
| 89 | }; |
| 90 | |
| 91 | struct gpib_ppoll_config_ioctl { |
| 92 | __u8 config; |
| 93 | unsigned set_ist : 1; |
| 94 | unsigned clear_ist : 1; |
| 95 | unsigned padding :22; /* align to 32 bit boundary */ |
| 96 | }; |
| 97 | |
| 98 | struct gpib_pad_ioctl { |
| 99 | __u32 handle; |
| 100 | __u32 pad; |
| 101 | }; |
| 102 | |
| 103 | struct gpib_sad_ioctl { |
| 104 | __u32 handle; |
| 105 | __s32 sad; |
| 106 | }; |
| 107 | |
| 108 | /* select a piece of hardware to attach by its sysfs device path */ |
| 109 | struct gpib_select_device_path_ioctl { |
| 110 | char device_path[0x1000]; |
| 111 | }; |
| 112 | |
| 113 | /* update status byte and request service */ |
| 114 | struct gpib_request_service2 { |
| 115 | __u8 status_byte; |
| 116 | __u8 padding[3]; /* align to 32 bit boundary */ |
| 117 | __s32 new_reason_for_service; |
| 118 | }; |
| 119 | |
| 120 | /* Standard functions. */ |
| 121 | enum gpib_ioctl { |
| 122 | IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl), |
| 123 | IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl), |
| 124 | IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl), |
| 125 | IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl), |
| 126 | IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl), |
| 127 | IBWAIT = _IOWR(GPIB_CODE, 5, struct gpib_wait_ioctl), |
| 128 | IBRPP = _IOWR(GPIB_CODE, 6, __u8), |
| 129 | |
| 130 | IBSIC = _IOW(GPIB_CODE, 9, __u32), |
| 131 | IBSRE = _IOW(GPIB_CODE, 10, __s32), |
| 132 | IBGTS = _IO(GPIB_CODE, 11), |
| 133 | IBCAC = _IOW(GPIB_CODE, 12, __s32), |
| 134 | IBLINES = _IOR(GPIB_CODE, 14, __s16), |
| 135 | IBPAD = _IOW(GPIB_CODE, 15, struct gpib_pad_ioctl), |
| 136 | IBSAD = _IOW(GPIB_CODE, 16, struct gpib_sad_ioctl), |
| 137 | IBTMO = _IOW(GPIB_CODE, 17, __u32), |
| 138 | IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), |
| 139 | IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl), |
| 140 | IBRSV = _IOW(GPIB_CODE, 20, __u8), |
| 141 | CFCBASE = _IOW(GPIB_CODE, 21, __u64), |
| 142 | CFCIRQ = _IOW(GPIB_CODE, 22, __u32), |
| 143 | CFCDMA = _IOW(GPIB_CODE, 23, __u32), |
| 144 | CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl), |
| 145 | |
| 146 | IBMUTEX = _IOW(GPIB_CODE, 26, __s32), |
| 147 | IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl), |
| 148 | IBPPC = _IOW(GPIB_CODE, 28, struct gpib_ppoll_config_ioctl), |
| 149 | IBBOARD_INFO = _IOR(GPIB_CODE, 29, struct gpib_board_info_ioctl), |
| 150 | |
| 151 | IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, __s32), |
| 152 | IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl), |
| 153 | IBEVENT = _IOR(GPIB_CODE, 33, __s16), |
| 154 | IBRSC = _IOW(GPIB_CODE, 34, __s32), |
| 155 | IB_T1_DELAY = _IOW(GPIB_CODE, 35, __u32), |
| 156 | IBLOC = _IO(GPIB_CODE, 36), |
| 157 | |
| 158 | IBAUTOSPOLL = _IOW(GPIB_CODE, 38, __s16), |
| 159 | IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl), |
| 160 | IBPP2_SET = _IOW(GPIB_CODE, 40, __s16), |
| 161 | IBPP2_GET = _IOR(GPIB_CODE, 41, __s16), |
| 162 | IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl), |
| 163 | /* 44 was IBSELECT_SERIAL_NUMBER */ |
| 164 | IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2) |
| 165 | }; |
| 166 | |
| 167 | #endif /* _GPIB_IOCTL_H */ |
| 168 | |