1 /* Device driver for Meilhaus ME-DUMMY devices.
2 * ===========================================
4 * Copyright (C) 2005 Meilhaus Electronic GmbH (support@meilhaus.de)
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * User application could also include the kernel header files. But the
23 * real kernel functions are protected by #ifdef __KERNEL__.
30 * This must be defined before module.h is included. Not needed, when
31 * it is a built in driver.
37 #include <linux/module.h>
38 #include <linux/slab.h>
41 #include "meinternal.h"
50 static int medummy_io_irq_start(me_device_t
*device
,
55 int irq_edge
, int irq_arg
, int flags
)
57 PDEBUG("executed.\n");
58 return ME_ERRNO_DEVICE_UNPLUGGED
;
61 static int medummy_io_irq_wait(me_device_t
*device
,
66 int *value
, int timeout
, int flags
)
68 PDEBUG("executed.\n");
69 return ME_ERRNO_DEVICE_UNPLUGGED
;
72 static int medummy_io_irq_stop(me_device_t
*device
,
74 int subdevice
, int channel
, int flags
)
76 PDEBUG("executed.\n");
77 return ME_ERRNO_DEVICE_UNPLUGGED
;
80 static int medummy_io_reset_device(me_device_t
*device
,
81 struct file
*filep
, int flags
)
83 PDEBUG("executed.\n");
84 return ME_ERRNO_DEVICE_UNPLUGGED
;
87 static int medummy_io_reset_subdevice(me_device_t
*device
,
89 int subdevice
, int flags
)
91 PDEBUG("executed.\n");
92 return ME_ERRNO_DEVICE_UNPLUGGED
;
95 static int medummy_io_single_config(me_device_t
*device
,
102 int trig_type
, int trig_edge
, int flags
)
104 PDEBUG("executed.\n");
105 return ME_ERRNO_DEVICE_UNPLUGGED
;
108 static int medummy_io_single_read(me_device_t
*device
,
112 int *value
, int time_out
, int flags
)
114 PDEBUG("executed.\n");
115 return ME_ERRNO_DEVICE_UNPLUGGED
;
118 static int medummy_io_single_write(me_device_t
*device
,
122 int value
, int time_out
, int flags
)
124 PDEBUG("executed.\n");
125 return ME_ERRNO_DEVICE_UNPLUGGED
;
128 static int medummy_io_stream_config(me_device_t
*device
,
131 meIOStreamConfig_t
*config_list
,
133 meIOStreamTrigger_t
*trigger
,
134 int fifo_irq_threshold
, int flags
)
136 PDEBUG("executed.\n");
137 return ME_ERRNO_DEVICE_UNPLUGGED
;
140 static int medummy_io_stream_new_values(me_device_t
*device
,
143 int timeout
, int *count
, int flags
)
145 PDEBUG("executed.\n");
146 return ME_ERRNO_DEVICE_UNPLUGGED
;
149 static int medummy_io_stream_read(me_device_t
*device
,
153 int *values
, int *count
, int flags
)
155 PDEBUG("executed.\n");
156 return ME_ERRNO_DEVICE_UNPLUGGED
;
159 static int medummy_io_stream_start(me_device_t
*device
,
162 int start_mode
, int time_out
, int flags
)
164 PDEBUG("executed.\n");
165 return ME_ERRNO_DEVICE_UNPLUGGED
;
168 static int medummy_io_stream_status(me_device_t
*device
,
172 int *status
, int *values
, int flags
)
174 PDEBUG("executed.\n");
175 return ME_ERRNO_DEVICE_UNPLUGGED
;
178 static int medummy_io_stream_stop(me_device_t
*device
,
180 int subdevice
, int stop_mode
, int flags
)
182 PDEBUG("executed.\n");
183 return ME_ERRNO_DEVICE_UNPLUGGED
;
186 static int medummy_io_stream_write(me_device_t
*device
,
190 int *values
, int *count
, int flags
)
192 PDEBUG("executed.\n");
193 return ME_ERRNO_DEVICE_UNPLUGGED
;
196 static int medummy_lock_device(me_device_t
*device
,
197 struct file
*filep
, int lock
, int flags
)
199 PDEBUG("executed.\n");
200 return ME_ERRNO_DEVICE_UNPLUGGED
;
203 static int medummy_lock_subdevice(me_device_t
*device
,
205 int subdevice
, int lock
, int flags
)
207 PDEBUG("executed.\n");
208 return ME_ERRNO_DEVICE_UNPLUGGED
;
211 static int medummy_query_description_device(me_device_t
*device
,
214 medummy_device_t
*instance
= (medummy_device_t
*) device
;
216 PDEBUG("executed.\n");
218 // if (instance->magic != MEDUMMY_MAGIC_NUMBER)
220 // PERROR("Wrong magic number.\n");
221 // return ME_ERRNO_INTERNAL;
224 switch (instance
->device_id
) {
226 case PCI_DEVICE_ID_MEILHAUS_ME1000
:
228 case PCI_DEVICE_ID_MEILHAUS_ME1000_A
:
230 case PCI_DEVICE_ID_MEILHAUS_ME1000_B
:
231 *description
= ME1000_DESCRIPTION_DEVICE_ME1000
;
235 case PCI_DEVICE_ID_MEILHAUS_ME1400
:
236 *description
= ME1400_DESCRIPTION_DEVICE_ME1400
;
240 case PCI_DEVICE_ID_MEILHAUS_ME140A
:
241 *description
= ME1400_DESCRIPTION_DEVICE_ME1400A
;
245 case PCI_DEVICE_ID_MEILHAUS_ME140B
:
246 *description
= ME1400_DESCRIPTION_DEVICE_ME1400B
;
250 case PCI_DEVICE_ID_MEILHAUS_ME14E0
:
251 *description
= ME1400_DESCRIPTION_DEVICE_ME1400E
;
255 case PCI_DEVICE_ID_MEILHAUS_ME14EA
:
256 *description
= ME1400_DESCRIPTION_DEVICE_ME1400EA
;
260 case PCI_DEVICE_ID_MEILHAUS_ME14EB
:
261 *description
= ME1400_DESCRIPTION_DEVICE_ME1400EB
;
265 case PCI_DEVICE_ID_MEILHAUS_ME140C
:
266 *description
= ME1400_DESCRIPTION_DEVICE_ME1400C
;
270 case PCI_DEVICE_ID_MEILHAUS_ME140D
:
271 *description
= ME1400_DESCRIPTION_DEVICE_ME1400D
;
275 case PCI_DEVICE_ID_MEILHAUS_ME1600_4U
:
276 *description
= ME1600_DESCRIPTION_DEVICE_ME16004U
;
280 case PCI_DEVICE_ID_MEILHAUS_ME1600_8U
:
281 *description
= ME1600_DESCRIPTION_DEVICE_ME16008U
;
285 case PCI_DEVICE_ID_MEILHAUS_ME1600_12U
:
286 *description
= ME1600_DESCRIPTION_DEVICE_ME160012U
;
290 case PCI_DEVICE_ID_MEILHAUS_ME1600_16U
:
291 *description
= ME1600_DESCRIPTION_DEVICE_ME160016U
;
295 case PCI_DEVICE_ID_MEILHAUS_ME1600_16U_8I
:
296 *description
= ME1600_DESCRIPTION_DEVICE_ME160016U8I
;
300 case PCI_DEVICE_ID_MEILHAUS_ME4610
:
301 *description
= ME4600_DESCRIPTION_DEVICE_ME4610
;
305 case PCI_DEVICE_ID_MEILHAUS_ME4650
:
306 *description
= ME4600_DESCRIPTION_DEVICE_ME4650
;
310 case PCI_DEVICE_ID_MEILHAUS_ME4660
:
311 *description
= ME4600_DESCRIPTION_DEVICE_ME4660
;
315 case PCI_DEVICE_ID_MEILHAUS_ME4660I
:
316 *description
= ME4600_DESCRIPTION_DEVICE_ME4660I
;
320 case PCI_DEVICE_ID_MEILHAUS_ME4660S
:
321 *description
= ME4600_DESCRIPTION_DEVICE_ME4660S
;
325 case PCI_DEVICE_ID_MEILHAUS_ME4660IS
:
326 *description
= ME4600_DESCRIPTION_DEVICE_ME4660IS
;
330 case PCI_DEVICE_ID_MEILHAUS_ME4670
:
331 *description
= ME4600_DESCRIPTION_DEVICE_ME4670
;
335 case PCI_DEVICE_ID_MEILHAUS_ME4670I
:
336 *description
= ME4600_DESCRIPTION_DEVICE_ME4670I
;
340 case PCI_DEVICE_ID_MEILHAUS_ME4670S
:
341 *description
= ME4600_DESCRIPTION_DEVICE_ME4670S
;
345 case PCI_DEVICE_ID_MEILHAUS_ME4670IS
:
346 *description
= ME4600_DESCRIPTION_DEVICE_ME4670IS
;
350 case PCI_DEVICE_ID_MEILHAUS_ME4680
:
351 *description
= ME4600_DESCRIPTION_DEVICE_ME4680
;
355 case PCI_DEVICE_ID_MEILHAUS_ME4680I
:
356 *description
= ME4600_DESCRIPTION_DEVICE_ME4680I
;
360 case PCI_DEVICE_ID_MEILHAUS_ME4680S
:
361 *description
= ME4600_DESCRIPTION_DEVICE_ME4680S
;
365 case PCI_DEVICE_ID_MEILHAUS_ME4680IS
:
366 *description
= ME4600_DESCRIPTION_DEVICE_ME4680IS
;
370 case PCI_DEVICE_ID_MEILHAUS_ME6004
:
371 *description
= ME6000_DESCRIPTION_DEVICE_ME60004
;
375 case PCI_DEVICE_ID_MEILHAUS_ME6008
:
376 *description
= ME6000_DESCRIPTION_DEVICE_ME60008
;
380 case PCI_DEVICE_ID_MEILHAUS_ME600F
:
381 *description
= ME6000_DESCRIPTION_DEVICE_ME600016
;
385 case PCI_DEVICE_ID_MEILHAUS_ME6014
:
386 *description
= ME6000_DESCRIPTION_DEVICE_ME6000I4
;
390 case PCI_DEVICE_ID_MEILHAUS_ME6018
:
391 *description
= ME6000_DESCRIPTION_DEVICE_ME6000I8
;
395 case PCI_DEVICE_ID_MEILHAUS_ME601F
:
396 *description
= ME6000_DESCRIPTION_DEVICE_ME6000I16
;
400 case PCI_DEVICE_ID_MEILHAUS_ME6034
:
401 *description
= ME6000_DESCRIPTION_DEVICE_ME6000ISLE4
;
405 case PCI_DEVICE_ID_MEILHAUS_ME6038
:
406 *description
= ME6000_DESCRIPTION_DEVICE_ME6000ISLE8
;
410 case PCI_DEVICE_ID_MEILHAUS_ME603F
:
411 *description
= ME6000_DESCRIPTION_DEVICE_ME6000ISLE16
;
415 case PCI_DEVICE_ID_MEILHAUS_ME6104
:
416 *description
= ME6000_DESCRIPTION_DEVICE_ME61004
;
420 case PCI_DEVICE_ID_MEILHAUS_ME6108
:
421 *description
= ME6000_DESCRIPTION_DEVICE_ME61008
;
425 case PCI_DEVICE_ID_MEILHAUS_ME610F
:
426 *description
= ME6000_DESCRIPTION_DEVICE_ME610016
;
430 case PCI_DEVICE_ID_MEILHAUS_ME6114
:
431 *description
= ME6000_DESCRIPTION_DEVICE_ME6100I4
;
435 case PCI_DEVICE_ID_MEILHAUS_ME6118
:
436 *description
= ME6000_DESCRIPTION_DEVICE_ME6100I8
;
440 case PCI_DEVICE_ID_MEILHAUS_ME611F
:
441 *description
= ME6000_DESCRIPTION_DEVICE_ME6100I16
;
445 case PCI_DEVICE_ID_MEILHAUS_ME6134
:
446 *description
= ME6000_DESCRIPTION_DEVICE_ME6100ISLE4
;
450 case PCI_DEVICE_ID_MEILHAUS_ME6138
:
451 *description
= ME6000_DESCRIPTION_DEVICE_ME6100ISLE8
;
455 case PCI_DEVICE_ID_MEILHAUS_ME613F
:
456 *description
= ME6000_DESCRIPTION_DEVICE_ME6100ISLE16
;
460 case PCI_DEVICE_ID_MEILHAUS_ME6044
:
461 *description
= ME6000_DESCRIPTION_DEVICE_ME60004DIO
;
465 case PCI_DEVICE_ID_MEILHAUS_ME6048
:
466 *description
= ME6000_DESCRIPTION_DEVICE_ME60008DIO
;
470 case PCI_DEVICE_ID_MEILHAUS_ME604F
:
471 *description
= ME6000_DESCRIPTION_DEVICE_ME600016DIO
;
475 case PCI_DEVICE_ID_MEILHAUS_ME6054
:
476 *description
= ME6000_DESCRIPTION_DEVICE_ME6000I4DIO
;
480 case PCI_DEVICE_ID_MEILHAUS_ME6058
:
481 *description
= ME6000_DESCRIPTION_DEVICE_ME6000I8DIO
;
485 case PCI_DEVICE_ID_MEILHAUS_ME605F
:
486 *description
= ME6000_DESCRIPTION_DEVICE_ME6000I16DIO
;
490 case PCI_DEVICE_ID_MEILHAUS_ME6074
:
491 *description
= ME6000_DESCRIPTION_DEVICE_ME6000ISLE4DIO
;
495 case PCI_DEVICE_ID_MEILHAUS_ME6078
:
496 *description
= ME6000_DESCRIPTION_DEVICE_ME6000ISLE8DIO
;
500 case PCI_DEVICE_ID_MEILHAUS_ME607F
:
501 *description
= ME6000_DESCRIPTION_DEVICE_ME6000ISLE16DIO
;
505 case PCI_DEVICE_ID_MEILHAUS_ME6144
:
506 *description
= ME6000_DESCRIPTION_DEVICE_ME61004DIO
;
510 case PCI_DEVICE_ID_MEILHAUS_ME6148
:
511 *description
= ME6000_DESCRIPTION_DEVICE_ME61008DIO
;
515 case PCI_DEVICE_ID_MEILHAUS_ME614F
:
516 *description
= ME6000_DESCRIPTION_DEVICE_ME610016DIO
;
520 case PCI_DEVICE_ID_MEILHAUS_ME6154
:
521 *description
= ME6000_DESCRIPTION_DEVICE_ME6100I4DIO
;
525 case PCI_DEVICE_ID_MEILHAUS_ME6158
:
526 *description
= ME6000_DESCRIPTION_DEVICE_ME6100I8DIO
;
530 case PCI_DEVICE_ID_MEILHAUS_ME615F
:
531 *description
= ME6000_DESCRIPTION_DEVICE_ME6100I16DIO
;
535 case PCI_DEVICE_ID_MEILHAUS_ME6174
:
536 *description
= ME6000_DESCRIPTION_DEVICE_ME6100ISLE4DIO
;
540 case PCI_DEVICE_ID_MEILHAUS_ME6178
:
541 *description
= ME6000_DESCRIPTION_DEVICE_ME6100ISLE8DIO
;
545 case PCI_DEVICE_ID_MEILHAUS_ME617F
:
546 *description
= ME6000_DESCRIPTION_DEVICE_ME6100ISLE16DIO
;
550 case PCI_DEVICE_ID_MEILHAUS_ME6259
:
551 *description
= ME6000_DESCRIPTION_DEVICE_ME6200I9DIO
;
555 case PCI_DEVICE_ID_MEILHAUS_ME6359
:
556 *description
= ME6000_DESCRIPTION_DEVICE_ME6300I9DIO
;
560 case PCI_DEVICE_ID_MEILHAUS_ME0630
:
561 *description
= ME0600_DESCRIPTION_DEVICE_ME0630
;
565 case PCI_DEVICE_ID_MEILHAUS_ME8100_A
:
566 *description
= ME8100_DESCRIPTION_DEVICE_ME8100A
;
570 case PCI_DEVICE_ID_MEILHAUS_ME8100_B
:
571 *description
= ME8100_DESCRIPTION_DEVICE_ME8100B
;
575 case PCI_DEVICE_ID_MEILHAUS_ME0940
:
576 *description
= ME0900_DESCRIPTION_DEVICE_ME0940
;
580 case PCI_DEVICE_ID_MEILHAUS_ME0950
:
581 *description
= ME0900_DESCRIPTION_DEVICE_ME0950
;
585 case PCI_DEVICE_ID_MEILHAUS_ME0960
:
586 *description
= ME0900_DESCRIPTION_DEVICE_ME0960
;
590 case USB_DEVICE_ID_MEPHISTO_S1:
591 *description = MEPHISTO_S1_DESCRIPTION_DEVICE;
596 *description
= EMPTY_DESCRIPTION_DEVICE
;
597 PERROR("Invalid device id in device info.\n");
599 return ME_ERRNO_INTERNAL
;
602 return ME_ERRNO_DEVICE_UNPLUGGED
;
605 static int medummy_query_info_device(me_device_t
*device
,
611 int *dev_no
, int *func_no
, int *plugged
)
613 medummy_device_t
*instance
= (medummy_device_t
*) device
;
615 PDEBUG("executed.\n");
617 // if (instance->magic != MEDUMMY_MAGIC_NUMBER)
619 // PERROR("Wrong magic number.\n");
620 // return ME_ERRNO_INTERNAL;
623 *vendor_id
= instance
->vendor_id
;
624 *device_id
= instance
->device_id
;
625 *serial_no
= instance
->serial_no
;
626 *bus_type
= instance
->bus_type
;
627 *bus_no
= instance
->bus_no
;
628 *dev_no
= instance
->dev_no
;
629 *func_no
= instance
->func_no
;
630 *plugged
= ME_PLUGGED_OUT
;
632 return ME_ERRNO_SUCCESS
;
635 static int medummy_query_name_device_driver(me_device_t
*device
, char **name
)
637 PDEBUG("executed.\n");
638 *name
= MEDUMMY_NAME_DRIVER
;
639 return ME_ERRNO_SUCCESS
;
642 static int medummy_query_name_device(me_device_t
*device
, char **name
)
644 medummy_device_t
*instance
= (medummy_device_t
*) device
;
646 PDEBUG("executed.\n");
648 // // // if (instance->magic != MEDUMMY_MAGIC_NUMBER)
650 // // // PERROR("Wrong magic number.\n");
651 // // // return ME_ERRNO_INTERNAL;
654 switch (instance
->device_id
) {
656 case PCI_DEVICE_ID_MEILHAUS_ME1000
:
658 case PCI_DEVICE_ID_MEILHAUS_ME1000_A
:
660 case PCI_DEVICE_ID_MEILHAUS_ME1000_B
:
661 *name
= ME1000_NAME_DEVICE_ME1000
;
665 case PCI_DEVICE_ID_MEILHAUS_ME1400
:
666 *name
= ME1400_NAME_DEVICE_ME1400
;
670 case PCI_DEVICE_ID_MEILHAUS_ME140A
:
671 *name
= ME1400_NAME_DEVICE_ME1400A
;
675 case PCI_DEVICE_ID_MEILHAUS_ME140B
:
676 *name
= ME1400_NAME_DEVICE_ME1400B
;
680 case PCI_DEVICE_ID_MEILHAUS_ME14E0
:
681 *name
= ME1400_NAME_DEVICE_ME1400E
;
685 case PCI_DEVICE_ID_MEILHAUS_ME14EA
:
686 *name
= ME1400_NAME_DEVICE_ME1400EA
;
690 case PCI_DEVICE_ID_MEILHAUS_ME14EB
:
691 *name
= ME1400_NAME_DEVICE_ME1400EB
;
695 case PCI_DEVICE_ID_MEILHAUS_ME140C
:
696 *name
= ME1400_NAME_DEVICE_ME1400C
;
700 case PCI_DEVICE_ID_MEILHAUS_ME140D
:
701 *name
= ME1400_NAME_DEVICE_ME1400D
;
705 case PCI_DEVICE_ID_MEILHAUS_ME1600_4U
:
706 *name
= ME1600_NAME_DEVICE_ME16004U
;
710 case PCI_DEVICE_ID_MEILHAUS_ME1600_8U
:
711 *name
= ME1600_NAME_DEVICE_ME16008U
;
715 case PCI_DEVICE_ID_MEILHAUS_ME1600_12U
:
716 *name
= ME1600_NAME_DEVICE_ME160012U
;
720 case PCI_DEVICE_ID_MEILHAUS_ME1600_16U
:
721 *name
= ME1600_NAME_DEVICE_ME160016U
;
725 case PCI_DEVICE_ID_MEILHAUS_ME1600_16U_8I
:
726 *name
= ME1600_NAME_DEVICE_ME160016U8I
;
730 case PCI_DEVICE_ID_MEILHAUS_ME4610
:
731 *name
= ME4600_NAME_DEVICE_ME4610
;
735 case PCI_DEVICE_ID_MEILHAUS_ME4650
:
736 *name
= ME4600_NAME_DEVICE_ME4650
;
740 case PCI_DEVICE_ID_MEILHAUS_ME4660
:
741 *name
= ME4600_NAME_DEVICE_ME4660
;
745 case PCI_DEVICE_ID_MEILHAUS_ME4660I
:
746 *name
= ME4600_NAME_DEVICE_ME4660I
;
750 case PCI_DEVICE_ID_MEILHAUS_ME4670
:
751 *name
= ME4600_NAME_DEVICE_ME4670
;
755 case PCI_DEVICE_ID_MEILHAUS_ME4670I
:
756 *name
= ME4600_NAME_DEVICE_ME4670I
;
760 case PCI_DEVICE_ID_MEILHAUS_ME4670S
:
761 *name
= ME4600_NAME_DEVICE_ME4670S
;
765 case PCI_DEVICE_ID_MEILHAUS_ME4670IS
:
766 *name
= ME4600_NAME_DEVICE_ME4670IS
;
770 case PCI_DEVICE_ID_MEILHAUS_ME4680
:
771 *name
= ME4600_NAME_DEVICE_ME4680
;
775 case PCI_DEVICE_ID_MEILHAUS_ME4680I
:
776 *name
= ME4600_NAME_DEVICE_ME4680I
;
780 case PCI_DEVICE_ID_MEILHAUS_ME4680S
:
781 *name
= ME4600_NAME_DEVICE_ME4680S
;
785 case PCI_DEVICE_ID_MEILHAUS_ME4680IS
:
786 *name
= ME4600_NAME_DEVICE_ME4680IS
;
790 case PCI_DEVICE_ID_MEILHAUS_ME6004
:
791 *name
= ME6000_NAME_DEVICE_ME60004
;
795 case PCI_DEVICE_ID_MEILHAUS_ME6008
:
796 *name
= ME6000_NAME_DEVICE_ME60008
;
800 case PCI_DEVICE_ID_MEILHAUS_ME600F
:
801 *name
= ME6000_NAME_DEVICE_ME600016
;
805 case PCI_DEVICE_ID_MEILHAUS_ME6014
:
806 *name
= ME6000_NAME_DEVICE_ME6000I4
;
810 case PCI_DEVICE_ID_MEILHAUS_ME6018
:
811 *name
= ME6000_NAME_DEVICE_ME6000I8
;
815 case PCI_DEVICE_ID_MEILHAUS_ME601F
:
816 *name
= ME6000_NAME_DEVICE_ME6000I16
;
820 case PCI_DEVICE_ID_MEILHAUS_ME6034
:
821 *name
= ME6000_NAME_DEVICE_ME6000ISLE4
;
825 case PCI_DEVICE_ID_MEILHAUS_ME6038
:
826 *name
= ME6000_NAME_DEVICE_ME6000ISLE8
;
830 case PCI_DEVICE_ID_MEILHAUS_ME603F
:
831 *name
= ME6000_NAME_DEVICE_ME6000ISLE16
;
835 case PCI_DEVICE_ID_MEILHAUS_ME6104
:
836 *name
= ME6000_NAME_DEVICE_ME61004
;
840 case PCI_DEVICE_ID_MEILHAUS_ME6108
:
841 *name
= ME6000_NAME_DEVICE_ME61008
;
845 case PCI_DEVICE_ID_MEILHAUS_ME610F
:
846 *name
= ME6000_NAME_DEVICE_ME610016
;
850 case PCI_DEVICE_ID_MEILHAUS_ME6114
:
851 *name
= ME6000_NAME_DEVICE_ME6100I4
;
855 case PCI_DEVICE_ID_MEILHAUS_ME6118
:
856 *name
= ME6000_NAME_DEVICE_ME6100I8
;
860 case PCI_DEVICE_ID_MEILHAUS_ME611F
:
861 *name
= ME6000_NAME_DEVICE_ME6100I16
;
865 case PCI_DEVICE_ID_MEILHAUS_ME6134
:
866 *name
= ME6000_NAME_DEVICE_ME6100ISLE4
;
870 case PCI_DEVICE_ID_MEILHAUS_ME6138
:
871 *name
= ME6000_NAME_DEVICE_ME6100ISLE8
;
875 case PCI_DEVICE_ID_MEILHAUS_ME613F
:
876 *name
= ME6000_NAME_DEVICE_ME6100ISLE16
;
880 case PCI_DEVICE_ID_MEILHAUS_ME6044
:
881 *name
= ME6000_NAME_DEVICE_ME60004DIO
;
885 case PCI_DEVICE_ID_MEILHAUS_ME6048
:
886 *name
= ME6000_NAME_DEVICE_ME60008DIO
;
890 case PCI_DEVICE_ID_MEILHAUS_ME604F
:
891 *name
= ME6000_NAME_DEVICE_ME600016DIO
;
895 case PCI_DEVICE_ID_MEILHAUS_ME6054
:
896 *name
= ME6000_NAME_DEVICE_ME6000I4DIO
;
900 case PCI_DEVICE_ID_MEILHAUS_ME6058
:
901 *name
= ME6000_NAME_DEVICE_ME6000I8DIO
;
905 case PCI_DEVICE_ID_MEILHAUS_ME605F
:
906 *name
= ME6000_NAME_DEVICE_ME6000I16DIO
;
910 case PCI_DEVICE_ID_MEILHAUS_ME6074
:
911 *name
= ME6000_NAME_DEVICE_ME6000ISLE4DIO
;
915 case PCI_DEVICE_ID_MEILHAUS_ME6078
:
916 *name
= ME6000_NAME_DEVICE_ME6000ISLE8DIO
;
920 case PCI_DEVICE_ID_MEILHAUS_ME607F
:
921 *name
= ME6000_NAME_DEVICE_ME6000ISLE16DIO
;
925 case PCI_DEVICE_ID_MEILHAUS_ME6144
:
926 *name
= ME6000_NAME_DEVICE_ME61004DIO
;
930 case PCI_DEVICE_ID_MEILHAUS_ME6148
:
931 *name
= ME6000_NAME_DEVICE_ME61008DIO
;
935 case PCI_DEVICE_ID_MEILHAUS_ME614F
:
936 *name
= ME6000_NAME_DEVICE_ME610016DIO
;
940 case PCI_DEVICE_ID_MEILHAUS_ME6154
:
941 *name
= ME6000_NAME_DEVICE_ME6100I4DIO
;
945 case PCI_DEVICE_ID_MEILHAUS_ME6158
:
946 *name
= ME6000_NAME_DEVICE_ME6100I8DIO
;
950 case PCI_DEVICE_ID_MEILHAUS_ME615F
:
951 *name
= ME6000_NAME_DEVICE_ME6100I16DIO
;
955 case PCI_DEVICE_ID_MEILHAUS_ME6174
:
956 *name
= ME6000_NAME_DEVICE_ME6100ISLE4DIO
;
960 case PCI_DEVICE_ID_MEILHAUS_ME6178
:
961 *name
= ME6000_NAME_DEVICE_ME6100ISLE8DIO
;
965 case PCI_DEVICE_ID_MEILHAUS_ME617F
:
966 *name
= ME6000_NAME_DEVICE_ME6100ISLE16DIO
;
970 case PCI_DEVICE_ID_MEILHAUS_ME0630
:
971 *name
= ME0600_NAME_DEVICE_ME0630
;
975 case PCI_DEVICE_ID_MEILHAUS_ME8100_A
:
976 *name
= ME8100_NAME_DEVICE_ME8100A
;
980 case PCI_DEVICE_ID_MEILHAUS_ME8100_B
:
981 *name
= ME8100_NAME_DEVICE_ME8100B
;
985 case PCI_DEVICE_ID_MEILHAUS_ME0940
:
986 *name
= ME0900_NAME_DEVICE_ME0940
;
990 case PCI_DEVICE_ID_MEILHAUS_ME0950
:
991 *name
= ME0900_NAME_DEVICE_ME0950
;
995 case PCI_DEVICE_ID_MEILHAUS_ME0960
:
996 *name
= ME0900_NAME_DEVICE_ME0960
;
1000 case USB_DEVICE_ID_MEPHISTO_S1:
1001 *name = MEPHISTO_S1_NAME_DEVICE;
1006 *name
= EMPTY_NAME_DEVICE
;
1007 PERROR("Invalid PCI device id.\n");
1009 return ME_ERRNO_INTERNAL
;
1012 return ME_ERRNO_SUCCESS
;
1015 static int medummy_query_number_subdevices(me_device_t
*device
, int *number
)
1017 PDEBUG("executed.\n");
1018 return ME_ERRNO_DEVICE_UNPLUGGED
;
1021 static int medummy_query_number_channels(me_device_t
*device
,
1022 int subdevice
, int *number
)
1024 PDEBUG("executed.\n");
1025 return ME_ERRNO_DEVICE_UNPLUGGED
;
1028 static int medummy_query_number_ranges(me_device_t
*device
,
1029 int subdevice
, int unit
, int *count
)
1031 PDEBUG("executed.\n");
1032 return ME_ERRNO_DEVICE_UNPLUGGED
;
1035 static int medummy_query_subdevice_type(me_device_t
*device
,
1036 int subdevice
, int *type
, int *subtype
)
1038 PDEBUG("executed.\n");
1039 return ME_ERRNO_DEVICE_UNPLUGGED
;
1042 static int medummy_query_subdevice_caps(me_device_t
*device
,
1043 int subdevice
, int *caps
)
1045 PDEBUG("executed.\n");
1046 return ME_ERRNO_DEVICE_UNPLUGGED
;
1049 static int medummy_query_subdevice_caps_args(me_device_t
*device
,
1051 int cap
, int *args
, int count
)
1053 PDEBUG("executed.\n");
1054 return ME_ERRNO_NOT_SUPPORTED
;
1057 static int medummy_query_subdevice_by_type(me_device_t
*device
,
1058 int start_subdevice
,
1060 int subtype
, int *subdevice
)
1062 PDEBUG("executed.\n");
1063 return ME_ERRNO_DEVICE_UNPLUGGED
;
1066 static int medummy_query_range_by_min_max(me_device_t
*device
,
1070 int *max
, int *maxdata
, int *range
)
1072 PDEBUG("executed.\n");
1073 return ME_ERRNO_DEVICE_UNPLUGGED
;
1076 static int medummy_query_range_info(me_device_t
*device
,
1079 int *unit
, int *min
, int *max
, int *maxdata
)
1081 PDEBUG("executed.\n");
1082 return ME_ERRNO_DEVICE_UNPLUGGED
;
1085 int medummy_query_timer(me_device_t
*device
,
1088 int *base_frequency
,
1089 uint64_t *min_ticks
, uint64_t *max_ticks
)
1091 PDEBUG("executed.\n");
1092 return ME_ERRNO_DEVICE_UNPLUGGED
;
1095 static int medummy_query_version_device_driver(me_device_t
*device
,
1098 PDEBUG("executed.\n");
1100 *version
= ME_VERSION_DRIVER
;
1101 return ME_ERRNO_SUCCESS
;
1104 static void medummy_destructor(me_device_t
*device
)
1106 PDEBUG("executed.\n");
1110 static int init_device_info(unsigned short vendor_id
,
1111 unsigned short device_id
,
1112 unsigned int serial_no
,
1116 int func_no
, medummy_device_t
*instance
)
1118 PDEBUG("executed.\n");
1120 // instance->magic = MEDUMMY_MAGIC_NUMBER;
1121 instance
->vendor_id
= vendor_id
;
1122 instance
->device_id
= device_id
;
1123 instance
->serial_no
= serial_no
;
1124 instance
->bus_type
= bus_type
;
1125 instance
->bus_no
= bus_no
;
1126 instance
->dev_no
= dev_no
;
1127 instance
->func_no
= func_no
;
1132 static int medummy_config_load(me_device_t
*device
, struct file
*filep
,
1133 me_cfg_device_entry_t
*config
)
1135 PDEBUG("executed.\n");
1136 return ME_ERRNO_SUCCESS
;
1139 static int init_device_instance(me_device_t
*device
)
1141 PDEBUG("executed.\n");
1143 INIT_LIST_HEAD(&device
->list
);
1145 device
->me_device_io_irq_start
= medummy_io_irq_start
;
1146 device
->me_device_io_irq_wait
= medummy_io_irq_wait
;
1147 device
->me_device_io_irq_stop
= medummy_io_irq_stop
;
1148 device
->me_device_io_reset_device
= medummy_io_reset_device
;
1149 device
->me_device_io_reset_subdevice
= medummy_io_reset_subdevice
;
1150 device
->me_device_io_single_config
= medummy_io_single_config
;
1151 device
->me_device_io_single_read
= medummy_io_single_read
;
1152 device
->me_device_io_single_write
= medummy_io_single_write
;
1153 device
->me_device_io_stream_config
= medummy_io_stream_config
;
1154 device
->me_device_io_stream_new_values
= medummy_io_stream_new_values
;
1155 device
->me_device_io_stream_read
= medummy_io_stream_read
;
1156 device
->me_device_io_stream_start
= medummy_io_stream_start
;
1157 device
->me_device_io_stream_status
= medummy_io_stream_status
;
1158 device
->me_device_io_stream_stop
= medummy_io_stream_stop
;
1159 device
->me_device_io_stream_write
= medummy_io_stream_write
;
1161 device
->me_device_lock_device
= medummy_lock_device
;
1162 device
->me_device_lock_subdevice
= medummy_lock_subdevice
;
1164 device
->me_device_query_description_device
=
1165 medummy_query_description_device
;
1166 device
->me_device_query_info_device
= medummy_query_info_device
;
1167 device
->me_device_query_name_device_driver
=
1168 medummy_query_name_device_driver
;
1169 device
->me_device_query_name_device
= medummy_query_name_device
;
1171 device
->me_device_query_number_subdevices
=
1172 medummy_query_number_subdevices
;
1173 device
->me_device_query_number_channels
= medummy_query_number_channels
;
1174 device
->me_device_query_number_ranges
= medummy_query_number_ranges
;
1176 device
->me_device_query_range_by_min_max
=
1177 medummy_query_range_by_min_max
;
1178 device
->me_device_query_range_info
= medummy_query_range_info
;
1180 device
->me_device_query_subdevice_type
= medummy_query_subdevice_type
;
1181 device
->me_device_query_subdevice_by_type
=
1182 medummy_query_subdevice_by_type
;
1183 device
->me_device_query_subdevice_caps
= medummy_query_subdevice_caps
;
1184 device
->me_device_query_subdevice_caps_args
=
1185 medummy_query_subdevice_caps_args
;
1187 device
->me_device_query_timer
= medummy_query_timer
;
1189 device
->me_device_query_version_device_driver
=
1190 medummy_query_version_device_driver
;
1192 device
->me_device_destructor
= medummy_destructor
;
1193 device
->me_device_config_load
= medummy_config_load
;
1197 me_device_t
*medummy_constructor(unsigned short vendor_id
,
1198 unsigned short device_id
,
1199 unsigned int serial_no
,
1201 int bus_no
, int dev_no
, int func_no
)
1204 medummy_device_t
*instance
;
1206 PDEBUG("executed.\n");
1208 /* Allocate structure for device attributes */
1209 instance
= kmalloc(sizeof(medummy_device_t
), GFP_KERNEL
);
1212 PERROR("Can't get memory for device instance.\n");
1216 memset(instance
, 0, sizeof(medummy_device_t
));
1218 /* Initialize device info */
1219 result
= init_device_info(vendor_id
,
1222 bus_type
, bus_no
, dev_no
, func_no
, instance
);
1225 PERROR("Cannot init baord info.\n");
1230 /* Initialize device instance */
1231 result
= init_device_instance((me_device_t
*) instance
);
1234 PERROR("Cannot init baord info.\n");
1239 return (me_device_t
*) instance
;
1241 EXPORT_SYMBOL(medummy_constructor
);
1243 // Init and exit of module.
1245 static int __init
dummy_init(void)
1247 PDEBUG("executed.\n");
1251 static void __exit
dummy_exit(void)
1253 PDEBUG("executed.\n");
1256 module_init(dummy_init
);
1258 module_exit(dummy_exit
);
1260 // Administrative stuff for modinfo.
1261 MODULE_AUTHOR("Guenter Gebhardt <g.gebhardt@meilhaus.de>");
1262 MODULE_DESCRIPTION("Device Driver Module for Meilhaus ME-DUMMY Devices");
1263 MODULE_SUPPORTED_DEVICE("Meilhaus ME-DUMMY Devices");
1264 MODULE_LICENSE("GPL");