Xenomai  3.0.8
rtmac.h
1 /***
2  *
3  * include/rtmac.h
4  *
5  * rtmac - real-time networking media access control subsystem
6  * Copyright (C) 2004-2006 Jan Kiszka <Jan.Kiszka@web.de>
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  * As a special exception to the GNU General Public license, the RTnet
23  * project allows you to use this header file in unmodified form to produce
24  * application programs executing in user-space which use RTnet services by
25  * normal system calls. The resulting executable will not be covered by the
26  * GNU General Public License merely as a result of this header file use.
27  * Instead, this header file use will be considered normal use of RTnet and
28  * not a "derived work" in the sense of the GNU General Public License.
29  *
30  * This exception does not apply when the application code is built as a
31  * static or dynamically loadable portion of the Linux kernel nor does the
32  * exception override other reasons justifying application of the GNU General
33  * Public License.
34  *
35  * This exception applies only to the code released by the RTnet project
36  * under the name RTnet and bearing this exception notice. If you copy code
37  * from other sources into a copy of RTnet, the exception does not apply to
38  * the code that you add in this way.
39  *
40  */
41 
42 #ifndef __RTMAC_H_
43 #define __RTMAC_H_
44 
45 #include <rtdm/rtdm.h>
46 
47 
48 /* sub-classes: RTDM_CLASS_RTMAC */
49 #define RTDM_SUBCLASS_TDMA 0
50 #define RTDM_SUBCLASS_UNMANAGED 1
51 
52 #define RTIOC_TYPE_RTMAC RTDM_CLASS_RTMAC
53 
54 
55 /* ** Common Cycle Event Types ** */
56 /* standard event, wake up once per cycle */
57 #define RTMAC_WAIT_ON_DEFAULT 0x00
58 /* wake up on media access of the station, may trigger multiple times per
59  cycle */
60 #define RTMAC_WAIT_ON_XMIT 0x01
61 
62 /* ** TDMA-specific Cycle Event Types ** */
63 /* tigger on on SYNC frame reception/transmission */
64 #define TDMA_WAIT_ON_SYNC RTMAC_WAIT_ON_DEFAULT
65 #define TDMA_WAIT_ON_SOF TDMA_WAIT_ON_SYNC /* legacy support */
66 
67 
68 /* RTMAC_RTIOC_WAITONCYCLE_EX control and status data */
69 struct rtmac_waitinfo {
71  unsigned int type;
72 
74  size_t size;
75 
78  unsigned long cycle_no;
79 
82  nanosecs_abs_t cycle_start;
83 
86  nanosecs_rel_t clock_offset;
87 };
88 
89 
90 /* RTmac Discipline IOCTLs */
91 #define RTMAC_RTIOC_TIMEOFFSET _IOR(RTIOC_TYPE_RTMAC, 0x00, int64_t)
92 #define RTMAC_RTIOC_WAITONCYCLE _IOW(RTIOC_TYPE_RTMAC, 0x01, unsigned int)
93 #define RTMAC_RTIOC_WAITONCYCLE_EX _IOWR(RTIOC_TYPE_RTMAC, 0x02, \
94  struct rtmac_waitinfo)
95 
96 #endif /* __RTMAC_H_ */
int64_t nanosecs_rel_t
RTDM type for representing relative intervals.
Definition: rtdm.h:49
uint64_t nanosecs_abs_t
RTDM type for representing absolute dates.
Definition: rtdm.h:43