00001 
00023 #ifndef __ANALOGY_DEVICE__
00024 #define __ANALOGY_DEVICE__
00025 
00026 #ifndef DOXYGEN_CPP
00027 
00028 #include <analogy/context.h>
00029 #include <analogy/driver.h>
00030 #include <analogy/transfer.h>
00031 
00032 #ifdef __KERNEL__
00033 
00034 #define A4L_NB_DEVICES 10
00035 
00036 #define A4L_DEV_ATTACHED 0
00037 
00038 struct a4l_device {
00039 
00040         
00041         a4l_lock_t lock;
00042 
00043         
00044         unsigned long flags;
00045 
00046         
00047 
00048         a4l_drv_t *driver;
00049 
00050         
00051         struct list_head subdvsq;
00052 
00053         
00054         a4l_trf_t transfer;
00055 
00056         
00057         void *priv;
00058 };
00059 typedef struct a4l_device a4l_dev_t;
00060 
00061 #endif 
00062 
00063 
00064 struct a4l_link_desc {
00065         unsigned char bname_size;
00066         char *bname;
00067         unsigned int opts_size;
00068         void *opts;
00069 };
00070 typedef struct a4l_link_desc a4l_lnkdesc_t;
00071 
00072 
00073 struct a4l_dev_info {
00074         char board_name[A4L_NAMELEN];
00075         int nb_subd;
00076         int idx_read_subd;
00077         int idx_write_subd;
00078 };
00079 typedef struct a4l_dev_info a4l_dvinfo_t;
00080 
00081 #ifdef __KERNEL__
00082 
00083 
00084 #define a4l_check_dev(x) test_bit(A4L_DEV_ATTACHED, &(x->flags))
00085 
00086 
00087 void a4l_init_devs(void);
00088 int a4l_check_cleanup_devs(void);
00089 int a4l_rdproc_devs(char *page,
00090                     char **start,
00091                     off_t off, int count, int *eof, void *data);
00092 
00093 
00094 void a4l_set_dev(a4l_cxt_t * cxt);
00095 #define a4l_get_dev(x) ((x)->dev)
00096 
00097 
00098 int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg);
00099 int a4l_ioctl_devinfo(a4l_cxt_t * cxt, void *arg);
00100 
00101 #endif 
00102 
00103 #endif 
00104 
00105 #endif