]> rtime.felk.cvut.cz Git - frescor/fna.git/blobdiff - src_rtep/rtep_fna_c.c
restore the configuration flags and add a CONNECTED flag
[frescor/fna.git] / src_rtep / rtep_fna_c.c
index 913ac843115462d28041928b5e713888ae89e323..a208a9afa70d0cc00b5b27f6e739caf7edc5699f 100644 (file)
@@ -67,8 +67,7 @@
 #include "rtep.h" // for rtep_adainit, rtep_valid_multicast_id, ..
 #include "rtep_bandwith_reservation.h" // for rtep_bwres_*
 #include "rtep_fna.h" // function prototypes
-
-#include "frsh_freelist.h"
+#include "fadt_freelist.h"
 
 #if 0
 #include <stdio.h>
@@ -79,7 +78,7 @@
 
 // TODO: add a mutex for concurrent access if necessary
 static rtep_bwres_vres_t rtep_vres_list[MAX_N_RTEP_BWRES_VRES];
-static frsh_freelist_t rtep_vres_freelist;
+static fadt_freelist_t rtep_vres_freelist;
 
 //////////////////////////////////////////////////////////////////////
 //           INITIALIZATION
@@ -114,7 +113,7 @@ int rtep_fna_init(const frsh_resource_id_t resource_id)
         DEBUG("calling freelist_init\n");
 
         // initialize the freelist to handle the rtep_vres
-        err = frsh_freelist_init(&rtep_vres_freelist, MAX_N_RTEP_BWRES_VRES);
+        err = fadt_freelist_init(&rtep_vres_freelist, NULL, MAX_N_RTEP_BWRES_VRES);
         if (err != 0) return -1;
 
         DEBUG("calling rtep_bwres_init\n");
@@ -178,7 +177,7 @@ int rtep_fna_contract_negotiate
         rtep_contract.budget_min = contract->budget_min.tv_sec;
 
         // allocate a free internal vres.
-        pos = frsh_freelist_alloc(&rtep_vres_freelist);
+        pos = fadt_freelist_alloc(&rtep_vres_freelist);
 
         if (pos < 0) {
                 DEBUG("not enough resources\n");
@@ -196,7 +195,7 @@ int rtep_fna_contract_negotiate
                 *vres = (fna_vres_id_t)pos;
         } else {
                 DEBUG("contract not accepted\n");
-                frsh_freelist_free(&rtep_vres_freelist, pos);
+                fadt_freelist_free(&rtep_vres_freelist, pos);
         }
 
         return accepted;
@@ -378,7 +377,7 @@ int rtep_fna_vres_destroy
         if (err != 0) return -1;
 
         // free the element in the rtep_vres list
-        err = frsh_freelist_free(&rtep_vres_freelist, pos);
+        err = fadt_freelist_free(&rtep_vres_freelist, pos);
         if (err != 0) return -1;
 
         return 0;
@@ -965,10 +964,10 @@ int rtep_fna_network_bytes_to_budget
                 return -1;
         }
 
-   // we measure the budget in number of RTEP packets of maximum size
+        // we measure the budget in number of RTEP packets of maximum size
         number_of_packets = nbytes / MAX_RTEP_MTU + 1;
-   // we store the budget in number of packets instead of in time. We
-   // use a field in the timespec structure.
+        // we store the budget in number of packets instead of in time. We
+        // use a field in the timespec structure.
         budget->tv_sec = number_of_packets;
         DEBUG("bytes: %d -> budget: %d\n", nbytes, budget->tv_sec);
         return 0;
@@ -1051,6 +1050,7 @@ int rtep_fna_network_get_min_eff_budget
 // GLOBAL variable to install the network protocol in FRESCOR
 
 fna_operations_t rtep_fna_operations = {
+#ifdef CONFIG_FNA_RTEP_CONNECTED
         .fna_init = rtep_fna_init,
         .fna_contract_negotiate = rtep_fna_contract_negotiate,
         .fna_contract_renegotiate_sync = rtep_fna_contract_renegotiate_sync,
@@ -1071,6 +1071,7 @@ fna_operations_t rtep_fna_operations = {
         .fna_send_endpoint_get_status = rtep_fna_send_endpoint_get_status,
         .fna_receive_endpoint_created = rtep_fna_receive_endpoint_created,
         .fna_receive_endpoint_get_status = rtep_fna_receive_endpoint_get_status,
+#endif
         .fna_network_get_max_message_size = rtep_fna_network_get_max_message_size,
         .fna_network_bytes_to_budget = rtep_fna_network_bytes_to_budget,
         .fna_network_budget_to_bytes = rtep_fna_network_budget_to_bytes,