27 #include <linux/kernel.h>
28 #include <linux/module.h>
29 #include <linux/kdev_t.h>
30 #include <linux/slab.h>
32 #include <linux/errno.h>
35 #include <linux/wait.h>
43 #include <linux/pci.h>
47 #define DPRINTK(format, args...) do { \
49 pr_debug("comedi: " format, ## args); \
52 #define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
53 #define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, \
54 COMEDI_MINORVERSION, COMEDI_MICROVERSION)
55 #define COMEDI_RELEASE VERSION
57 #define PCI_VENDOR_ID_ADLINK 0x144a
58 #define PCI_VENDOR_ID_ICP 0x104c
59 #define PCI_VENDOR_ID_CONTEC 0x1221
61 #define COMEDI_NUM_MINORS 0x100
62 #define COMEDI_NUM_BOARD_MINORS 0x30
63 #define COMEDI_FIRST_SUBDEVICE_MINOR COMEDI_NUM_BOARD_MINORS
120 unsigned int start_chan_index);
250 #ifdef CONFIG_COMEDI_DEBUG
251 extern int comedi_debug;
253 static const int comedi_debug;
270 static const unsigned COMEDI_SUBDEVICE_MINOR_SHIFT = 4;
271 static const unsigned COMEDI_SUBDEVICE_MINOR_OFFSET = 1;
282 return info->
device->read_subdev;
292 return info->
device->write_subdev;
311 #define module_comedi_driver(__comedi_driver) \
312 module_driver(__comedi_driver, comedi_driver_register, \
313 comedi_driver_unregister)
331 #define module_comedi_pci_driver(__comedi_driver, __pci_driver) \
332 module_driver(__comedi_driver, comedi_pci_driver_register, \
333 comedi_pci_driver_unregister, &(__pci_driver))
350 #define module_comedi_usb_driver(__comedi_driver, __usb_driver) \
351 module_driver(__comedi_driver, comedi_usb_driver_register, \
352 comedi_usb_driver_unregister, &(__usb_driver))
359 #ifdef CONFIG_PROC_FS
360 void comedi_proc_init(
void);
361 void comedi_proc_cleanup(
void);
363 static inline void comedi_proc_init(
void)
367 static inline void comedi_proc_cleanup(
void)
384 unsigned int *chanlist);
389 #define RANGE(a, b) {(a)*1e6, (b)*1e6, 0}
390 #define RANGE_ext(a, b) {(a)*1e6, (b)*1e6, RF_EXTERNAL}
391 #define RANGE_mA(a, b) {(a)*1e6, (b)*1e6, UNIT_mA}
392 #define RANGE_unitless(a, b) {(a)*1e6, (b)*1e6, 0}
393 #define BIP_RANGE(a) {-(a)*1e6, (a)*1e6, 0}
394 #define UNI_RANGE(a) {0, (a)*1e6, 0}
403 #define range_digital range_unipolar5
406 #define GCC_ZERO_LENGTH_ARRAY
408 #define GCC_ZERO_LENGTH_ARRAY 0
429 return sizeof(
unsigned int);
431 return sizeof(
short);
436 static inline void comedi_set_hw_dev(
struct comedi_device *dev,
469 void *destination,
unsigned int num_bytes);
480 static inline void *comedi_aux_data(
int options[],
int n)
483 unsigned long addressLow;
485 if (
sizeof(
int) >=
sizeof(
void *))
489 bit_shift =
sizeof(
int) * 8;
490 address <<= bit_shift;
492 addressLow &= (1
UL << bit_shift) - 1;
493 address |= addressLow;