Commit ce26863b authored by Federico Vaga's avatar Federico Vaga

rename: functions and variables

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>


NOTE
This commit has been created by `git subtree` on the Mock Turtle repository
on tag mock-turtle-2.0

This commit will not compile
parent 391cc7a1
......@@ -342,8 +342,8 @@ struct wrtd_in_channel_config {
public, set from the internal
calibration data of the TDC
driver. */
uint32_t flags; /**< Channel flags (enum wrnc_io_flags) */
uint32_t log_level; /**< Log level (enum wrnc_log_level) */
uint32_t flags; /**< Channel flags (enum trtl_io_flags) */
uint32_t log_level; /**< Log level (enum trtl_log_level) */
uint32_t mode; /**< Triggering mode (enum wrtd_triger_mode) */
};
......
......@@ -23,7 +23,7 @@
#include "rt-message.h"
#endif
static inline int _wrnc_msg_check_buffer( struct wrnc_msg *buf, int n_words )
static inline int _trtl_msg_check_buffer( struct trtl_msg *buf, int n_words )
{
#ifndef WRNODE_RT
if(buf->error)
......@@ -51,9 +51,9 @@ static inline int _wrnc_msg_check_buffer( struct wrnc_msg *buf, int n_words )
return 0;
}
static inline int wrnc_msg_int32 ( struct wrnc_msg *buf, int *value )
static inline int trtl_msg_int32 ( struct trtl_msg *buf, int *value )
{
if ( _wrnc_msg_check_buffer ( buf, 1 ) < 0 )
if ( _trtl_msg_check_buffer ( buf, 1 ) < 0 )
return -1;
if (buf->direction == WRNC_MSG_DIR_SEND)
......@@ -69,9 +69,9 @@ static inline int wrnc_msg_int32 ( struct wrnc_msg *buf, int *value )
}
static inline int wrnc_msg_int16 ( struct wrnc_msg *buf, int16_t *value )
static inline int trtl_msg_int16 ( struct trtl_msg *buf, int16_t *value )
{
if ( _wrnc_msg_check_buffer ( buf, 1 ) < 0 )
if ( _trtl_msg_check_buffer ( buf, 1 ) < 0 )
return -1;
if (buf->direction == WRNC_MSG_DIR_SEND)
......@@ -86,20 +86,20 @@ static inline int wrnc_msg_int16 ( struct wrnc_msg *buf, int16_t *value )
return 0;
}
static inline int wrnc_msg_uint32 ( struct wrnc_msg *buf, uint32_t *value )
static inline int trtl_msg_uint32 ( struct trtl_msg *buf, uint32_t *value )
{
return wrnc_msg_int32( buf, (int *) value);
return trtl_msg_int32( buf, (int *) value);
}
static inline int wrnc_msg_uint16 ( struct wrnc_msg *buf, uint16_t *value )
static inline int trtl_msg_uint16 ( struct trtl_msg *buf, uint16_t *value )
{
return wrnc_msg_int16( buf, (int16_t *) value);
return trtl_msg_int16( buf, (int16_t *) value);
}
static inline int wrnc_msg_header ( struct wrnc_msg *buf, uint32_t *id, uint32_t *seq_no )
static inline int trtl_msg_header ( struct trtl_msg *buf, uint32_t *id, uint32_t *seq_no )
{
if (_wrnc_msg_check_buffer ( buf, 2 ) < 0)
if (_trtl_msg_check_buffer ( buf, 2 ) < 0)
return -1;
if (buf->direction == WRNC_MSG_DIR_SEND)
......@@ -116,24 +116,24 @@ static inline int wrnc_msg_header ( struct wrnc_msg *buf, uint32_t *id, uint32_t
return 0;
}
static inline void wrnc_msg_skip ( struct wrnc_msg *buf, int n_words )
static inline void trtl_msg_skip ( struct trtl_msg *buf, int n_words )
{
_wrnc_msg_check_buffer ( buf, n_words );
_trtl_msg_check_buffer ( buf, n_words );
if (buf->direction == WRNC_MSG_DIR_SEND)
buf->datalen += n_words;
else
buf->offset += n_words;
}
static inline void wrnc_msg_seek ( struct wrnc_msg *buf, int pos )
static inline void trtl_msg_seek ( struct trtl_msg *buf, int pos )
{
buf->offset = pos;
buf->datalen = pos;
}
static inline int wrtd_msg_timestamp ( struct wrnc_msg *buf, struct wr_timestamp *ts )
static inline int wrtd_msg_timestamp ( struct trtl_msg *buf, struct wr_timestamp *ts )
{
if (_wrnc_msg_check_buffer ( buf, 4 ) < 0)
if (_trtl_msg_check_buffer ( buf, 4 ) < 0)
return -1;
if (buf->direction == WRNC_MSG_DIR_SEND)
......@@ -154,9 +154,9 @@ static inline int wrtd_msg_timestamp ( struct wrnc_msg *buf, struct wr_timestamp
return 0;
}
static inline int wrtd_msg_trig_id ( struct wrnc_msg *buf, struct wrtd_trig_id *id )
static inline int wrtd_msg_trig_id ( struct trtl_msg *buf, struct wrtd_trig_id *id )
{
if (_wrnc_msg_check_buffer ( buf, 3 ) < 0)
if (_trtl_msg_check_buffer ( buf, 3 ) < 0)
return -1;
if (buf->direction == WRNC_MSG_DIR_SEND)
......@@ -175,19 +175,19 @@ static inline int wrtd_msg_trig_id ( struct wrnc_msg *buf, struct wrtd_trig_id *
return 0;
}
static inline int wrtd_msg_trigger_entry ( struct wrnc_msg *buf, struct wrtd_trigger_entry *ent )
static inline int wrtd_msg_trigger_entry ( struct trtl_msg *buf, struct wrtd_trigger_entry *ent )
{
if (wrtd_msg_timestamp (buf, &ent->ts) < 0)
return -1;
if (wrtd_msg_trig_id (buf, &ent->id) < 0)
return -1;
return wrnc_msg_int32 (buf, (int *) &ent->seq);
return trtl_msg_int32 (buf, (int *) &ent->seq);
}
static inline struct wrnc_msg wrnc_msg_init(int max_size)
static inline struct trtl_msg trtl_msg_init(int max_size)
{
struct wrnc_msg b;
struct trtl_msg b;
b.direction = WRNC_MSG_DIR_SEND;
b.max_size = max_size;
......@@ -198,7 +198,7 @@ static inline struct wrnc_msg wrnc_msg_init(int max_size)
return b;
}
static inline int wrnc_msg_check_error (struct wrnc_msg *buf)
static inline int trtl_msg_check_error (struct trtl_msg *buf)
{
return buf->error;
}
......
......@@ -39,14 +39,14 @@ const char *wrtd_errors[] = {
/**
* It returns a string messages corresponding to a given error code. If
* it is not a libwrtd error code, it will run wrnc_strerror()
* it is not a libwrtd error code, it will run trtl_strerror()
* @param[in] err error code
* @return a message error
*/
const char *wrtd_strerror(int err)
{
if (err < EWRTD_INVALID_ANSWER_ACK || err >= __EWRTD_MAX_ERROR_NUMBER)
return wrnc_strerror(err);
return trtl_strerror(err);
return wrtd_errors[err - EWRTD_INVALID_ANSWER_ACK];
}
......@@ -57,15 +57,15 @@ const char *wrtd_strerror(int err)
* anything else. If you are going to load/unload WRTD devices, then
* you have to un-load (wrtd_exit()) e reload (wrtd_init()) the library.
*
* This library is based on the libwrnc, so internally, this function also
* run wrnc_init() in order to initialize the WRNC library.
* This library is based on the libmockturtle, so internally, this function also
* run trtl_init() in order to initialize the WRNC library.
* @return 0 on success, otherwise -1 and errno is appropriately set
*/
int wrtd_init()
{
int err;
err = wrnc_init();
err = trtl_init();
if (err)
return err;
......@@ -80,7 +80,7 @@ int wrtd_init()
*/
void wrtd_exit()
{
wrnc_exit();
trtl_exit();
}
......@@ -93,7 +93,7 @@ void wrtd_exit()
*/
int wrtd_version_is_valid(struct wrtd_node *dev)
{
struct wrnc_rt_version version;
struct trtl_rt_version version;
int err;
errno = 0;
......@@ -127,21 +127,21 @@ static struct wrtd_node *wrtd_open(uint32_t device_id, unsigned int is_lun)
return NULL;
if (is_lun)
wrtd->wrnc = wrnc_open_by_lun(device_id);
wrtd->trtl = trtl_open_by_lun(device_id);
else
wrtd->wrnc = wrnc_open_by_fmc(device_id);
if (!wrtd->wrnc)
wrtd->trtl = trtl_open_by_fmc(device_id);
if (!wrtd->trtl)
goto out;
wrtd->dev_id = device_id;
/* Logging interface is always in share mode */
err = wrnc_hmq_share_set(wrtd->wrnc, WRNC_HMQ_OUTCOMING,
err = trtl_hmq_share_set(wrtd->trtl, TRTL_HMQ_OUTCOMING,
WRTD_OUT_FD_LOGGING, 1);
if (err)
goto out;
err = wrnc_hmq_share_set(wrtd->wrnc, WRNC_HMQ_OUTCOMING,
err = trtl_hmq_share_set(wrtd->trtl, TRTL_HMQ_OUTCOMING,
WRTD_OUT_TDC_LOGGING, 1);
if (err)
goto out;
......@@ -187,7 +187,7 @@ void wrtd_close(struct wrtd_node *dev)
{
struct wrtd_desc *wrtd = (struct wrtd_desc *)dev;
wrnc_close(wrtd->wrnc);
trtl_close(wrtd->trtl);
free(wrtd);
dev = NULL;
}
......@@ -199,11 +199,11 @@ void wrtd_close(struct wrtd_node *dev)
* @param[in] dev device token
* @return the WRNC token
*/
struct wrnc_dev *wrtd_get_wrnc_dev(struct wrtd_node *dev)
struct trtl_dev *wrtd_get_trtl_dev(struct wrtd_node *dev)
{
struct wrtd_desc *wrtd = (struct wrtd_desc *)dev;
return (struct wrnc_dev *)wrtd->wrnc;
return (struct trtl_dev *)wrtd->trtl;
}
......@@ -217,16 +217,16 @@ int wrtd_cpu_restart(struct wrtd_node *dev)
struct wrtd_desc *wrtd = (struct wrtd_desc *)dev;
int err;
err = wrnc_cpu_disable(wrtd->wrnc,WRTD_CPU_TDC);
err = trtl_cpu_disable(wrtd->trtl,WRTD_CPU_TDC);
if (err)
return err;
err = wrnc_cpu_disable(wrtd->wrnc,WRTD_CPU_FD);
err = trtl_cpu_disable(wrtd->trtl,WRTD_CPU_FD);
if (err)
return err;
err = wrnc_cpu_enable(wrtd->wrnc,WRTD_CPU_TDC);
err = trtl_cpu_enable(wrtd->trtl,WRTD_CPU_TDC);
if (err)
return err;
return wrnc_cpu_enable(wrtd->wrnc,WRTD_CPU_FD);
return trtl_cpu_enable(wrtd->trtl,WRTD_CPU_FD);
}
/**
......@@ -246,26 +246,26 @@ int wrtd_load_application(struct wrtd_node *dev, char *rt_tdc,
errno = EWRTD_INVALID_BINARY;
return -1;
}
err = wrnc_cpu_reset_get(wrtd->wrnc, &reg_old);
err = trtl_cpu_reset_get(wrtd->trtl, &reg_old);
if (err)
return err;
/* Keep the CPUs in reset state */
err = wrnc_cpu_reset_set(wrtd->wrnc,
err = trtl_cpu_reset_set(wrtd->trtl,
(1 << WRTD_CPU_TDC) | (1 << WRTD_CPU_FD));
if (err)
return err;
/* Program CPUs application */
err = wrnc_cpu_load_application_file(wrtd->wrnc, WRTD_CPU_TDC, rt_tdc);
err = trtl_cpu_load_application_file(wrtd->trtl, WRTD_CPU_TDC, rt_tdc);
if (err)
return err;
err = wrnc_cpu_load_application_file(wrtd->wrnc, WRTD_CPU_FD, rt_fd);
err = trtl_cpu_load_application_file(wrtd->trtl, WRTD_CPU_FD, rt_fd);
if (err)
return err;
/* Re-enable the CPUs */
err = wrnc_cpu_reset_set(wrtd->wrnc, reg_old);
err = trtl_cpu_reset_set(wrtd->trtl, reg_old);
if (err)
return err;
......
This diff is collapsed.
......@@ -17,7 +17,7 @@
* @param[in] msg message to validate
* @return 0 if it is valid, -1 otherwise and errno is appropriately set
*/
int wrtd_validate_acknowledge(struct wrnc_msg *msg)
int wrtd_validate_acknowledge(struct trtl_msg *msg)
{
if (msg->datalen != 2 || msg->data[0] != WRTD_REP_ACK_ID) {
errno = EWRTD_INVALID_ANSWER_ACK;
......@@ -59,24 +59,24 @@ int wrtd_trig_id_cmp(struct wrtd_trig_id *id1, struct wrtd_trig_id *id2)
* Internal helper to send and receive synchronous messages to/from the WRNC
*/
int wrtd_send_and_receive_sync(struct wrtd_desc *wrtd,
struct wrnc_msg *msg,
struct trtl_msg *msg,
enum wrtd_core core)
{
/* Send the message and get answer */
struct wrnc_hmq *hmq;
struct trtl_hmq *hmq;
unsigned int hmq_send = core ? WRTD_IN_FD_CONTROL : WRTD_IN_TDC_CONTROL;
unsigned int hmq_recv = core ? WRTD_OUT_FD_CONTROL :
WRTD_OUT_TDC_CONTROL;
int err;
hmq = wrnc_hmq_open(wrtd->wrnc, hmq_send, WRNC_HMQ_INCOMING);
hmq = trtl_hmq_open(wrtd->trtl, hmq_send, TRTL_HMQ_INCOMING);
if (!hmq)
return -1;
err = wrnc_hmq_send_and_receive_sync(hmq, hmq_recv, msg,
err = trtl_hmq_send_and_receive_sync(hmq, hmq_recv, msg,
WRTD_DEFAULT_TIMEOUT);
wrnc_hmq_close(hmq);
trtl_hmq_close(hmq);
return err < 0 ? err : 0; /* ignore timeout */
}
......@@ -86,7 +86,7 @@ int wrtd_send_and_receive_sync(struct wrtd_desc *wrtd,
* with an ACK
*/
int wrtd_trivial_request(struct wrtd_node *dev,
struct wrnc_msg *request_msg,
struct trtl_msg *request_msg,
enum wrtd_core core)
{
struct wrtd_desc *wrtd = (struct wrtd_desc *)dev;
......
......@@ -23,7 +23,7 @@
* Description of a White-Rabbit Trigger-Distribution device
*/
struct wrtd_desc {
struct wrnc_dev *wrnc; /**< WRNC device associated */
struct trtl_dev *trtl; /**< WRNC device associated */
uint32_t dev_id; /**< fmc device id */
uint32_t app_id; /**< Application id */
uint32_t n_cpu; /**< Number of CPUs */
......@@ -33,13 +33,13 @@ struct wrtd_desc {
* @file libwrtd-interal.c
*/
void unbag_ts(uint32_t *buf, int offset, struct wr_timestamp *ts);
int wrtd_validate_acknowledge(struct wrnc_msg *msg);
int wrtd_validate_acknowledge(struct trtl_msg *msg);
int wrtd_trig_id_cmp(struct wrtd_trig_id *id1, struct wrtd_trig_id *id2);
extern int wrtd_trivial_request(struct wrtd_node *dev,
struct wrnc_msg *request_msg,
struct trtl_msg *request_msg,
enum wrtd_core core);
extern int wrtd_send_and_receive_sync(struct wrtd_desc *wrtd,
struct wrnc_msg *msg,
struct trtl_msg *msg,
enum wrtd_core core);
extern void wrtd_timestamp_endianess_fix(struct wr_timestamp *ts);
extern void wrtd_output_rule_endianess_fix(struct lrt_output_rule *rule);
......
......@@ -103,18 +103,18 @@ enum wrtd_log_level wrtd_strlogging_to_level(char *log)
* @param[in] core WRTD core to use
* @return a HMQ token on success, NULL on error and errno is set appropriately
*/
static struct wrnc_hmq *wrtd_log_open(struct wrtd_node *dev,
static struct trtl_hmq *wrtd_log_open(struct wrtd_node *dev,
int channel,
enum wrtd_core core)
{
struct wrtd_desc *wrtd = (struct wrtd_desc *)dev;
struct wrnc_msg_filter filter = {
.operation = WRNC_MSG_FILTER_EQ,
struct trtl_msg_filter filter = {
.operation = TRTL_MSG_FILTER_EQ,
.word_offset = 3, /* channel field */
.mask = 0xFFFF, /* entire field */
.value = channel, /* required channel */
};
struct wrnc_hmq *hmq = NULL;
struct trtl_hmq *hmq = NULL;
int err;
int n_chan = core ? FD_NUM_CHANNELS : TDC_NUM_CHANNELS;
unsigned int hmq_back_index = core ? WRTD_OUT_FD_LOGGING :
......@@ -125,7 +125,7 @@ static struct wrnc_hmq *wrtd_log_open(struct wrtd_node *dev,
return NULL;
}
hmq = wrnc_hmq_open(wrtd->wrnc, hmq_back_index, 0);
hmq = trtl_hmq_open(wrtd->trtl, hmq_back_index, 0);
if (!hmq)
return NULL;
......@@ -135,7 +135,7 @@ static struct wrnc_hmq *wrtd_log_open(struct wrtd_node *dev,
filter.word_offset = 6;
}
/* the user want to filter per channel */
err = wrnc_hmq_filter_add(hmq, &filter);
err = trtl_hmq_filter_add(hmq, &filter);
if (err)
goto out_close;
}
......@@ -143,7 +143,7 @@ static struct wrnc_hmq *wrtd_log_open(struct wrtd_node *dev,
return hmq;
out_close:
wrnc_hmq_close(hmq);
trtl_hmq_close(hmq);
return NULL;
}
......@@ -158,12 +158,12 @@ out_close:
* @return number of read messages on success (check errno if it returns less
* messages than expected), -1 on error and errno is set appropriately
*/
int wrtd_log_read(struct wrnc_hmq *hmq_log, struct wrtd_log_entry *log,
int wrtd_log_read(struct trtl_hmq *hmq_log, struct wrtd_log_entry *log,
int count, int poll_timeout)
{
struct wrnc_proto_header hdr;
struct trtl_proto_header hdr;
struct wrtd_log_entry *cur = log;
struct wrnc_msg *msg;
struct trtl_msg *msg;
struct pollfd p;
int remaining = count;
int n_read = 0, ret;
......@@ -182,13 +182,13 @@ int wrtd_log_read(struct wrnc_hmq *hmq_log, struct wrtd_log_entry *log,
if (ret <= 0 || !(p.revents & POLLIN))
break;
msg = wrnc_hmq_receive(hmq_log);
msg = trtl_hmq_receive(hmq_log);
if (!msg)
break;
if (hmq_log->index == WRTD_OUT_FD_LOGGING) {
/* Output */
wrnc_msg_header (msg, &id, &seq);
trtl_msg_header (msg, &id, &seq);
if (id != WRTD_REP_LOG_MESSAGE)
{
......@@ -197,23 +197,23 @@ int wrtd_log_read(struct wrnc_hmq *hmq_log, struct wrtd_log_entry *log,
break;
}
wrnc_msg_uint32 (msg, &cur->type);
wrnc_msg_int32 (msg, &cur->channel);
wrnc_msg_uint32 (msg, &cur->miss_reason);
trtl_msg_uint32 (msg, &cur->type);
trtl_msg_int32 (msg, &cur->channel);
trtl_msg_uint32 (msg, &cur->miss_reason);
wrtd_msg_trigger_entry(msg, &ent);
cur->ts = ent.ts;
cur->seq = ent.seq;
cur->id = ent.id;
if ( wrnc_msg_check_error(msg) ) {
if ( trtl_msg_check_error(msg) ) {
free(msg);
errno = EWRTD_INVALID_ANSWER_STATE;
break;
}
} else {
/* Input */
wrnc_message_unpack(msg, &hdr, cur);
trtl_message_unpack(msg, &hdr, cur);
if (hdr.msg_id != WRTD_IN_ACTION_LOG) {
free(msg);
errno = EWRTD_INVALID_ANSWER_STATE;
......@@ -235,9 +235,9 @@ int wrtd_log_read(struct wrnc_hmq *hmq_log, struct wrtd_log_entry *log,
* It closes the logging interface
* @param[in] hmq HMQ token to close
*/
void wrtd_log_close(struct wrnc_hmq *hmq)
void wrtd_log_close(struct trtl_hmq *hmq)
{
wrnc_hmq_close(hmq);
trtl_hmq_close(hmq);
}
......@@ -251,13 +251,13 @@ static int wrtd_log_level_set(struct wrtd_node *dev, unsigned int channel,
uint32_t log_level, enum wrtd_core core)
{
struct wrtd_desc *wrtd = (struct wrtd_desc *)dev;
struct wrnc_structure_tlv tlv;
struct wrnc_proto_header hdr;
struct trtl_structure_tlv tlv;
struct trtl_proto_header hdr;
struct wrtd_out_channel ochan;
struct wrtd_in_channel ichan;
int err;
hdr.flags = WRNC_PROTO_FLAG_SYNC;
hdr.flags = TRTL_PROTO_FLAG_SYNC;
if (core) {
if (channel >= FD_NUM_CHANNELS) {
errno = EWRTD_INVALID_CHANNEL;
......@@ -282,7 +282,7 @@ static int wrtd_log_level_set(struct wrtd_node *dev, unsigned int channel,
(WRTD_OUT_TDC_CONTROL & 0xF);
}
err = wrnc_rt_structure_get(wrtd->wrnc, &hdr, &tlv, 1);
err = trtl_rt_structure_get(wrtd->trtl, &hdr, &tlv, 1);
if (err)
return err;
......@@ -291,7 +291,7 @@ static int wrtd_log_level_set(struct wrtd_node *dev, unsigned int channel,
else
ichan.config.log_level = log_level;
return wrnc_rt_structure_set(wrtd->wrnc, &hdr, &tlv, 1);
return trtl_rt_structure_set(wrtd->trtl, &hdr, &tlv, 1);
}
......@@ -304,7 +304,7 @@ static int wrtd_log_level_set(struct wrtd_node *dev, unsigned int channel,
* specific one.
* @return a HMQ token on success, NULL on error and errno is set appropriately
*/
struct wrnc_hmq *wrtd_out_log_open(struct wrtd_node *dev, int output)
struct trtl_hmq *wrtd_out_log_open(struct wrtd_node *dev, int output)
{
return wrtd_log_open(dev, output, WRTD_CORE_OUT);
}
......@@ -357,7 +357,7 @@ int wrtd_out_log_level_get(struct wrtd_node *dev, unsigned int input,
* specific one.
* @return a HMQ token on success, NULL on error and errno is set appropriately
*/
struct wrnc_hmq *wrtd_in_log_open(struct wrtd_node *dev, int input)
struct trtl_hmq *wrtd_in_log_open(struct wrtd_node *dev, int input)
{
return wrtd_log_open(dev, input, WRTD_CORE_IN);
}
......
This diff is collapsed.
......@@ -163,7 +163,7 @@ extern void wrtd_exit();
extern struct wrtd_node *wrtd_open_by_fmc(uint32_t device_id);
extern struct wrtd_node *wrtd_open_by_lun(int lun);
extern void wrtd_close(struct wrtd_node *dev);
extern struct wrnc_dev *wrtd_get_wrnc_dev(struct wrtd_node *dev);
extern struct trtl_dev *wrtd_get_trtl_dev(struct wrtd_node *dev);
extern int wrtd_load_application(struct wrtd_node *dev, char *rt_tdc,
char *rt_fd);
extern int wrtd_white_rabbit_sync(struct wrtd_node *dev,
......@@ -197,10 +197,10 @@ extern void wrtd_sec_pico_to_ts(uint64_t sec, uint64_t pico,
extern const char *wrtd_strlogging(enum wrtd_log_level lvl);
enum wrtd_log_level wrtd_strlogging_to_level(char *log);
extern void wrtd_strlogging_full(char *buf, uint32_t log_level);
extern int wrtd_log_read(struct wrnc_hmq *hmq_log, struct wrtd_log_entry *log,
extern int wrtd_log_read(struct trtl_hmq *hmq_log, struct wrtd_log_entry *log,
int count, int poll_timeout);
extern void wrtd_log_close(struct wrnc_hmq *hmq);
extern struct wrnc_hmq *wrtd_in_log_open(struct wrtd_node *dev, int input);
extern void wrtd_log_close(struct trtl_hmq *hmq);
extern struct trtl_hmq *wrtd_in_log_open(struct wrtd_node *dev, int input);
extern int wrtd_in_log_level_set(struct wrtd_node *dev, unsigned int input,
uint32_t log_level);
extern int wrtd_in_log_level_get(struct wrtd_node *dev, unsigned int input,
......@@ -209,7 +209,7 @@ extern int wrtd_out_log_level_set(struct wrtd_node *dev, unsigned int output,
uint32_t log_level);
extern int wrtd_out_log_level_get(struct wrtd_node *dev, unsigned int input,
uint32_t *log_level);
extern struct wrnc_hmq *wrtd_out_log_open(struct wrtd_node *dev, int output);
extern struct trtl_hmq *wrtd_out_log_open(struct wrtd_node *dev, int output);
/**@}*/
......@@ -251,7 +251,7 @@ extern int wrtd_in_has_trigger(struct wrtd_node *dev, unsigned int input,
extern int wrtd_in_ping(struct wrtd_node *dev);
extern int wrtd_in_base_time(struct wrtd_node *dev, struct wr_timestamp *ts);
extern int wrtd_in_version(struct wrtd_node *dev,
struct wrnc_rt_version *version);
struct trtl_rt_version *version);
extern int wrtd_in_dead_time_get(struct wrtd_node *dev, unsigned int input,
uint64_t *dead_time_ps);
extern int wrtd_in_delay_get(struct wrtd_node *dev, unsigned int input,
......@@ -304,7 +304,7 @@ extern int wrtd_out_trig_enable(struct wrtd_node *dev,
extern int wrtd_out_ping(struct wrtd_node *dev);
extern int wrtd_out_base_time(struct wrtd_node *dev, struct wr_timestamp *ts);
extern int wrtd_out_version(struct wrtd_node *dev,
struct wrnc_rt_version *version);
struct trtl_rt_version *version);
extern int wrtd_out_trigger_mode_set(struct wrtd_node *dev,
unsigned int output,
enum wrtd_trigger_mode mode);
......
......@@ -195,7 +195,7 @@ static void ts_adjust_delay(struct wr_timestamp *ts, uint32_t cycles, uint32_t f
static void log_trigger(int type, int miss_reason, struct wrtd_out_channel *out,
struct wrtd_trigger_entry *ent)
{
struct wrnc_proto_header hdr = {
struct trtl_proto_header hdr = {
.rt_app_id = 0,
.msg_id = WRTD_OUT_ACTION_LOG,
.slot_io = WRTD_OUT_FD_LOGGING,
......@@ -205,7 +205,7 @@ static void log_trigger(int type, int miss_reason, struct wrtd_out_channel *out,
.trans = 0x0,
.time = 0x0,
};
struct wrnc_msg out_buf;
struct trtl_msg out_buf;
struct wrtd_log_entry *log;
if (!out && (type != WRTD_LOG_PROMISC || !promiscuous_mode ))
......@@ -676,8 +676,8 @@ struct wrtd_trigger_sw {
* It generate a software trigger accorging to the trigger entry coming
* from the user space.
*/
static int wrtd_out_trigger_sw(struct wrnc_proto_header *hin, void *pin,
struct wrnc_proto_header *hout, void *pout)
static int wrtd_out_trigger_sw(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
struct wrtd_trigger_sw *tsw = pin;
struct pulse_queue_entry *pq_ent;
......@@ -735,8 +735,8 @@ static int wrtd_out_hash_table_free(struct wrtd_trig_id *tid)
/**
* Insert trigger entry in the hash table
*/
static int wrtd_out_hash_table_insert(struct wrnc_proto_header *hin, void *pin,
struct wrnc_proto_header *hout, void *pout)
static int wrtd_out_hash_table_insert(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
uint32_t tidx = *(uint32_t *)pin;
int hidx;
......@@ -768,8 +768,8 @@ out:
/**
* Remove trigger entry from the hash table
*/
static int wrtd_out_hash_table_remove(struct wrnc_proto_header *hin, void *pin,
struct wrnc_proto_header *hout, void *pout)
static int wrtd_out_hash_table_remove(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
uint32_t tidx = *(uint32_t *)pin;
int hidx;
......@@ -798,8 +798,8 @@ static int wrtd_out_hash_table_remove(struct wrnc_proto_header *hin, void *pin,
/**
* It gets the trigger index for a given trigger ID
*/
static int wrtd_out_trigger_index(struct wrnc_proto_header *hin, void *pin,
struct wrnc_proto_header *hout, void *pout)
static int wrtd_out_trigger_index(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
struct wrtd_trig_id *id = pin;
uint32_t *index = pout;
......@@ -844,8 +844,8 @@ err:
/**
* It disable the given channel and clear its internal queue
*/
static int wrtd_out_disable(struct wrnc_proto_header *hin, void *pin,
struct wrnc_proto_header *hout, void *pout)
static int wrtd_out_disable(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
uint32_t ch = *((uint32_t *)pin);
......
......@@ -77,9 +77,9 @@ static int wrtd_in_trigger_log(int type, int miss_reason,
struct wrtd_in_channel *st,
struct wrtd_trigger_entry *ent)
{
struct wrnc_msg out_buf;
struct trtl_msg out_buf;
struct wrtd_log_entry *log;
struct wrnc_proto_header hdr = {
struct trtl_proto_header hdr = {
.rt_app_id = 0,
.msg_id = WRTD_IN_ACTION_LOG,
.slot_io = WRTD_OUT_TDC_LOGGING,
......@@ -257,8 +257,8 @@ static inline void do_input(void)
* delay, then this function will add it to the current time to compute
* the correct fire time.
*/
static int wrtd_in_trigger_sw(struct wrnc_proto_header *hin, void *pin,
struct wrnc_proto_header *hout, void *pout)
static int wrtd_in_trigger_sw(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
struct wrtd_trigger_entry ent;
struct wr_timestamp ts;
......
......@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
uint32_t dev_id = 0;
char *tdc = NULL, *fd =NULL, c;
struct wrtd_node *wrtd;
struct wrnc_dev *wrnc;
struct trtl_dev *trtl;
int32_t offset;
atexit(wrtd_exit);
......@@ -157,14 +157,14 @@ int main(int argc, char *argv[])
}
if (!dev_id) {
fprintf(stderr, "Invalid wrnc device\n");
fprintf(stderr, "Invalid trtl device\n");
exit(1);
}
err = wrtd_init();
if (err) {
fprintf(stderr, "Cannot init White Rabbit Trigger Distribution lib: %s\n",
wrnc_strerror(errno));
trtl_strerror(errno));
exit(1);
}
......@@ -185,15 +185,15 @@ int main(int argc, char *argv[])
}
/* Get the WRNC token */
wrnc = wrtd_get_wrnc_dev(wrtd);
trtl = wrtd_get_trtl_dev(wrtd);
fprintf(stdout, "Reboot applications\n");
/* Start running application on TDC and FD CPUs */
err = wrnc_cpu_start(wrnc, 0);
err = trtl_cpu_start(trtl, 0);
if (err)
exit(1);
err = wrnc_cpu_start(wrnc, 1);
err = trtl_cpu_start(trtl, 1);
if (err)
exit(1);
......
......@@ -340,7 +340,7 @@ int main(int argc, char *argv[])
err = wrtd_init();
if (err) {
fprintf(stderr, "Cannot init White Rabbit Trigger Distribution lib: %s\n",
wrnc_strerror(errno));
trtl_strerror(errno));
exit(1);
}
......
......@@ -42,7 +42,7 @@ static void help()
static void *logging_thread(void *arg)
{
struct wrtd_log_th *th_data = arg;
struct wrnc_hmq *hlog;
struct trtl_hmq *hlog;
struct wrtd_log_entry log;
int i, count;
......@@ -168,7 +168,7 @@ int main(int argc, char *argv[])
err = wrtd_init();
if (err) {
fprintf(stderr, "Cannot init White Rabbit Node Core lib: %s\n",
wrnc_strerror(errno));
trtl_strerror(errno));
exit(1);
}
......
......@@ -606,7 +606,7 @@ int main(int argc, char *argv[])
err = wrtd_init();
if (err) {
fprintf(stderr, "Cannot init White Rabbit Node Core lib: %s\n",
wrnc_strerror(errno));
trtl_strerror(errno));
exit(1);
}
......
......@@ -31,7 +31,7 @@ static void print_time(struct wr_timestamp *t)
t->seconds, t->ticks, t->frac);
}
static void print_version(struct wrnc_rt_version *v)
static void print_version(struct trtl_rt_version *v)
{
fprintf(stdout, "\tRealTime Application Version:");
fprintf(stdout, "\tfpga_id\t\t%x\n",
......@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
{
struct wrtd_node *wrtd;
uint32_t dev_id = 0, n = 1;
struct wrnc_rt_version vi, vo;
struct trtl_rt_version vi, vo;
uint64_t period = 0;
struct wr_timestamp tsi, tso;
int err, time = 0, version = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment