Commit 3811c851 authored by Adam Wujek's avatar Adam Wujek 💬

userspace: get rid of minipc call get_port_state

Minipc call to get port state will not be used anymore, since HAL export port
state through shmem.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent fe03a624
......@@ -146,7 +146,6 @@ extern int halexp_check_running(void);
extern int halexp_reset_port(const char *port_name);
extern int halexp_calibration_cmd(const char *port_name, int command, int on_off);
extern int halexp_lock_cmd(const char *port_name, int command, int priority);
extern int halexp_get_port_state(hexp_port_state_t *state, const char *port_name);
extern int halexp_pps_cmd(int cmd, hexp_pps_params_t *params);
extern int halexp_get_timing_state(hexp_timing_state_t *state);
......@@ -196,16 +195,6 @@ struct minipc_pd __rpcdef_lock_cmd = {
},
};
//int halexp_get_port_state(hexp_port_state_t *state, const char *port_name);
struct minipc_pd __rpcdef_get_port_state = {
.name = "get_port_state",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_STRUCT, hexp_port_state_t),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_STRING, char *),
MINIPC_ARG_END,
},
};
//int halexp_pps_cmd(int cmd, hexp_pps_params_t *params);
struct minipc_pd __rpcdef_pps_cmd = {
.name = "pps_cmd",
......
......@@ -26,12 +26,6 @@ int halexp_lock_cmd(const char *port_name, int command, int priority)
return rval;
}
/* This used to be a mini-rpc call; it is now a shmem lookup */
int halexp_get_port_state(hexp_port_state_t * state, const char *port_name)
{
return hal_port_get_exported_state(state, hal_ports, port_name);
}
int halexp_pps_cmd(int cmd, hexp_pps_params_t * params)
{
int ret, rval;
......
......@@ -21,48 +21,3 @@ struct hal_port_state *hal_port_lookup(struct hal_port_state *ports,
return NULL;
}
int hal_port_get_exported_state(struct hexp_port_state *state,
struct hal_port_state *ports,
const char *port_name)
{
const struct hal_port_state *p = hal_port_lookup(ports, port_name);
// pr_info("GetPortState %s [lup %x]\n", port_name, p);
if (!p)
return -1;
/* WARNING! when alpha = 1.0 (no asymmetry), fiber_fix_alpha = 0! */
state->fiber_fix_alpha = (double)pow(2.0, 40.0) *
((p->calib.sfp.alpha + 1.0) / (p->calib.sfp.alpha + 2.0) - 0.5);
state->valid = 1;
state->mode = p->mode;
state->up = (p->state != HAL_PORT_STATE_LINK_DOWN
&& p->state != HAL_PORT_STATE_DISABLED);
state->is_locked = p->locked; //lock_state == LOCK_STATE_LOCKED;
state->phase_val = p->phase_val;
state->phase_val_valid = p->phase_val_valid;
state->tx_calibrated = p->calib.tx_calibrated;
state->rx_calibrated = p->calib.rx_calibrated;
state->delta_tx = p->calib.delta_tx_phy
+ p->calib.sfp.delta_tx_ps + p->calib.delta_tx_board;
state->delta_rx = p->calib.delta_rx_phy
+ p->calib.sfp.delta_rx_ps + p->calib.delta_rx_board;
state->t2_phase_transition = DEFAULT_T2_PHASE_TRANS;
state->t4_phase_transition = DEFAULT_T4_PHASE_TRANS;
state->clock_period = REF_CLOCK_PERIOD_PS;
memcpy(state->hw_addr, p->hw_addr, 6);
state->hw_index = p->hw_index;
return 0;
}
......@@ -119,10 +119,6 @@ struct hal_shmem_header {
struct hal_port_state *hal_port_lookup(struct hal_port_state *ports,
const char *name);
int hal_port_get_exported_state(struct hexp_port_state *state,
struct hal_port_state *ports,
const char *port_name);
static inline int state_up(int state)
{
return (state != HAL_PORT_STATE_LINK_DOWN
......
ppsi @ 036fd839
Subproject commit 4a60739fc06a3d68718e1bdeece92bd7b279253d
Subproject commit 036fd8392ca2fd5925f6dc5d87adbda4f96cd0d7
......@@ -165,15 +165,6 @@ static int export_pps_cmd(const struct minipc_pd *pd,
return 0;
}
static int export_get_port_state(const struct minipc_pd *pd,
uint32_t * args, void *ret)
{
hexp_port_state_t *state = ret;
return hal_port_get_exported_state(state, ports,
(char *)args /* name */ );
}
static int export_lock_cmd(const struct minipc_pd *pd,
uint32_t * args, void *ret)
{
......@@ -211,12 +202,10 @@ int hal_init_wripc(struct hal_port_state *hal_ports)
/* fill the function pointers */
__rpcdef_pps_cmd.f = export_pps_cmd;
__rpcdef_get_port_state.f = export_get_port_state;
__rpcdef_lock_cmd.f = export_lock_cmd;
__rpcdef_get_timing_state.f = export_get_timing_state;
minipc_export(hal_ch, &__rpcdef_pps_cmd);
minipc_export(hal_ch, &__rpcdef_get_port_state);
minipc_export(hal_ch, &__rpcdef_lock_cmd);
minipc_export(hal_ch, &__rpcdef_get_timing_state);
......
......@@ -20,9 +20,6 @@ int hal_port_init_all();
void hal_port_update_all();
struct hexp_port_state;
struct hal_port_state;
int hal_port_get_exported_state(struct hexp_port_state *state,
struct hal_port_state *ports,
const char *port_name);
int hal_init_wripc();
int hal_update_wripc(int ms_timeout);
......
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