2 * Copyright (C) 2005 Meilhaus Electronic GmbH (support@meilhaus.de)
4 * Source File : meioctl.h
5 * Author : GG (Guenter Gebhardt) <g.gebhardt@meilhaus.de>
12 /*=============================================================================
13 Types for the input/output ioctls
14 ===========================================================================*/
16 typedef struct me_io_irq_start {
28 typedef struct me_io_irq_wait {
40 typedef struct me_io_irq_stop {
49 typedef struct me_io_reset_device {
53 } me_io_reset_device_t;
56 typedef struct me_io_reset_subdevice {
61 } me_io_reset_subdevice_t;
64 typedef struct me_io_single_config {
75 } me_io_single_config_t;
78 typedef struct me_io_single {
79 meIOSingle_t *single_list;
86 typedef struct me_io_stream_config {
89 meIOStreamConfig_t *config_list;
91 meIOStreamTrigger_t trigger;
92 int fifo_irq_threshold;
95 } me_io_stream_config_t;
98 typedef struct me_io_stream_new_values {
105 } me_io_stream_new_values_t;
108 typedef struct me_io_stream_read {
116 } me_io_stream_read_t;
119 typedef struct me_io_stream_start {
120 meIOStreamStart_t *start_list;
124 } me_io_stream_start_t;
127 typedef struct me_io_stream_status {
135 } me_io_stream_status_t;
138 typedef struct me_io_stream_stop {
139 meIOStreamStop_t *stop_list;
143 } me_io_stream_stop_t;
146 typedef struct me_io_stream_write {
154 } me_io_stream_write_t;
157 /*=============================================================================
158 Types for the lock ioctls
159 ===========================================================================*/
161 typedef struct me_lock_device {
169 typedef struct me_lock_driver {
176 typedef struct me_lock_subdevice {
182 } me_lock_subdevice_t;
185 /*=============================================================================
186 Types for the query ioctls
187 ===========================================================================*/
189 typedef struct me_query_info_device {
200 } me_query_info_device_t;
203 typedef struct me_query_description_device {
208 } me_query_description_device_t;
211 typedef struct me_query_name_device {
216 } me_query_name_device_t;
219 typedef struct me_query_name_device_driver {
224 } me_query_name_device_driver_t;
227 typedef struct me_query_version_main_driver {
230 } me_query_version_main_driver_t;
233 typedef struct me_query_version_device_driver {
237 } me_query_version_device_driver_t;
240 typedef struct me_query_number_devices {
243 } me_query_number_devices_t;
246 typedef struct me_query_number_subdevices {
250 } me_query_number_subdevices_t;
253 typedef struct me_query_number_channels {
258 } me_query_number_channels_t;
261 typedef struct me_query_number_ranges {
268 } me_query_number_ranges_t;
271 typedef struct me_query_subdevice_by_type {
278 } me_query_subdevice_by_type_t;
281 typedef struct me_query_subdevice_type {
287 } me_query_subdevice_type_t;
290 typedef struct me_query_subdevice_caps {
295 } me_query_subdevice_caps_t;
298 typedef struct me_query_subdevice_caps_args {
305 } me_query_subdevice_caps_args_t;
308 typedef struct me_query_timer {
319 typedef struct me_query_range_by_min_max {
329 } me_query_range_by_min_max_t;
332 typedef struct me_query_range_info {
342 } me_query_range_info_t;
345 /*=============================================================================
346 Types for the configuration ioctls
347 ===========================================================================*/
349 typedef struct me_cfg_tcpip_location {
352 int remote_device_number;
353 } me_cfg_tcpip_location_t;
356 typedef union me_cfg_tcpip {
358 me_cfg_tcpip_location_t location;
362 typedef struct me_cfg_pci_hw_location {
363 unsigned int bus_type;
365 unsigned int device_no;
366 unsigned int function_no;
367 } me_cfg_pci_hw_location_t;
370 typedef struct me_cfg_usb_hw_location {
371 unsigned int bus_type;
372 unsigned int root_hub_no;
373 } me_cfg_usb_hw_location_t;
376 typedef union me_cfg_hw_location {
377 unsigned int bus_type;
378 me_cfg_pci_hw_location_t pci;
379 // me_cfg_usb_hw_location_t usb;
380 } me_cfg_hw_location_t;
383 typedef struct me_cfg_device_info {
384 unsigned int vendor_id;
385 unsigned int device_id;
386 unsigned int serial_no;
387 me_cfg_hw_location_t hw_location;
388 } me_cfg_device_info_t;
391 typedef struct me_cfg_subdevice_info {
394 unsigned int number_channels;
395 } me_cfg_subdevice_info_t;
398 typedef struct me_cfg_range_entry {
402 unsigned int max_data;
403 } me_cfg_range_entry_t;
406 typedef struct me_cfg_mux32m_device {
409 unsigned int ai_channel;
410 unsigned int dio_device;
411 unsigned int dio_subdevice;
412 unsigned int timer_device;
413 unsigned int timer_subdevice;
414 unsigned int mux32s_count;
415 } me_cfg_mux32m_device_t;
418 typedef struct me_cfg_demux32_device {
421 unsigned int ao_channel;
422 unsigned int dio_device;
423 unsigned int dio_subdevice;
424 unsigned int timer_device;
425 unsigned int timer_subdevice;
426 } me_cfg_demux32_device_t;
429 typedef union me_cfg_external_device {
431 me_cfg_mux32m_device_t mux32m;
432 me_cfg_demux32_device_t demux32;
433 } me_cfg_external_device_t;
436 typedef struct me_cfg_subdevice_entry {
437 me_cfg_subdevice_info_t info;
438 me_cfg_range_entry_t *range_list;
441 me_cfg_external_device_t external_device;
442 } me_cfg_subdevice_entry_t;
445 typedef struct me_cfg_device_entry {
446 me_cfg_tcpip_t tcpip;
447 me_cfg_device_info_t info;
448 me_cfg_subdevice_entry_t *subdevice_list;
450 } me_cfg_device_entry_t;
453 typedef struct me_config_load {
454 me_cfg_device_entry_t *device_list;
460 /*=============================================================================
461 The ioctls of the board
462 ===========================================================================*/
464 #define MEMAIN_MAGIC 'y'
466 #define ME_IO_IRQ_ENABLE _IOR (MEMAIN_MAGIC, 1, me_io_irq_start_t)
467 #define ME_IO_IRQ_WAIT _IOR (MEMAIN_MAGIC, 2, me_io_irq_wait_t)
468 #define ME_IO_IRQ_DISABLE _IOR (MEMAIN_MAGIC, 3, me_io_irq_stop_t)
470 #define ME_IO_RESET_DEVICE _IOW (MEMAIN_MAGIC, 4, me_io_reset_device_t)
471 #define ME_IO_RESET_SUBDEVICE _IOW (MEMAIN_MAGIC, 5, me_io_reset_subdevice_t)
473 #define ME_IO_SINGLE _IOWR(MEMAIN_MAGIC, 6, me_io_single_t)
474 #define ME_IO_SINGLE_CONFIG _IOW (MEMAIN_MAGIC, 7, me_io_single_config_t)
476 #define ME_IO_STREAM_CONFIG _IOW (MEMAIN_MAGIC, 8, me_io_stream_config_t)
477 #define ME_IO_STREAM_NEW_VALUES _IOR (MEMAIN_MAGIC, 9, me_io_stream_new_values_t)
478 #define ME_IO_STREAM_READ _IOR (MEMAIN_MAGIC, 10, me_io_stream_read_t)
479 #define ME_IO_STREAM_START _IOW (MEMAIN_MAGIC, 11, me_io_stream_start_t)
480 #define ME_IO_STREAM_STATUS _IOR (MEMAIN_MAGIC, 12, me_io_stream_status_t)
481 #define ME_IO_STREAM_STOP _IOW (MEMAIN_MAGIC, 13, me_io_stream_stop_t)
482 #define ME_IO_STREAM_WRITE _IOW (MEMAIN_MAGIC, 14, me_io_stream_write_t)
484 #define ME_LOCK_DRIVER _IOW (MEMAIN_MAGIC, 15, me_lock_driver_t)
485 #define ME_LOCK_DEVICE _IOW (MEMAIN_MAGIC, 16, me_lock_device_t)
486 #define ME_LOCK_SUBDEVICE _IOW (MEMAIN_MAGIC, 17, me_lock_subdevice_t)
488 #define ME_QUERY_DESCRIPTION_DEVICE _IOR (MEMAIN_MAGIC, 18, me_query_description_device_t)
490 #define ME_QUERY_INFO_DEVICE _IOR (MEMAIN_MAGIC, 19, me_query_info_device_t)
492 #define ME_QUERY_NAME_DEVICE _IOR (MEMAIN_MAGIC, 20, me_query_name_device_t)
493 #define ME_QUERY_NAME_DEVICE_DRIVER _IOR (MEMAIN_MAGIC, 21, me_query_name_device_driver_t)
495 #define ME_QUERY_NUMBER_DEVICES _IOR (MEMAIN_MAGIC, 22, me_query_number_devices_t)
496 #define ME_QUERY_NUMBER_SUBDEVICES _IOR (MEMAIN_MAGIC, 23, me_query_number_subdevices_t)
497 #define ME_QUERY_NUMBER_CHANNELS _IOR (MEMAIN_MAGIC, 24, me_query_number_channels_t)
498 #define ME_QUERY_NUMBER_RANGES _IOR (MEMAIN_MAGIC, 25, me_query_number_ranges_t)
500 #define ME_QUERY_RANGE_BY_MIN_MAX _IOR (MEMAIN_MAGIC, 26, me_query_range_by_min_max_t)
501 #define ME_QUERY_RANGE_INFO _IOR (MEMAIN_MAGIC, 27, me_query_range_info_t)
503 #define ME_QUERY_SUBDEVICE_BY_TYPE _IOR (MEMAIN_MAGIC, 28, me_query_subdevice_by_type_t)
504 #define ME_QUERY_SUBDEVICE_TYPE _IOR (MEMAIN_MAGIC, 29, me_query_subdevice_type_t)
505 #define ME_QUERY_SUBDEVICE_CAPS _IOR (MEMAIN_MAGIC, 29, me_query_subdevice_caps_t)
506 #define ME_QUERY_SUBDEVICE_CAPS_ARGS _IOR (MEMAIN_MAGIC, 30, me_query_subdevice_caps_args_t)
508 #define ME_QUERY_TIMER _IOR (MEMAIN_MAGIC, 31, me_query_timer_t)
510 #define ME_QUERY_VERSION_DEVICE_DRIVER _IOR (MEMAIN_MAGIC, 32, me_query_version_device_driver_t)
511 #define ME_QUERY_VERSION_MAIN_DRIVER _IOR (MEMAIN_MAGIC, 33, me_query_version_main_driver_t)
513 #define ME_CONFIG_LOAD _IOWR(MEMAIN_MAGIC, 34, me_config_load_t)