Xenomai  3.1
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 #define MIN_SLOT_SIZE 60
35 
36 struct tdma_config {
37  struct rtnet_ioctl_head head;
38 
39  union {
40  struct {
41  __u64 cycle_period;
42  __u64 backup_sync_offset;
43  __u32 cal_rounds;
44  __u32 max_cal_requests;
45  __u32 max_slot_id;
46  } master;
47 
48  struct {
49  __u32 cal_rounds;
50  __u32 max_slot_id;
51  } slave;
52 
53  struct {
54  __s32 id;
55  __u32 period;
56  __u64 offset;
57  __u32 phasing;
58  __u32 size;
59  __s32 joint_slot;
60  __u32 cal_timeout;
61  __u64 *cal_results;
62  } set_slot;
63 
64  struct {
65  __s32 id;
66  } remove_slot;
67 
68  __u64 __padding[8];
69  } args;
70 };
71 
72 #define TDMA_IOC_MASTER _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 0, struct tdma_config)
73 #define TDMA_IOC_SLAVE _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 1, struct tdma_config)
74 #define TDMA_IOC_CAL_RESULT_SIZE \
75  _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 2, struct tdma_config)
76 #define TDMA_IOC_SET_SLOT _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 3, struct tdma_config)
77 #define TDMA_IOC_REMOVE_SLOT \
78  _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 4, struct tdma_config)
79 #define TDMA_IOC_DETACH _IOW(RTNET_IOC_TYPE_RTMAC_TDMA, 5, struct tdma_config)
80 
81 #endif /* __TDMA_CHRDEV_H_ */