]> rtime.felk.cvut.cz Git - frescor/fna.git/blobdiff - src_frescan/frescan.h
add group negotiations to frescan and change all the requests and messages to map...
[frescor/fna.git] / src_frescan / frescan.h
index 57676af66645dc4583ffb0bd90841d68e0c6a8dd..e2f59dab34dfb1072249a1b2abf1734a19d1ec4c 100644 (file)
  *
  */
 
-#ifndef _MARTE_FRESCAN_H_
-#define _MARTE_FRESCAN_H_
+#ifndef _FRESCAN_H_
+#define _FRESCAN_H_
 
-#include <stdint.h>  // uint8_t
-#include <stdbool.h> // bool
-#include <unistd.h>  // size_t
-
-typedef uint8_t frescan_network_t;
-typedef uint8_t frescan_node_t;
-typedef uint8_t frescan_channel_t;
-typedef uint8_t frescan_prio_t;
-typedef uint8_t frescan_ss_t;
-typedef uint32_t frescan_budget_t;
-
-/**
- * frescan_flags_t - frescan flags
- *
- * @FRESCAN_SS: send the message using sporadic servers
- * @FRESCAN_FP: send the message using fixed priorities
- * @FRESCAN_POLL: no buffer copy, only pointer and use the ID to poll status
- * @FRESCAN_SYNC: no buffer copy, only pointer and block until it is sent
- * @FRESCAN_ASYNC: use buffer copy and return immediately
- */
-
-typedef enum {
-        FRESCAN_SS    = 1<<4,  // sporadic server
-        FRESCAN_FP    = 1<<3,  // fixed priorities
-        FRESCAN_POLL  = 1<<2,  // polling
-        FRESCAN_SYNC  = 1<<1,  // synchronous
-        FRESCAN_ASYNC = 1      // asynchronous
-} frescan_flags_t;
-
-/**
- * frescan_send_params_t - send parameters
- *
- * @net: the network to use
- * @to: the node where the message shoud be sent to
- * @channel: the channel in 'to' where the message shoud be sent to
- * @flags: the flags (see frescan_flags_t)
- * @prio: the priority for the message if (flags & FRESCAN_FP)
- * @ss: the sporadic server for the message if (flags & FRESCAN_SS)
- */
-
-typedef struct {
-        frescan_network_t net;
-        frescan_node_t to;
-        frescan_channel_t channel;
-        frescan_flags_t flags;
-        union {
-                frescan_prio_t prio;
-                frescan_ss_t ss;
-        };
-} frescan_send_params_t;
-
-/**
- * frescan_recv_params_t - receive parameters
- *
- * @net: the network to use
- * @channel: the channel from which we want to extract a message
- * @flags: FRESCAN_SYNC/ASYNC
- */
-
-typedef struct {
-        frescan_network_t net;
-        frescan_channel_t channel;
-        frescan_flags_t flags;
-} frescan_recv_params_t;
-
-/**
- * frescan_init_params_t - initialization parameters
- *
- * @net: network to initialize (minor number ie: /dev/can0 -> 0)
- * @node: set the local node identificator
- * @tx_fp_max_prio: maximum number of priorities for the fixed priority
- *                  transmission queues. (prio = 0 .. max_prio - 1)
- * @rx_num_of_channels: number of rx channels (0 .. rx_num_of_channels - 1)
- * @rx_channel_max_prio: array (range rx_num_of_channels) saying the number
- *                       of priorities for each channel. If this parameter is
- *                       NULL tx_fp_max_prio will be used for all queues.
- */
-
-typedef struct {
-        frescan_network_t net;
-        frescan_node_t node;
-        uint32_t tx_fp_max_prio;
-        uint32_t rx_num_of_channels;
-        uint32_t *rx_channel_max_prio;
-} frescan_init_params_t;
+#include "frescan_types.h"
 
 /**
  * frescan_init - initializes the network and the internal structures
@@ -199,4 +115,4 @@ int frescan_recv(const frescan_recv_params_t *params,
                  frescan_node_t *from,
                  frescan_prio_t *prio);
 
-#endif // _MARTE_FRESCAN_H_
+#endif // _FRESCAN_H_