4 * @brief global data used from different modules in frescan
15 * In frescan_data module we store global data to FRESCAN to make the protocol
16 * easier and efficient to implement.
20 * See MaRTE OS license
24 #include "frescan_data.h"
25 #include "frescan_debug.h"
27 frescan_network_data_t the_networks[FRESCAN_MX_NETWORKS];
28 frescan_server_data_t the_servers_pool[FRESCAN_MX_NETWORKS][FRESCAN_MX_IDS];
29 freelist_t the_servers_pool_freelist[FRESCAN_MX_NETWORKS];
30 frescan_server_data_t the_active_servers[FRESCAN_MX_NETWORKS];
33 * frescan_data_init() - init the data global variables
37 int frescan_data_init(int fd, frescan_init_params_t *params)
42 the_networks[params->net].fd = fd;
43 the_networks[params->net].local_node = params->node;
44 the_networks[params->net].last_packet = NULL;
45 the_networks[params->net].last_packet_prio = 0;
47 FRESCAN_CREATE_LOCK(&the_networks[params->net].lock);
49 for(id=0; id<FRESCAN_MX_IDS; id++) {
50 the_networks[params->net].id_queues[id] = NULL;
53 for(prio=0; prio<FRESCAN_MX_PRIOS; prio++) {
54 the_networks[params->net].id_fp_queues[prio] = NULL;