Xenomai 3.3.2
Loading...
Searching...
No Matches
net.h
1/***
2 *
3 * RTnet - real-time networking subsystem
4 * Copyright (C) 2005-2011 Jan Kiszka <jan.kiszka@web.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * As a special exception to the GNU General Public license, the RTnet
21 * project allows you to use this header file in unmodified form to produce
22 * application programs executing in user-space which use RTnet services by
23 * normal system calls. The resulting executable will not be covered by the
24 * GNU General Public License merely as a result of this header file use.
25 * Instead, this header file use will be considered normal use of RTnet and
26 * not a "derived work" in the sense of the GNU General Public License.
27 *
28 * This exception does not apply when the application code is built as a
29 * static or dynamically loadable portion of the Linux kernel nor does the
30 * exception override other reasons justifying application of the GNU General
31 * Public License.
32 *
33 * This exception applies only to the code released by the RTnet project
34 * under the name RTnet and bearing this exception notice. If you copy code
35 * from other sources into a copy of RTnet, the exception does not apply to
36 * the code that you add in this way.
37 *
38 */
39
40#ifndef _RTDM_UAPI_NET_H
41#define _RTDM_UAPI_NET_H
42
43/* sub-classes: RTDM_CLASS_NETWORK */
44#define RTDM_SUBCLASS_RTNET 0
45
46#define RTIOC_TYPE_NETWORK RTDM_CLASS_NETWORK
47
48/* RTnet-specific IOCTLs */
49#define RTNET_RTIOC_XMITPARAMS _IOW(RTIOC_TYPE_NETWORK, 0x10, unsigned int)
50#define RTNET_RTIOC_PRIORITY RTNET_RTIOC_XMITPARAMS /* legacy */
51#define RTNET_RTIOC_TIMEOUT _IOW(RTIOC_TYPE_NETWORK, 0x11, int64_t)
52/* RTNET_RTIOC_CALLBACK _IOW(RTIOC_TYPE_NETWORK, 0x12, ...
53 * IOCTL only usable inside the kernel. */
54/* RTNET_RTIOC_NONBLOCK _IOW(RTIOC_TYPE_NETWORK, 0x13, unsigned int)
55 * This IOCTL is no longer supported (and it was buggy anyway).
56 * Use RTNET_RTIOC_TIMEOUT with any negative timeout value instead. */
57#define RTNET_RTIOC_EXTPOOL _IOW(RTIOC_TYPE_NETWORK, 0x14, unsigned int)
58#define RTNET_RTIOC_SHRPOOL _IOW(RTIOC_TYPE_NETWORK, 0x15, unsigned int)
59
60/* socket transmission priorities */
61#define SOCK_MAX_PRIO 0
62#define SOCK_DEF_PRIO SOCK_MAX_PRIO + \
63 (SOCK_MIN_PRIO-SOCK_MAX_PRIO+1)/2
64#define SOCK_MIN_PRIO SOCK_NRT_PRIO - 1
65#define SOCK_NRT_PRIO 31
66
67/* socket transmission channels */
68#define SOCK_DEF_RT_CHANNEL 0 /* default rt xmit channel */
69#define SOCK_DEF_NRT_CHANNEL 1 /* default non-rt xmit channel */
70#define SOCK_USER_CHANNEL 2 /* first user-defined channel */
71
72/* argument construction for RTNET_RTIOC_XMITPARAMS */
73#define SOCK_XMIT_PARAMS(priority, channel) ((priority) | ((channel) << 16))
74
75#endif /* !_RTDM_UAPI_NET_H */