Xenomai  3.0.5
tdma_chrdev.h
1 /***
2  *
3  * include/tdma_chrdev.h
4  *
5  * RTmac - real-time networking media access control subsystem
6  * Copyright (C) 2002 Marc Kleine-Budde <kleine-budde@gmx.de>,
7  * 2003-2005 Jan Kiszka <Jan.Kiszka@web.de>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  */
24 
25 #ifndef __TDMA_CHRDEV_H_
26 #define __TDMA_CHRDEV_H_
27 
28 #ifndef __KERNEL__
29 # include <inttypes.h>
30 #endif
31 
32 #include <rtnet_chrdev.h>
33 
34 
35 #define MIN_SLOT_SIZE 60
36 
37 
38 struct tdma_config {
39  struct rtnet_ioctl_head head;
40 
41  union {
42  struct {
43  __u64 cycle_period;
44  __u64 backup_sync_offset;
45  __u32 cal_rounds;
46  __u32 max_cal_requests;
47  __u32 max_slot_id;
48  } master;
49 
50  struct {
51  __u32 cal_rounds;
52  __u32 max_slot_id;
53  } slave;
54 
55  struct {
56  __s32 id;
57  __u32 period;
58  __u64 offset;
59  __u32 phasing;
60  __u32 size;
61  __s32 joint_slot;
62  __u32 cal_timeout;
63  __u64 *cal_results;
64  } set_slot;
65 
66  struct {
67  __s32 id;
68  } remove_slot;
69 
70  __u64 __padding[8];
71  } args;
72 };
73 
74 
75 #define TDMA_IOC_MASTER _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 0, \
76  struct tdma_config)
77 #define TDMA_IOC_SLAVE _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 1, \
78  struct tdma_config)
79 #define TDMA_IOC_CAL_RESULT_SIZE _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 2, \
80  struct tdma_config)
81 #define TDMA_IOC_SET_SLOT _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 3, \
82  struct tdma_config)
83 #define TDMA_IOC_REMOVE_SLOT _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 4, \
84  struct tdma_config)
85 #define TDMA_IOC_DETACH _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 5, \
86  struct tdma_config)
87 
88 #endif /* __TDMA_CHRDEV_H_ */