Xenomai  3.1
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 /* sub-classes: RTDM_CLASS_RTMAC */
48 #define RTDM_SUBCLASS_TDMA 0
49 #define RTDM_SUBCLASS_UNMANAGED 1
50 
51 #define RTIOC_TYPE_RTMAC RTDM_CLASS_RTMAC
52 
53 /* ** Common Cycle Event Types ** */
54 /* standard event, wake up once per cycle */
55 #define RTMAC_WAIT_ON_DEFAULT 0x00
56 /* wake up on media access of the station, may trigger multiple times per
57  cycle */
58 #define RTMAC_WAIT_ON_XMIT 0x01
59 
60 /* ** TDMA-specific Cycle Event Types ** */
61 /* tigger on on SYNC frame reception/transmission */
62 #define TDMA_WAIT_ON_SYNC RTMAC_WAIT_ON_DEFAULT
63 #define TDMA_WAIT_ON_SOF TDMA_WAIT_ON_SYNC /* legacy support */
64 
65 /* RTMAC_RTIOC_WAITONCYCLE_EX control and status data */
66 struct rtmac_waitinfo {
68  unsigned int type;
69 
71  size_t size;
72 
75  unsigned long cycle_no;
76 
79  nanosecs_abs_t cycle_start;
80 
83  nanosecs_rel_t clock_offset;
84 };
85 
86 /* RTmac Discipline IOCTLs */
87 #define RTMAC_RTIOC_TIMEOFFSET _IOR(RTIOC_TYPE_RTMAC, 0x00, int64_t)
88 #define RTMAC_RTIOC_WAITONCYCLE _IOW(RTIOC_TYPE_RTMAC, 0x01, unsigned int)
89 #define RTMAC_RTIOC_WAITONCYCLE_EX \
90  _IOWR(RTIOC_TYPE_RTMAC, 0x02, struct rtmac_waitinfo)
91 
92 #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