Commit beb71a16 authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

arch-wrs: move some minipc-related stuff to ppsi-wrs.h

Since the hal client is called in two places
(arch-wrs/wrs-calibration.c and time-wrs/wrs-time.c), put what is common
in the general include file provided by arch-wrs. Indeed this file
should be moved to arch-wrs/include (will be done in one of the
next commits).
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 3e25a280
......@@ -6,6 +6,31 @@
* These are the functions provided by the various wrs files
*/
#include <minipc.h>
extern struct minipc_ch *hal_ch;
#define DEFAULT_TO 200000 /* ms */
/* FIXME return values, here copied from proto-ext-whiterabbit.
* I do not include proto-ext-whiterabbit/wr-constants.h in order not to
* have a dependency on ext when compiling wrs architecture. All the return
* values mechanism of wrs hw should be reviewed in this src and in the
* whole ppsi */
/* White Rabbit softpll status values */
#define WR_SPLL_OK 0
#define WR_SPLL_READY 1
#define WR_SPLL_ERROR -1
/* White Rabbit calibration defines */
#define WR_HW_CALIB_TX 1
#define WR_HW_CALIB_RX 2
#define WR_HW_CALIB_OK 0
#define WR_HW_CALIB_READY 1
#define WR_HW_CALIB_ERROR -1
#define WR_HW_CALIB_NOT_FOUND -3
#define POSIX_ARCH(ppg) ((struct unix_arch_data *)(ppg->arch_data))
struct unix_arch_data {
struct timeval tv;
......
......@@ -4,6 +4,11 @@
#include <ppsi/ppsi.h>
#include "ppsi-wrs.h"
#define HAL_EXPORT_STRUCTURES
#include <hal_exports.h>
static int wrs_read_calibration_data(struct pp_instance *ppi,
uint32_t *deltaTx, uint32_t *deltaRx, int32_t *fix_alpha,
int32_t *clock_period)
......
......@@ -4,14 +4,16 @@
#include <ppsi/ppsi.h>
#include <unix-time.h>
#include <minipc.h>
#include "../arch-wrs/ppsi-wrs.h" /* FIXME include path: move ppsi-wrs.h into
* arch-wrs/include ? */
#define HAL_EXPORT_STRUCTURES
#include <hal_exports.h>
#define DEFAULT_TO 200000 /* ms */
extern struct minipc_ch *hal_ch;
/* FIXME: these externs are needed here because we can not include
* hal_exports.h with HAL_EXPORT_STRUCTURES twice (the first is by
* arch-wrs/wrs-calibration.c): structs are declared and
* defined in .h file, so this would lead to a multiple definition. */
extern struct minipc_pd __rpcdef_pps_cmd;
extern struct minipc_pd __rpcdef_lock_cmd;
int wrs_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
{
......
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