Staging: comedi: uses udelay, needs delay.h
[linux-block.git] / drivers / staging / comedi / comedidev.h
CommitLineData
ed9eccbe
DS
1/*
2 include/linux/comedidev.h
3 header file for kernel-only structures, variables, and constants
4
5 COMEDI - Linux Control and Measurement Device Interface
6 Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22*/
23
24#ifndef _COMEDIDEV_H
25#define _COMEDIDEV_H
26
27#include <linux/kernel.h>
28#include <linux/module.h>
ed9eccbe
DS
29#include <linux/kdev_t.h>
30#include <linux/slab.h>
f9c51375 31#include <linux/delay.h>
ed9eccbe
DS
32#include <linux/errno.h>
33#include <linux/spinlock.h>
34#include <linux/mutex.h>
35#include <linux/wait.h>
36#include <linux/mm.h>
37#include <linux/init.h>
38#include <linux/vmalloc.h>
ed9eccbe 39#include <linux/dma-mapping.h>
e0dcef71
GKH
40#include <linux/uaccess.h>
41#include <linux/io.h>
ed9eccbe
DS
42
43#include "comedi.h"
44
e0dcef71
GKH
45#define DPRINTK(format, args...) do { \
46 if (comedi_debug) \
47 printk(KERN_DEBUG "comedi: " format , ## args); \
48} while (0)
ed9eccbe 49
e0dcef71
GKH
50#define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
51#define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, COMEDI_MINORVERSION, COMEDI_MICROVERSION)
ed9eccbe
DS
52#define COMEDI_RELEASE VERSION
53
54#define COMEDI_INITCLEANUP_NOMODULE(x) \
55 static int __init x ## _init_module(void) \
51b713a6 56 {return comedi_driver_register(&(x)); } \
ed9eccbe 57 static void __exit x ## _cleanup_module(void) \
51b713a6 58 {comedi_driver_unregister(&(x)); } \
ed9eccbe
DS
59 module_init(x ## _init_module); \
60 module_exit(x ## _cleanup_module); \
61
62#define COMEDI_MODULE_MACROS \
63 MODULE_AUTHOR("Comedi http://www.comedi.org"); \
64 MODULE_DESCRIPTION("Comedi low-level driver"); \
65 MODULE_LICENSE("GPL"); \
66
67#define COMEDI_INITCLEANUP(x) \
68 COMEDI_MODULE_MACROS \
69 COMEDI_INITCLEANUP_NOMODULE(x)
70
71#define COMEDI_PCI_INITCLEANUP_NOMODULE(comedi_driver, pci_id_table) \
72 static int __devinit comedi_driver ## _pci_probe(struct pci_dev *dev, \
73 const struct pci_device_id *ent) \
74 { \
75 return comedi_pci_auto_config(dev, comedi_driver.driver_name); \
76 } \
77 static void __devexit comedi_driver ## _pci_remove(struct pci_dev *dev) \
78 { \
79 comedi_pci_auto_unconfig(dev); \
80 } \
81 static struct pci_driver comedi_driver ## _pci_driver = \
82 { \
83 .id_table = pci_id_table, \
e0dcef71
GKH
84 .probe = &comedi_driver ## _pci_probe, \
85 .remove = __devexit_p(&comedi_driver ## _pci_remove) \
ed9eccbe
DS
86 }; \
87 static int __init comedi_driver ## _init_module(void) \
88 { \
89 int retval; \
e0dcef71
GKH
90 retval = comedi_driver_register(&comedi_driver); \
91 if (retval < 0) \
92 return retval; \
93 comedi_driver ## _pci_driver.name = (char *)comedi_driver.driver_name; \
94 return pci_register_driver(&comedi_driver ## _pci_driver); \
ed9eccbe
DS
95 } \
96 static void __exit comedi_driver ## _cleanup_module(void) \
97 { \
e0dcef71
GKH
98 pci_unregister_driver(&comedi_driver ## _pci_driver); \
99 comedi_driver_unregister(&comedi_driver); \
ed9eccbe
DS
100 } \
101 module_init(comedi_driver ## _init_module); \
102 module_exit(comedi_driver ## _cleanup_module);
103
104#define COMEDI_PCI_INITCLEANUP(comedi_driver, pci_id_table) \
105 COMEDI_MODULE_MACROS \
106 COMEDI_PCI_INITCLEANUP_NOMODULE(comedi_driver, pci_id_table)
107
108#define PCI_VENDOR_ID_INOVA 0x104c
109#define PCI_VENDOR_ID_NATINST 0x1093
110#define PCI_VENDOR_ID_DATX 0x1116
111#define PCI_VENDOR_ID_COMPUTERBOARDS 0x1307
112#define PCI_VENDOR_ID_ADVANTECH 0x13fe
113#define PCI_VENDOR_ID_RTD 0x1435
114#define PCI_VENDOR_ID_AMPLICON 0x14dc
115#define PCI_VENDOR_ID_ADLINK 0x144a
116#define PCI_VENDOR_ID_ICP 0x104c
117#define PCI_VENDOR_ID_CONTEC 0x1221
118#define PCI_VENDOR_ID_MEILHAUS 0x1402
119
120#define COMEDI_NUM_MINORS 0x100
ed9eccbe
DS
121#define COMEDI_NUM_BOARD_MINORS 0x30
122#define COMEDI_FIRST_SUBDEVICE_MINOR COMEDI_NUM_BOARD_MINORS
123
ed9eccbe
DS
124#define COMEDI_DEVICE_CREATE(cs, parent, devt, drvdata, device, fmt...) \
125 device_create(cs, ((parent) ? (parent) : (device)), devt, drvdata, fmt)
126
34c43922 127struct comedi_subdevice {
71b5f4f1 128 struct comedi_device *device;
ed9eccbe
DS
129 int type;
130 int n_chan;
131 volatile int subdev_flags;
132 int len_chanlist; /* maximum length of channel/gain list */
133
134 void *private;
135
d163679c 136 struct comedi_async *async;
ed9eccbe
DS
137
138 void *lock;
139 void *busy;
140 unsigned runflags;
141 spinlock_t spin_lock;
142
143 int io_bits;
144
790c5541
BP
145 unsigned int maxdata; /* if maxdata==0, use list */
146 const unsigned int *maxdata_list; /* list is channel specific */
ed9eccbe
DS
147
148 unsigned int flags;
149 const unsigned int *flaglist;
150
151 unsigned int settling_time_0;
152
9ced1de6
BP
153 const struct comedi_lrange *range_table;
154 const struct comedi_lrange *const *range_table_list;
ed9eccbe
DS
155
156 unsigned int *chanlist; /* driver-owned chanlist (not used) */
157
90035c08 158 int (*insn_read) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
790c5541 159 unsigned int *);
90035c08 160 int (*insn_write) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
790c5541 161 unsigned int *);
90035c08 162 int (*insn_bits) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
790c5541 163 unsigned int *);
90035c08 164 int (*insn_config) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *,
790c5541 165 unsigned int *);
ed9eccbe 166
34c43922 167 int (*do_cmd) (struct comedi_device *, struct comedi_subdevice *);
ea6d0d4c 168 int (*do_cmdtest) (struct comedi_device *, struct comedi_subdevice *, struct comedi_cmd *);
34c43922
BP
169 int (*poll) (struct comedi_device *, struct comedi_subdevice *);
170 int (*cancel) (struct comedi_device *, struct comedi_subdevice *);
171 /* int (*do_lock)(struct comedi_device *,struct comedi_subdevice *); */
172 /* int (*do_unlock)(struct comedi_device *,struct comedi_subdevice *); */
ed9eccbe
DS
173
174 /* called when the buffer changes */
34c43922 175 int (*buf_change) (struct comedi_device *dev, struct comedi_subdevice *s,
ed9eccbe
DS
176 unsigned long new_size);
177
34c43922 178 void (*munge) (struct comedi_device *dev, struct comedi_subdevice *s, void *data,
ed9eccbe
DS
179 unsigned int num_bytes, unsigned int start_chan_index);
180 enum dma_data_direction async_dma_dir;
181
182 unsigned int state;
183
0bfbbe8f 184 struct device *class_dev;
ed9eccbe
DS
185 int minor;
186};
187
188struct comedi_buf_page {
189 void *virt_addr;
190 dma_addr_t dma_addr;
191};
192
d163679c 193struct comedi_async {
34c43922 194 struct comedi_subdevice *subdevice;
ed9eccbe
DS
195
196 void *prealloc_buf; /* pre-allocated buffer */
197 unsigned int prealloc_bufsz; /* buffer size, in bytes */
198 struct comedi_buf_page *buf_page_list; /* virtual and dma address of each page */
199 unsigned n_buf_pages; /* num elements in buf_page_list */
200
201 unsigned int max_bufsize; /* maximum buffer size, bytes */
202 unsigned int mmap_count; /* current number of mmaps of prealloc_buf */
203
204 unsigned int buf_write_count; /* byte count for writer (write completed) */
205 unsigned int buf_write_alloc_count; /* byte count for writer (allocated for writing) */
206 unsigned int buf_read_count; /* byte count for reader (read completed) */
207 unsigned int buf_read_alloc_count; /* byte count for reader (allocated for reading) */
208
209 unsigned int buf_write_ptr; /* buffer marker for writer */
210 unsigned int buf_read_ptr; /* buffer marker for reader */
211
212 unsigned int cur_chan; /* useless channel marker for interrupt */
213 /* number of bytes that have been received for current scan */
214 unsigned int scan_progress;
215 /* keeps track of where we are in chanlist as for munging */
216 unsigned int munge_chan;
217 /* number of bytes that have been munged */
218 unsigned int munge_count;
219 /* buffer marker for munging */
220 unsigned int munge_ptr;
221
222 unsigned int events; /* events that have occurred */
223
ea6d0d4c 224 struct comedi_cmd cmd;
ed9eccbe
DS
225
226 wait_queue_head_t wait_head;
227
e0dcef71 228 /* callback stuff */
ed9eccbe
DS
229 unsigned int cb_mask;
230 int (*cb_func) (unsigned int flags, void *);
231 void *cb_arg;
232
34c43922 233 int (*inttrig) (struct comedi_device *dev, struct comedi_subdevice *s,
e0dcef71 234 unsigned int x);
ed9eccbe
DS
235};
236
139dfbdf
BP
237struct comedi_driver {
238 struct comedi_driver *next;
ed9eccbe
DS
239
240 const char *driver_name;
241 struct module *module;
0707bb04 242 int (*attach) (struct comedi_device *, struct comedi_devconfig *);
71b5f4f1 243 int (*detach) (struct comedi_device *);
ed9eccbe
DS
244
245 /* number of elements in board_name and board_id arrays */
246 unsigned int num_names;
247 const char *const *board_name;
248 /* offset in bytes from one board name pointer to the next */
249 int offset;
250};
251
71b5f4f1 252struct comedi_device {
ed9eccbe 253 int use_count;
139dfbdf 254 struct comedi_driver *driver;
ed9eccbe
DS
255 void *private;
256
0bfbbe8f 257 struct device *class_dev;
ed9eccbe 258 int minor;
e0dcef71
GKH
259 /* hw_dev is passed to dma_alloc_coherent when allocating async buffers
260 * for subdevices that have async_dma_dir set to something other than
261 * DMA_NONE */
ed9eccbe
DS
262 struct device *hw_dev;
263
264 const char *board_name;
265 const void *board_ptr;
266 int attached;
ed9eccbe
DS
267 spinlock_t spinlock;
268 struct mutex mutex;
269 int in_request_module;
270
271 int n_subdevices;
34c43922 272 struct comedi_subdevice *subdevices;
ed9eccbe
DS
273
274 /* dumb */
275 unsigned long iobase;
276 unsigned int irq;
277
34c43922
BP
278 struct comedi_subdevice *read_subdev;
279 struct comedi_subdevice *write_subdev;
ed9eccbe
DS
280
281 struct fasync_struct *async_queue;
282
71b5f4f1
BP
283 void (*open) (struct comedi_device *dev);
284 void (*close) (struct comedi_device *dev);
ed9eccbe
DS
285};
286
287struct comedi_device_file_info {
71b5f4f1 288 struct comedi_device *device;
34c43922
BP
289 struct comedi_subdevice *read_subdevice;
290 struct comedi_subdevice *write_subdevice;
ed9eccbe
DS
291};
292
293#ifdef CONFIG_COMEDI_DEBUG
294extern int comedi_debug;
295#else
e0dcef71 296static const int comedi_debug;
ed9eccbe
DS
297#endif
298
299/*
300 * function prototypes
301 */
302
34c43922 303void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s);
71b5f4f1 304void comedi_error(const struct comedi_device *dev, const char *s);
ed9eccbe
DS
305
306/* we can expand the number of bits used to encode devices/subdevices into
307 the minor number soon, after more distros support > 8 bit minor numbers
308 (like after Debian Etch gets released) */
309enum comedi_minor_bits {
310 COMEDI_DEVICE_MINOR_MASK = 0xf,
311 COMEDI_SUBDEVICE_MINOR_MASK = 0xf0
312};
313static const unsigned COMEDI_SUBDEVICE_MINOR_SHIFT = 4;
314static const unsigned COMEDI_SUBDEVICE_MINOR_OFFSET = 1;
315
e0dcef71 316struct comedi_device_file_info *comedi_get_device_file_info(unsigned minor);
ed9eccbe 317
34c43922 318static inline struct comedi_subdevice *comedi_get_read_subdevice(
e0dcef71 319 const struct comedi_device_file_info *info)
ed9eccbe 320{
e0dcef71
GKH
321 if (info->read_subdevice)
322 return info->read_subdevice;
323 if (info->device == NULL)
324 return NULL;
ed9eccbe
DS
325 return info->device->read_subdev;
326}
327
34c43922 328static inline struct comedi_subdevice *comedi_get_write_subdevice(
e0dcef71 329 const struct comedi_device_file_info *info)
ed9eccbe 330{
e0dcef71
GKH
331 if (info->write_subdevice)
332 return info->write_subdevice;
333 if (info->device == NULL)
334 return NULL;
ed9eccbe
DS
335 return info->device->write_subdev;
336}
337
71b5f4f1 338void comedi_device_detach(struct comedi_device *dev);
0707bb04 339int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it);
139dfbdf
BP
340int comedi_driver_register(struct comedi_driver *);
341int comedi_driver_unregister(struct comedi_driver *);
ed9eccbe
DS
342
343void init_polling(void);
344void cleanup_polling(void);
71b5f4f1
BP
345void start_polling(struct comedi_device *);
346void stop_polling(struct comedi_device *);
ed9eccbe 347
34c43922 348int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, unsigned long
ed9eccbe
DS
349 new_size);
350
351#ifdef CONFIG_PROC_FS
352void comedi_proc_init(void);
353void comedi_proc_cleanup(void);
354#else
355static inline void comedi_proc_init(void)
356{
357}
358static inline void comedi_proc_cleanup(void)
359{
360}
361#endif
362
363/* subdevice runflags */
364enum subdevice_runflags {
365 SRF_USER = 0x00000001,
366 SRF_RT = 0x00000002,
e0dcef71
GKH
367 /* indicates an COMEDI_CB_ERROR event has occurred since the last
368 * command was started */
ed9eccbe
DS
369 SRF_ERROR = 0x00000004,
370 SRF_RUNNING = 0x08000000
371};
372
373/*
374 various internal comedi functions
375 */
376
d0a353f6 377int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg);
34c43922
BP
378int check_chanlist(struct comedi_subdevice *s, int n, unsigned int *chanlist);
379void comedi_set_subdevice_runflags(struct comedi_subdevice *s, unsigned mask,
ed9eccbe 380 unsigned bits);
34c43922
BP
381unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s);
382int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
90035c08 383 struct comedi_insn *insn, unsigned int *data);
ed9eccbe
DS
384
385/* range stuff */
386
e0dcef71
GKH
387#define RANGE(a, b) {(a)*1e6, (b)*1e6, 0}
388#define RANGE_ext(a, b) {(a)*1e6, (b)*1e6, RF_EXTERNAL}
389#define RANGE_mA(a, b) {(a)*1e6, (b)*1e6, UNIT_mA}
390#define RANGE_unitless(a, b) {(a)*1e6, (b)*1e6, 0} /* XXX */
391#define BIP_RANGE(a) {-(a)*1e6, (a)*1e6, 0}
392#define UNI_RANGE(a) {0, (a)*1e6, 0}
ed9eccbe 393
9ced1de6
BP
394extern const struct comedi_lrange range_bipolar10;
395extern const struct comedi_lrange range_bipolar5;
396extern const struct comedi_lrange range_bipolar2_5;
397extern const struct comedi_lrange range_unipolar10;
398extern const struct comedi_lrange range_unipolar5;
399extern const struct comedi_lrange range_unknown;
ed9eccbe
DS
400
401#define range_digital range_unipolar5
402
403#if __GNUC__ >= 3
404#define GCC_ZERO_LENGTH_ARRAY
405#else
406#define GCC_ZERO_LENGTH_ARRAY 0
407#endif
408
9ced1de6 409struct comedi_lrange {
ed9eccbe 410 int length;
1f6325d6 411 struct comedi_krange range[GCC_ZERO_LENGTH_ARRAY];
ed9eccbe
DS
412};
413
414/* some silly little inline functions */
415
71b5f4f1 416static inline int alloc_subdevices(struct comedi_device *dev,
e0dcef71 417 unsigned int num_subdevices)
ed9eccbe
DS
418{
419 unsigned i;
420
421 dev->n_subdevices = num_subdevices;
422 dev->subdevices =
34c43922 423 kcalloc(num_subdevices, sizeof(struct comedi_subdevice), GFP_KERNEL);
ed9eccbe
DS
424 if (!dev->subdevices)
425 return -ENOMEM;
426 for (i = 0; i < num_subdevices; ++i) {
427 dev->subdevices[i].device = dev;
428 dev->subdevices[i].async_dma_dir = DMA_NONE;
429 spin_lock_init(&dev->subdevices[i].spin_lock);
430 dev->subdevices[i].minor = -1;
431 }
432 return 0;
433}
434
71b5f4f1 435static inline int alloc_private(struct comedi_device *dev, int size)
ed9eccbe
DS
436{
437 dev->private = kzalloc(size, GFP_KERNEL);
438 if (!dev->private)
439 return -ENOMEM;
440 return 0;
441}
442
34c43922 443static inline unsigned int bytes_per_sample(const struct comedi_subdevice *subd)
ed9eccbe
DS
444{
445 if (subd->subdev_flags & SDF_LSAMPL)
790c5541 446 return sizeof(unsigned int);
ed9eccbe 447 else
790c5541 448 return sizeof(short);
ed9eccbe
DS
449}
450
451/* must be used in attach to set dev->hw_dev if you wish to dma directly
452into comedi's buffer */
71b5f4f1 453static inline void comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev)
ed9eccbe 454{
e0dcef71 455 if (dev->hw_dev)
ed9eccbe 456 put_device(dev->hw_dev);
e0dcef71 457
ed9eccbe
DS
458 dev->hw_dev = hw_dev;
459 if (dev->hw_dev) {
460 dev->hw_dev = get_device(dev->hw_dev);
461 BUG_ON(dev->hw_dev == NULL);
462 }
463}
464
d163679c
BP
465int comedi_buf_put(struct comedi_async *async, short x);
466int comedi_buf_get(struct comedi_async *async, short *x);
ed9eccbe 467
d163679c
BP
468unsigned int comedi_buf_write_n_available(struct comedi_async *async);
469unsigned int comedi_buf_write_alloc(struct comedi_async *async, unsigned int nbytes);
470unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
ed9eccbe 471 unsigned int nbytes);
d163679c
BP
472unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes);
473unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes);
474unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes);
475unsigned int comedi_buf_read_n_available(struct comedi_async *async);
476void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
ed9eccbe 477 const void *source, unsigned int num_bytes);
d163679c 478void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
ed9eccbe 479 void *destination, unsigned int num_bytes);
d163679c 480static inline unsigned comedi_buf_write_n_allocated(struct comedi_async *async)
ed9eccbe
DS
481{
482 return async->buf_write_alloc_count - async->buf_write_count;
483}
d163679c 484static inline unsigned comedi_buf_read_n_allocated(struct comedi_async *async)
ed9eccbe
DS
485{
486 return async->buf_read_alloc_count - async->buf_read_count;
487}
488
d163679c 489void comedi_reset_async_buf(struct comedi_async *async);
ed9eccbe
DS
490
491static inline void *comedi_aux_data(int options[], int n)
492{
493 unsigned long address;
494 unsigned long addressLow;
495 int bit_shift;
496 if (sizeof(int) >= sizeof(void *))
497 address = options[COMEDI_DEVCONF_AUX_DATA_LO];
498 else {
499 address = options[COMEDI_DEVCONF_AUX_DATA_HI];
500 bit_shift = sizeof(int) * 8;
501 address <<= bit_shift;
502 addressLow = options[COMEDI_DEVCONF_AUX_DATA_LO];
503 addressLow &= (1UL << bit_shift) - 1;
504 address |= addressLow;
505 }
506 if (n >= 1)
507 address += options[COMEDI_DEVCONF_AUX_DATA0_LENGTH];
508 if (n >= 2)
509 address += options[COMEDI_DEVCONF_AUX_DATA1_LENGTH];
510 if (n >= 3)
511 address += options[COMEDI_DEVCONF_AUX_DATA2_LENGTH];
512 BUG_ON(n > 3);
513 return (void *)address;
514}
515
516int comedi_alloc_board_minor(struct device *hardware_device);
517void comedi_free_board_minor(unsigned minor);
34c43922
BP
518int comedi_alloc_subdevice_minor(struct comedi_device *dev, struct comedi_subdevice *s);
519void comedi_free_subdevice_minor(struct comedi_subdevice *s);
ed9eccbe
DS
520int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name);
521void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
c28264da
BP
522struct usb_device; /* forward declaration */
523int comedi_usb_auto_config(struct usb_device *usbdev, const char *board_name);
524void comedi_usb_auto_unconfig(struct usb_device *usbdev);
ed9eccbe 525
056d3ce5
GKH
526#ifdef CONFIG_COMEDI_PCI_DRIVERS
527 #define CONFIG_COMEDI_PCI
528#endif
529#ifdef CONFIG_COMEDI_PCI_DRIVERS_MODULE
530 #define CONFIG_COMEDI_PCI
531#endif
532#ifdef CONFIG_COMEDI_PCMCIA_DRIVERS
533 #define CONFIG_COMEDI_PCMCIA
534#endif
535#ifdef CONFIG_COMEDI_PCMCIA_DRIVERS_MODULE
536 #define CONFIG_COMEDI_PCMCIA
537#endif
538
ed9eccbe 539#endif /* _COMEDIDEV_H */