Xenomai 3.3.2
Loading...
Searching...
No Matches
tdma_proto.h
1/***
2 *
3 * include/rtmac/tdma/tdma_proto.h
4 *
5 * RTmac - real-time networking media access control subsystem
6 * Copyright (C) 2002 Marc Kleine-Budde <kleine-budde@gmx.de>,
7 * 2003, 2004 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_PROTO_H_
26#define __TDMA_PROTO_H_
27
28#include <rtdev.h>
29
30#include <rtmac/tdma/tdma.h>
31
32#define TDMA_FRM_VERSION 0x0201
33
34#define TDMA_FRM_SYNC 0x0000
35#define TDMA_FRM_REQ_CAL 0x0010
36#define TDMA_FRM_RPL_CAL 0x0011
37
38struct tdma_frm_head {
39 u16 version;
40 u16 id;
41} __attribute__((packed));
42
43#define SYNC_FRM(head) ((struct tdma_frm_sync *)(head))
44
45struct tdma_frm_sync {
46 struct tdma_frm_head head;
47 u32 cycle_no;
48 u64 xmit_stamp;
49 u64 sched_xmit_stamp;
50} __attribute__((packed));
51
52#define REQ_CAL_FRM(head) ((struct tdma_frm_req_cal *)(head))
53
54struct tdma_frm_req_cal {
55 struct tdma_frm_head head;
56 u64 xmit_stamp;
57 u32 reply_cycle;
58 u64 reply_slot_offset;
59} __attribute__((packed));
60
61#define RPL_CAL_FRM(head) ((struct tdma_frm_rpl_cal *)(head))
62
63struct tdma_frm_rpl_cal {
64 struct tdma_frm_head head;
65 u64 request_xmit_stamp;
66 u64 reception_stamp;
67 u64 xmit_stamp;
68} __attribute__((packed));
69
70void tdma_xmit_sync_frame(struct tdma_priv *tdma);
71int tdma_xmit_request_cal_frame(struct tdma_priv *tdma, u32 reply_cycle,
72 u64 reply_slot_offset);
73
74int tdma_rt_packet_tx(struct rtskb *rtskb, struct rtnet_device *rtdev);
75int tdma_nrt_packet_tx(struct rtskb *rtskb);
76
77int tdma_packet_rx(struct rtskb *rtskb);
78
79unsigned int tdma_get_mtu(struct rtnet_device *rtdev, unsigned int priority);
80
81#endif /* __TDMA_PROTO_H_ */