DEBUG(FRESCAN_SENT_HOOK_ENABLE_DEBUG,
"calling frame_sent + program repl for id:%u\n", id);
- ret = frescan_replenishment_program(chip->minor, id);
+ ret = frescan_replenishment_program(chip->minor,
+ id,
+ &packet->timestamp);
if (ret != 0) {
ERROR("could not program replenishment\n");
return -1;
#ifndef _MARTE_FRESCAN_PACKETS_H_
#define _MARTE_FRESCAN_PACKETS_H_
+#include <time.h> // struct timespec
#include <stdint.h> // uint8_t ...
#include "frescan.h" // frescan_flags_t
#include <misc/linux_list.h> // struct list_head
* @buffer_head: pointer to first byte of the buffer that is going to be sent
* @buffer_read_pointer: pointer to the part of the buffer being read
* @buffer_pending_bytes: bytes waiting to be sent
+ * @timestamp: time when the packet was enqueued (activation time)
* @pool_pos: position in the packets pool to know how to free it
*
* NOTE: the buffers could also be used on the receiving part to support
uint8_t *buffer_head; // only for sending packets
uint8_t *buffer_read_pointer; // only for sending packets
uint32_t buffer_pending_bytes; // only for sending packets
+ struct timespec timestamp;
int pool_pos;
} frescan_packet_t;
*/
#include <stdlib.h>
+#include <time.h>
#include "frescan_queues.h"
#include "frescan_packets.h"
{
DEBUG(FRESCAN_SERVERS_ENABLE_DEBUG, "enqueue packet for id:%u\n", id);
+ clock_gettime (CLOCK_MONOTONIC, &packet->timestamp);
+
// add the packet to the server fifo list
list_add_tail(&packet->fifo_list,
&the_servers_pool[net][id].packet_list.fifo_list);
*/
int frescan_replenishment_program(frescan_network_t net,
- frescan_ss_t ss)
+ frescan_ss_t ss,
+ const struct timespec *timestamp)
{
int ret;
frescan_repl_op_t *repl;
return -1;
}
- clock_gettime (CLOCK_MONOTONIC, &repl->when);
+ repl->when = *timestamp;
incr_timespec (&repl->when, &server->params.values.period);
repl->amount = 1;
#ifndef _MARTE_FRESCAN_SERVERS_REPLENISHMENTS_H_
#define _MARTE_FRESCAN_SERVERS_REPLENISHMENTS_H_
+#include <time.h>
#include "frescan.h" // frescan_network_t
/**
*/
extern int frescan_replenishment_program(frescan_network_t net,
- frescan_ss_t ss);
+ frescan_ss_t ss,
+ const struct timespec *timestamp);
#endif // _MARTE_FRESCAN_SERVERS_REPLENISHMENTS_H_