Commit bda01025 authored by Adam Wujek's avatar Adam Wujek

arch-wrs: use symbolic link to hal_exports.h

Avoid local copy of hal_exports.h. Anyway other (.h) files from
wr-switch-sw are needed to build ppsi...
Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 75374a42
......@@ -52,6 +52,19 @@ $(libwr_headers_in_ppsi):
echo "Creating symbolic link to include/libwr/$$f";\
ln -sf ../../../../libwr/include/libwr/$$f $@
# build symbolic links for userspace files from wrs
wrs_userspace_headers = hal_exports.h
wrs_userspace_headers_in_ppsi = $(addprefix $A/include/,$(wrs_userspace_headers))
$(arch-spec-o): $(wrs_userspace_headers_in_ppsi)
$(wrs_userspace_headers_in_ppsi):
@f=$(notdir $@); \
echo "Creating symbolic link to include/$$f";\
ln -sf ../../../include/$$f $@
export size_db_file:=size_wrs_db.txt
export size_info_file:=size_wrs_info.txt
......@@ -77,7 +90,7 @@ OBJ-y += $(MINIPC_LIB)
all: $(TARGET)
clean::
rm -f $(libwr_headers_in_ppsi)
rm -f $(libwr_headers_in_ppsi) $(wrs_userspace_headers_in_ppsi)
# to build the target, we need -lstd again, in case we call functions that
# were not selected yet (e.g., pp_init_globals() ).
......
#ifndef __HAL_EXPORTS_C
#define __HAL_EXPORTS_C
#include <minipc.h>
#include <hal_exports.h>
#include <hal_exports.h> /* for exported structs/function protos */
/* Export structures, shared by server and client for argument matching */
struct minipc_pd __rpcdef_check_running = {
.name = "check_running",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_END,
},
};
//int halexp_reset_port(const char *port_name);
struct minipc_pd __rpcdef_reset_port = {
.name = "reset_port",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_STRING, char *),
MINIPC_ARG_END,
},
};
//int halexp_calibration_cmd(const char *port_name, int command, int on_off);
struct minipc_pd __rpcdef_calibration_cmd = {
.name = "calibration_cmd",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_STRING, char *),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
MINIPC_ARG_END,
},
};
//int halexp_lock_cmd(const char *port_name, int command, int priority);
struct minipc_pd __rpcdef_lock_cmd = {
.name = "lock_cmd",
......@@ -61,7 +28,7 @@ struct minipc_pd __rpcdef_pps_cmd = {
};
//int halexp_info_cmd(hexp_info_params_t *params);
struct minipc_pd __rpcdef_port_update_cmd = {
struct minipc_pd __rpcdef_port_info_cmd = {
.name = "info_cmd",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
......@@ -70,4 +37,13 @@ struct minipc_pd __rpcdef_port_update_cmd = {
},
};
#endif
//int halexp_sfp_tx_cmd(int cmd, int port);
struct minipc_pd __rpcdef_sfp_tx_cmd = {
.name = "sfp_tx_cmd",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
MINIPC_ARG_END,
},
};
#ifndef __HAL_EXPORTS_H
#define __HAL_EXPORTS_H
#include <stdint.h>
#define HAL_MAX_PORTS 32
#define WRSW_HAL_SERVER_ADDR "wrsw_hal"
// checks if the calibration unit is idle
#define HEXP_CAL_CMD_CHECK_IDLE 1
// enables/disables transmission of calibration pattern
#define HEXP_CAL_CMD_TX_PATTERN 2
// requests a measurement of TX delta
#define HEXP_CAL_CMD_TX_MEASURE 4
// requests a measurement of RX delta
#define HEXP_CAL_CMD_RX_MEASURE 5
#define HEXP_CAL_RESP_BUSY 1
#define HEXP_CAL_RESP_OK 0
#define HEXP_CAL_RESP_ERROR -1
#define HEXP_LOCK_CMD_START 1
#define HEXP_LOCK_CMD_CHECK 2
#define HEXP_LOCK_CMD_ENABLE_TRACKING 3
#define HEXP_LOCK_CMD_RESET 4
#define HEXP_LOCK_STATUS_UNLOCKED 0
#define HEXP_LOCK_STATUS_LOCKED 1
#define HEXP_LOCK_STATUS_RELOCK_ERROR 2
#define HEXP_LOCK_STATUS_ERROR 3
#define HEXP_PPSG_CMD_GET 0
#define HEXP_PPSG_CMD_ADJUST_PHASE 1
#define HEXP_PPSG_CMD_ADJUST_SEC 2
#define HEXP_PPSG_CMD_ADJUST_NSEC 3
#define HEXP_PPSG_CMD_POLL 4
#define HEXP_PPSG_CMD_SET_VALID 5
#define HEXP_PPSG_CMD_SET_TIMING_MODE 6
#define HEXP_PPSG_CMD_GET_TIMING_MODE 7
#define HEXP_PPSG_CMD_GET_TIMING_MODE_STATE 8
#define HEXP_ON 1
#define HEXP_OFF 0
#define HEXP_FREQ 0
#define HEXP_PHASE 1
/////////////////added by ML//////////
#define HEXP_EXTSRC_CMD_CHECK 0
#define HEXP_EXTSRC_STATUS_LOCKED 0
#define HEXP_LOCK_STATUS_BUSY 1
#define HEXP_EXTSRC_STATUS_NOSRC 2
/////////////////////////////////////
#define HAL_TIMING_MODE_GRAND_MASTER 0
#define HAL_TIMING_MODE_FREE_MASTER 1
#define HAL_TIMING_MODE_BC 2
#define HAL_TIMING_MODE_DISABLED 3
#define HAL_TIMING_MODE_TMDT_UNLOCKED 0
#define HAL_TIMING_MODE_TMDT_LOCKED 1
#define HAL_TIMING_MODE_TMDT_HOLDHOVER 2
typedef struct {
char port_name[16];
int pps_valid;
uint32_t current_phase_shift;
int32_t adjust_phase_shift;
int64_t adjust_sec;
int32_t adjust_nsec;
uint64_t current_sec;
uint32_t current_nsec;
uint32_t timing_mode;
} hexp_pps_params_t;
#define PORT_MODE_OTHER 0
#define PORT_MODE_SLAVE 1
#define PORT_MODE_MASTER 2
typedef struct {
char name[16]; // Interface name
int synchronized; // <>0 : Master/Slave are synchronized
int mode; // PORT_MODE_XXXX
}hexp_port_info_t;
typedef struct {
int numberPortInterfaces;
hexp_port_info_t hIFace[HAL_MAX_PORTS];
} hexp_port_info_params_t;
/* Port modes (hal_port_state.mode) */
#define HEXP_PORT_MODE_WR_MASTER 1
#define HEXP_PORT_MODE_WR_SLAVE 2
#define HEXP_PORT_MODE_NON_WR 3
#define HEXP_PORT_MODE_WR_M_AND_S 4
#define HEXP_PORT_MODE_NONE 5
#define FIX_ALPHA_FRACBITS 40
/*
#define HEXP_PORT_TSC_RISING 1
#define HEXP_PORT_TSC_FALLING 2
*/
extern struct minipc_pd __rpcdef_lock_cmd;
extern struct minipc_pd __rpcdef_pps_cmd;
extern struct minipc_pd __rpcdef_port_update_cmd;
/* Prototypes of functions that call on rpc */
extern int halexp_lock_cmd(const char *port_name, int command, int priority);
extern int halexp_pps_cmd(int cmd, hexp_pps_params_t *params);
#endif
......@@ -70,7 +70,7 @@ int wrs_update_port_info(struct pp_globals *ppg) {
}
}
}
ret = minipc_call(hal_ch, DEFAULT_TO, &__rpcdef_port_update_cmd,
ret = minipc_call(hal_ch, DEFAULT_TO, &__rpcdef_port_info_cmd,
&rval, &infos);
if (ret < 0)
......
......@@ -22,7 +22,6 @@
#include <signal.h>
#include <minipc.h>
#include <hal_exports.h>
#include <ppsi/ppsi.h>
#include <ppsi-wrs.h>
......
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