Xenomai API  2.6.5
context.h
Go to the documentation of this file.
1 
23 #ifndef __ANALOGY_CONTEXT__
24 #define __ANALOGY_CONTEXT__
25 
26 #if defined(__KERNEL__) && !defined(DOXYGEN_CPP)
27 
28 #include <rtdm/rtdm_driver.h>
29 
30 struct a4l_device;
31 struct a4l_buffer;
32 
33 struct a4l_device_context {
34 
35  /* Needed to call rtdm_*_copy_from/to_user functions */
36  rtdm_user_info_t *user_info;
37 
38  /* The adequate device pointer
39  (retrieved thanks to minor at open time) */
40  struct a4l_device *dev;
41 
42  /* The buffer structure contains everything to transfer data
43  from asynchronous acquisition operations on a specific
44  subdevice */
45  struct a4l_buffer *buffer;
46 };
47 typedef struct a4l_device_context a4l_cxt_t;
48 
49 static inline int a4l_get_minor(a4l_cxt_t *cxt)
50 {
51  /* Get a pointer on the container structure */
52  struct rtdm_dev_context * rtdm_cxt = rtdm_private_to_context(cxt);
53  /* Get the minor index */
54  return rtdm_cxt->device->device_id;
55 }
56 
57 #endif /* __KERNEL__ && !DOXYGEN_CPP */
58 
59 #endif /* __ANALOGY_CONTEXT__ */
static struct rtdm_dev_context * rtdm_private_to_context(void *dev_private)
Locate a device context structure from its driver private area.
Definition: rtdm_driver.h:444
struct rtdm_device * device
Reference to owning device.
Definition: rtdm_driver.h:412
int device_id
Driver definable device ID.
Definition: rtdm_driver.h:528
Device context.
Definition: rtdm_driver.h:397
Real-Time Driver Model for Xenomai, driver API header.