Xenomai  3.0.8
device.h
1 /*
2  * Analogy for Linux, device related features
3  *
4  * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
5  * Copyright (C) 2008 Alexis Berlemont <alexis.berlemont@free.fr>
6  *
7  * Xenomai is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * Xenomai is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Xenomai; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 #ifndef _COBALT_RTDM_ANALOGY_DEVICE_H
22 #define _COBALT_RTDM_ANALOGY_DEVICE_H
23 
24 #include <rtdm/analogy/rtdm_helpers.h>
25 #include <rtdm/analogy/transfer.h>
26 #include <rtdm/analogy/driver.h>
27 
28 #define A4L_NB_DEVICES 10
29 
30 #define A4L_DEV_ATTACHED_NR 0
31 
32 struct a4l_device {
33 
34  /* Spinlock for global device use */
35  rtdm_lock_t lock;
36 
37  /* Device specific flags */
38  unsigned long flags;
39 
40  /* Driver assigned to this device thanks to attaching
41  procedure */
42  struct a4l_driver *driver;
43 
44  /* Hidden description stuff */
45  struct list_head subdvsq;
46 
47  /* Context-dependent stuff */
48  struct a4l_transfer transfer;
49 
50  /* Private data useful for drivers functioning */
51  void *priv;
52 };
53 
54 /* --- Devices tab related functions --- */
55 void a4l_init_devs(void);
56 int a4l_check_cleanup_devs(void);
57 int a4l_rdproc_devs(struct seq_file *p, void *data);
58 
59 /* --- Context related function / macro --- */
60 void a4l_set_dev(struct a4l_device_context *cxt);
61 #define a4l_get_dev(x) ((x)->dev)
62 
63 /* --- Upper layer functions --- */
64 int a4l_ioctl_devcfg(struct a4l_device_context * cxt, void *arg);
65 int a4l_ioctl_devinfo(struct a4l_device_context * cxt, void *arg);
66 
67 #endif /* !_COBALT_RTDM_ANALOGY_DEVICE_H */
ipipe_spinlock_t rtdm_lock_t
Lock variable.
Definition: driver.h:551
Analogy for Linux, driver facilities.
Structure containing driver declaration data.
Definition: driver.h:39