Xenomai 3.3.2
Loading...
Searching...
No Matches
rtmac_disc.h
1/***
2 *
3 * include/rtmac/rtmac_disc.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 __RTMAC_DISC_H_
26#define __RTMAC_DISC_H_
27
28#include <linux/list.h>
29#include <linux/netdevice.h>
30
31#include <rtdev.h>
32#include <rtnet_chrdev.h>
33
34#define RTMAC_NO_VNIC NULL
35#define RTMAC_DEFAULT_VNIC rtmac_vnic_xmit
36
37typedef int (*vnic_xmit_handler)(struct sk_buff *skb, struct net_device *dev);
38
39struct rtmac_priv {
40 int (*orig_start_xmit)(struct rtskb *skb, struct rtnet_device *dev);
41 struct net_device *vnic;
42 struct net_device_stats vnic_stats;
43 struct rtskb_pool vnic_skb_pool;
44 unsigned int vnic_max_mtu;
45
46 u8 disc_priv[0] __attribute__((aligned(16)));
47};
48
49struct rtmac_proc_entry {
50 const char *name;
51 int (*handler)(struct xnvfile_regular_iterator *it, void *data);
52 struct xnvfile_regular vfile;
53};
54
55struct rtmac_disc {
56 struct list_head list;
57
58 const char *name;
59 unsigned int priv_size; /* size of rtmac_priv.disc_priv */
60 u16 disc_type;
61
62 int (*packet_rx)(struct rtskb *skb);
63 /* rt_packet_tx prototype must be compatible with hard_start_xmit */
64 int (*rt_packet_tx)(struct rtskb *skb, struct rtnet_device *dev);
65 int (*nrt_packet_tx)(struct rtskb *skb);
66
67 unsigned int (*get_mtu)(struct rtnet_device *rtdev,
68 unsigned int priority);
69
70 vnic_xmit_handler vnic_xmit;
71
72 int (*attach)(struct rtnet_device *rtdev, void *disc_priv);
73 int (*detach)(struct rtnet_device *rtdev, void *disc_priv);
74
75 struct rtnet_ioctls ioctls;
76
77 struct rtmac_proc_entry *proc_entries;
78 unsigned nr_proc_entries;
79
80 struct module *owner;
81};
82
83int rtmac_disc_attach(struct rtnet_device *rtdev, struct rtmac_disc *disc);
84int rtmac_disc_detach(struct rtnet_device *rtdev);
85
86int __rtmac_disc_register(struct rtmac_disc *disc, struct module *module);
87#define rtmac_disc_register(disc) __rtmac_disc_register(disc, THIS_MODULE)
88
89void rtmac_disc_deregister(struct rtmac_disc *disc);
90
91#ifdef CONFIG_XENO_OPT_VFILE
92int rtnet_rtmac_disciplines_show(struct xnvfile_regular_iterator *it, void *d);
93#endif /* CONFIG_XENO_OPT_VFILE */
94
95#endif /* __RTMAC_DISC_H_ */
Regular vfile iterator .
Definition vfile.h:270