Commit 62a093c3 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

hal_shm: add flag to indicate if t24p was loaded from config

parent b5478bfe
...@@ -143,6 +143,7 @@ struct hal_port_state { ...@@ -143,6 +143,7 @@ struct hal_port_state {
/* approximate phase value (on master port) at which RX timestamp (T4) /* approximate phase value (on master port) at which RX timestamp (T4)
* counter transistion occurs (picoseconds) */ * counter transistion occurs (picoseconds) */
uint32_t t4_phase_transition; uint32_t t4_phase_transition;
int t24p_from_config; /* non-zero: t24p was loaded from config file */
uint32_t ep_base;/* Endpoint's base address */ uint32_t ep_base;/* Endpoint's base address */
......
...@@ -446,6 +446,7 @@ struct dump_info hal_port_info [] = { ...@@ -446,6 +446,7 @@ struct dump_info hal_port_info [] = {
DUMP_FIELD(uint32_t, clock_period), DUMP_FIELD(uint32_t, clock_period),
DUMP_FIELD(uint32_t, t2_phase_transition), DUMP_FIELD(uint32_t, t2_phase_transition),
DUMP_FIELD(uint32_t, t4_phase_transition), DUMP_FIELD(uint32_t, t4_phase_transition),
DUMP_FIELD(int, t24p_from_config),
DUMP_FIELD(uint32_t, ep_base), DUMP_FIELD(uint32_t, ep_base),
DUMP_FIELD(int, sfpPresent), DUMP_FIELD(int, sfpPresent),
DUMP_FIELD(int, has_sfp_diag), DUMP_FIELD(int, has_sfp_diag),
......
...@@ -451,6 +451,7 @@ static void init_port(struct hal_port_state * ps) ...@@ -451,6 +451,7 @@ static void init_port(struct hal_port_state * ps)
{ {
char *retValue; char *retValue;
int t24p; int t24p;
int from_config;
char key[128]; char key[128];
reset_port(ps); reset_port(ps);
...@@ -459,18 +460,22 @@ static void init_port(struct hal_port_state * ps) ...@@ -459,18 +460,22 @@ static void init_port(struct hal_port_state * ps)
/* Rading t24p from the dot-config file could be done once in hal_ports, but /* Rading t24p from the dot-config file could be done once in hal_ports, but
* I leave it here since we will implement automatic measurement procedure * I leave it here since we will implement automatic measurement procedure
* in the future release */ * in the future release */
from_config = 1;
sprintf(key, "PORT%02i_INST01_T24P_TRANS_POINT", ps->hw_index+1); sprintf(key, "PORT%02i_INST01_T24P_TRANS_POINT", ps->hw_index+1);
if( (retValue=libwr_cfg_get(key))==NULL ) { if( (retValue=libwr_cfg_get(key))==NULL ) {
pr_error("port %i (%s): no key \"%s\" specified.\n", pr_error("port %i (%s): no key \"%s\" specified.\n",
ps->hw_index+1, ps->name, key); ps->hw_index+1, ps->name, key);
t24p = DEFAULT_T2_PHASE_TRANS; t24p = DEFAULT_T2_PHASE_TRANS;
from_config = 0;
} else if (sscanf(retValue, "%i", &t24p) != 1) { } else if (sscanf(retValue, "%i", &t24p) != 1) {
pr_error("port %i (%s): Invalid key \"%s\" value (%d).\n", pr_error("port %i (%s): Invalid key \"%s\" value (%d).\n",
ps->hw_index+1, ps->name, key,*retValue); ps->hw_index+1, ps->name, key,*retValue);
from_config = 0;
} }
ps->t2_phase_transition = t24p; ps->t2_phase_transition = t24p;
ps->t4_phase_transition = t24p; ps->t4_phase_transition = t24p;
ps->t24p_from_config = from_config;
} }
......
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