2 * @file frecan_config.h
4 * @brief constants to configure the frescan protocol
15 * This module contains some constants and macros to configure the
16 * frescan protocol. For example, the size of the packets pool, etc...
20 //----------------------------------------------------------------------
21 // Copyright (C) 2006 - 2009 by the FRESCOR consortium:
23 // Universidad de Cantabria, SPAIN
24 // University of York, UK
25 // Scuola Superiore Sant'Anna, ITALY
26 // Kaiserslautern University, GERMANY
27 // Univ. Politecnica Valencia, SPAIN
28 // Czech Technical University in Prague, CZECH REPUBLIC
30 // Thales Communication S.A. FRANCE
31 // Visual Tools S.A. SPAIN
32 // Rapita Systems Ltd UK
35 // See http://www.frescor.org
37 // The FRESCOR project (FP6/2005/IST/5-034026) is funded
38 // in part by the European Union Sixth Framework Programme
39 // The European Union is not liable of any use that may be
43 // based on previous work (FSF) done in the FIRST project
45 // Copyright (C) 2005 Mälardalen University, SWEDEN
46 // Scuola Superiore S.Anna, ITALY
47 // Universidad de Cantabria, SPAIN
48 // University of York, UK
50 // This file is part of FNA (Frescor Network Adaptation)
52 // FNA is free software; you can redistribute it and/or modify it
53 // under terms of the GNU General Public License as published by the
54 // Free Software Foundation; either version 2, or (at your option) any
55 // later version. FNA is distributed in the hope that it will be
56 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
57 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
58 // General Public License for more details. You should have received a
59 // copy of the GNU General Public License along with FNA; see file
60 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
61 // Cambridge, MA 02139, USA.
63 // As a special exception, including FNA header files in a file,
64 // instantiating FNA generics or templates, or linking other files
65 // with FNA objects to produce an executable application, does not
66 // by itself cause the resulting executable application to be covered
67 // by the GNU General Public License. This exception does not
68 // however invalidate any other reasons why the executable file might be
69 // covered by the GNU Public License.
70 // -----------------------------------------------------------------------
74 #ifndef _MARTE_FRESCAN_CONFIG_H_
75 #define _MARTE_FRESCAN_CONFIG_H_
77 #include "fosa_threads_and_signals.h" // FOSA_SIGNAL_MIN
78 #include <sys/kernel.h> // kernel_enter_critic_section
80 #define FRESCAN_MX_PACKETS 200
81 #define FRESCAN_MX_NETWORKS 2
82 #define FRESCAN_BROADCAST_ADDR 0xF
83 #define FRESCAN_MX_IDS 255
84 #define FRESCAN_MX_PRIOS 32
85 #define FRESCAN_BACKGROUND_PRIO 0
86 #define FRESCAN_REPL_SIGNAL_NUM FOSA_SIGNAL_MIN + 10 // real-time signal
87 #define FRESCAN_REPL_THREAD_PRIO 60
88 #define FRESCAN_MX_NODES 4
89 #define FRESCAN_MX_REPL_OPS FRESCAN_MX_IDS*10
91 // Configuration values for FRESCAN_BWRES
92 #define FRESCAN_BWRES_MX_REPLY_OBJECTS 40
93 #define FRESCAN_BWRES_MX_REQUESTS 40
94 #define FRESCAN_BWRES_MASTER_NODE 0
95 #define FRESCAN_BWRES_ROBJS_MX_CEILING 90
96 #define FRESCAN_BWRES_REQ_MX_CEILING 90
97 #define FRESCAN_BWRES_MX_PRIO 60
98 #define FRESCAN_BWRES_NEG_THREAD_PRIO 50
99 #define FRESCAN_BWRES_ACCEPTOR_PRIO FRESCAN_BWRES_NEG_THREAD_PRIO - 1
100 #define FRESCAN_BWRES_NEG_MSG_PRIO 4
101 #define FRESCAN_BWRES_NEG_MSG_BUDGET 5 // packets
102 #define FRESCAN_BWRES_NEG_MSG_PERIOD 1000000 // us
103 #define FRESCAN_BWRES_NEG_MSG_CHAN 0
104 #define FRESCAN_BWRES_MX_CONTRACTS (FRESCAN_MX_NODES*FRESCAN_MX_IDS)
105 #define FRESCAN_BWRES_MAX_GROUP_OPS 5
106 #define FRESCAN_BWRES_SS_MIN_PRIO 1
107 #define FRESCAN_BWRES_SS_MAX_PRIO FRESCAN_MX_PRIOS
109 // Configuration values for FRESCAN_BWRES_FNA
110 #define FRESCAN_BWRES_FNA_NET_BASE 0
111 #define FRESCAN_BWRES_FNA_LOCAL_NODE 3
112 #define FRESCAN_BWRES_TX_FP_MX_PRIO 10
113 #define FRESCAN_BWRES_RX_NUM_CHANNELS 10
114 #define FRESCAN_BWRES_RX_CHAN_MX_PRIO NULL
116 // FRESCAN_FRAME_TX_TIME_US: measured transmission time of an 8byte frame
117 #define FRESCAN_FRAME_TX_TIME_US 200
119 #define FRESCAN_MLOCK_T unsigned
120 #define FRESCAN_CREATE_LOCK(l)
121 #define FRESCAN_DESTROY_LOCK(l)
122 #define FRESCAN_ACQUIRE_LOCK(l) kernel_enter_critic_section(l)
123 #define FRESCAN_RELEASE_LOCK(l) kernel_leave_critic_section(*(l))
125 #endif // _MARTE_FRESCAN_CONFIG_H_