Xenomai  3.1
rtdm.h
Go to the documentation of this file.
1 
23 #ifndef _RTDM_UAPI_RTDM_H
24 #define _RTDM_UAPI_RTDM_H
25 
35 #define RTDM_API_VER 9
36 
38 #define RTDM_API_MIN_COMPAT_VER 9
39 
43 typedef uint64_t nanosecs_abs_t;
44 
49 typedef int64_t nanosecs_rel_t;
50 
56 #define RTDM_TIMEOUT_INFINITE 0
57 
59 #define RTDM_TIMEOUT_NONE (-1)
60 
72 #define RTDM_CLASS_PARPORT 1
73 #define RTDM_CLASS_SERIAL 2
74 #define RTDM_CLASS_CAN 3
75 #define RTDM_CLASS_NETWORK 4
76 #define RTDM_CLASS_RTMAC 5
77 #define RTDM_CLASS_TESTING 6
78 #define RTDM_CLASS_RTIPC 7
79 #define RTDM_CLASS_COBALT 8
80 #define RTDM_CLASS_UDD 9
81 #define RTDM_CLASS_MEMORY 10
82 #define RTDM_CLASS_GPIO 11
83 #define RTDM_CLASS_SPI 12
84 #define RTDM_CLASS_PWM 13
85 
86 #define RTDM_CLASS_MISC 223
87 #define RTDM_CLASS_EXPERIMENTAL 224
88 #define RTDM_CLASS_MAX 255
89 
91 #define RTDM_SUBCLASS_GENERIC (-1)
92 
93 #define RTIOC_TYPE_COMMON 0
94 
100 #define RTDM_MAX_DEVNAME_LEN 31
101 
106 typedef struct rtdm_device_info {
109 
112 
117 
121 
126 #define RTDM_PURGE_RX_BUFFER 0x0001
127 #define RTDM_PURGE_TX_BUFFER 0x0002
128 
140 #define RTIOC_DEVICE_INFO \
141  _IOR(RTIOC_TYPE_COMMON, 0x00, struct rtdm_device_info)
142 
147 #define RTIOC_PURGE _IOW(RTIOC_TYPE_COMMON, 0x10, int)
148 
151 /* Internally used for mapping socket functions on IOCTLs */
152 struct _rtdm_getsockopt_args {
153  int level;
154  int optname;
155  void *optval;
156  socklen_t *optlen;
157 };
158 
159 struct _rtdm_setsockopt_args {
160  int level;
161  int optname;
162  const void *optval;
163  socklen_t optlen;
164 };
165 
166 struct _rtdm_getsockaddr_args {
167  struct sockaddr *addr;
168  socklen_t *addrlen;
169 };
170 
171 struct _rtdm_setsockaddr_args {
172  const struct sockaddr *addr;
173  socklen_t addrlen;
174 };
175 
176 #define _RTIOC_GETSOCKOPT _IOW(RTIOC_TYPE_COMMON, 0x20, \
177  struct _rtdm_getsockopt_args)
178 #define _RTIOC_SETSOCKOPT _IOW(RTIOC_TYPE_COMMON, 0x21, \
179  struct _rtdm_setsockopt_args)
180 #define _RTIOC_BIND _IOW(RTIOC_TYPE_COMMON, 0x22, \
181  struct _rtdm_setsockaddr_args)
182 #define _RTIOC_CONNECT _IOW(RTIOC_TYPE_COMMON, 0x23, \
183  struct _rtdm_setsockaddr_args)
184 #define _RTIOC_LISTEN _IOW(RTIOC_TYPE_COMMON, 0x24, \
185  int)
186 #define _RTIOC_ACCEPT _IOW(RTIOC_TYPE_COMMON, 0x25, \
187  struct _rtdm_getsockaddr_args)
188 #define _RTIOC_GETSOCKNAME _IOW(RTIOC_TYPE_COMMON, 0x26, \
189  struct _rtdm_getsockaddr_args)
190 #define _RTIOC_GETPEERNAME _IOW(RTIOC_TYPE_COMMON, 0x27, \
191  struct _rtdm_getsockaddr_args)
192 #define _RTIOC_SHUTDOWN _IOW(RTIOC_TYPE_COMMON, 0x28, \
193  int)
194 
195 /* Internally used for mmap() */
196 struct _rtdm_mmap_request {
197  __u64 offset;
198  size_t length;
199  int prot;
200  int flags;
201 };
202 
203 #endif /* !_RTDM_UAPI_RTDM_H */
struct rtdm_device_info rtdm_device_info_t
Device information.
int64_t nanosecs_rel_t
RTDM type for representing relative intervals.
Definition: rtdm.h:49
int device_sub_class
Device sub-class, either RTDM_SUBCLASS_GENERIC or a RTDM_SUBCLASS_xxx definition of the related Devic...
Definition: rtdm.h:116
uint64_t nanosecs_abs_t
RTDM type for representing absolute dates.
Definition: rtdm.h:43
int profile_version
Supported device profile version.
Definition: rtdm.h:119
int device_flags
Device flags, see Device Flags for details.
Definition: rtdm.h:108
Device information.
Definition: rtdm.h:106
int device_class
Device class ID, see RTDM_CLASS_xxx.
Definition: rtdm.h:111