Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
6876dba5
Commit
6876dba5
authored
Jul 21, 2017
by
Sven Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default dataset: fixed now for spec and wrs
parent
a3328e8b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
42 deletions
+57
-42
main-loop.c
arch-sim/main-loop.c
+1
-1
main-loop.c
arch-unix/main-loop.c
+1
-1
wrc_ptp_ppsi.c
arch-wrpc/wrc_ptp_ppsi.c
+2
-2
main-loop.c
arch-wrs/main-loop.c
+6
-6
pp-instance.h
include/ppsi/pp-instance.h
+1
-1
main-loop.c
lib-bare/main-loop.c
+1
-1
hooks.c
proto-ext-whiterabbit/hooks.c
+2
-1
bmc.c
proto-standard/bmc.c
+3
-3
state-initializing.c
proto-standard/state-initializing.c
+40
-26
No files found.
arch-sim/main-loop.c
View file @
6876dba5
...
...
@@ -52,7 +52,7 @@ void sim_main_loop(struct pp_globals *ppg)
ppi
=
INST
(
ppg
,
j
);
ppi
->
is_new_state
=
1
;
/* just tell that the links are up */
ppi
->
link
U
p
=
TRUE
;
ppi
->
link
_u
p
=
TRUE
;
}
delay_ns
=
run_all_state_machines
(
ppg
)
*
1000LL
*
1000LL
;
...
...
arch-unix/main-loop.c
View file @
6876dba5
...
...
@@ -49,7 +49,7 @@ void unix_main_loop(struct pp_globals *ppg)
ppi
=
INST
(
ppg
,
j
);
/* just tell that the links are up */
ppi
->
link
U
p
=
TRUE
;
ppi
->
link
_u
p
=
TRUE
;
/*
* The main loop here is based on select. While we are not
...
...
arch-wrpc/wrc_ptp_ppsi.c
View file @
6876dba5
...
...
@@ -227,7 +227,7 @@ int wrc_ptp_start()
start_tics
=
timer_get_tics
();
/* just tell that the link is up, if not it will anyhow not receive anything */
ppi
->
link
UP
=
TRUE
;
ppi
->
link
_up
=
TRUE
;
wr_servo_reset
(
ppi
);
ptp_enabled
=
1
;
...
...
@@ -247,7 +247,7 @@ int wrc_ptp_stop()
ppi
->
frgn_rec_num
=
0
;
/* no known master */
/* just tell that the link is down now */
ppi
->
link
UP
=
FALSE
;
ppi
->
link
_up
=
FALSE
;
ptp_enabled
=
0
;
wr_servo_reset
(
ppi
);
pp_close_globals
(
&
ppg_static
);
...
...
arch-wrs/main-loop.c
View file @
6876dba5
...
...
@@ -29,7 +29,7 @@ static int run_all_state_machines(struct pp_globals *ppg)
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
{
struct
pp_instance
*
ppi
=
INST
(
ppg
,
j
);
int
old_lu
=
ppi
->
link
UP
;
int
old_lu
=
ppi
->
link
_up
;
struct
hal_port_state
*
p
;
/* FIXME: we should save this pointer in the ppi itself */
...
...
@@ -40,16 +40,16 @@ static int run_all_state_machines(struct pp_globals *ppg)
continue
;
}
ppi
->
link
UP
=
ppi
->
link
_up
=
(
p
->
state
!=
HAL_PORT_STATE_LINK_DOWN
&&
p
->
state
!=
HAL_PORT_STATE_DISABLED
);
if
(
old_lu
!=
ppi
->
link
UP
)
{
if
(
old_lu
!=
ppi
->
link
_up
)
{
pp_diag
(
ppi
,
fsm
,
1
,
"iface %s went %s
\n
"
,
ppi
->
iface_name
,
ppi
->
link
UP
?
"up"
:
"down"
);
ppi
->
iface_name
,
ppi
->
link
_up
?
"up"
:
"down"
);
if
(
ppi
->
link
UP
)
{
if
(
ppi
->
link
_up
)
{
ppi
->
state
=
PPS_INITIALIZING
;
}
else
{
...
...
@@ -62,7 +62,7 @@ static int run_all_state_machines(struct pp_globals *ppg)
}
/* Do not call state machine if link is down */
if
(
ppi
->
link
UP
)
if
(
ppi
->
link
_up
)
delay_ms_j
=
pp_state_machine
(
ppi
,
NULL
,
0
);
else
delay_ms_j
=
PP_DEFAULT_NEXT_DELAY_MS
;
...
...
include/ppsi/pp-instance.h
View file @
6876dba5
...
...
@@ -180,7 +180,7 @@ struct pp_instance {
UInteger16
sent_seq
[
__PP_NR_MESSAGES_TYPES
];
/* last sent this type */
MsgHeader
received_ptp_header
;
Boolean
link
UP
;
Boolean
link
_up
;
char
*
iface_name
;
/* for direct actions on hardware */
char
*
port_name
;
/* for diagnostics, mainly */
int
port_idx
;
...
...
lib-bare/main-loop.c
View file @
6876dba5
...
...
@@ -25,7 +25,7 @@ void bare_main_loop(struct pp_instance *ppi)
int
delay_ms
;
/* just tell that the links are up */
ppi
->
link
U
p
=
TRUE
;
ppi
->
link
_u
p
=
TRUE
;
/*
* The main loop here is based on select. While we are not
* doing anything else but the protocol, this allows extra stuff
...
...
proto-ext-whiterabbit/hooks.c
View file @
6876dba5
...
...
@@ -326,7 +326,8 @@ static void wr_state_change(struct pp_instance *ppi)
wrp
->
parentWrModeOn
=
FALSE
;
wrp
->
calibrated
=
!
WR_DEFAULT_PHY_CALIBRATION_REQUIRED
;
wrp
->
ops
->
locking_reset
(
ppi
);
if
(
ppi
->
state
==
PPS_SLAVE
)
wrp
->
ops
->
locking_reset
(
ppi
);
}
}
...
...
proto-standard/bmc.c
View file @
6876dba5
...
...
@@ -988,7 +988,7 @@ static int bmc_any_port_initializing(struct pp_globals *ppg)
ppi
=
INST
(
ppg
,
i
);
if
(
ppi
->
link
UP
&&
(
ppi
->
state
==
PPS_INITIALIZING
))
{
if
(
ppi
->
link
_up
&&
(
ppi
->
state
==
PPS_INITIALIZING
))
{
pp_diag
(
ppi
,
bmc
,
2
,
"The first port in INITIALIZING "
"state is %i
\n
"
,
i
);
return
1
;
...
...
@@ -1015,7 +1015,7 @@ static void bmc_update_erbest(struct pp_globals *ppg)
frgn_master
=
ppi
->
frgn_master
;
/* if link is down clear foreign master table */
if
((
!
ppi
->
link
UP
)
&&
(
ppi
->
frgn_rec_num
>
0
))
if
((
!
ppi
->
link
_up
)
&&
(
ppi
->
frgn_rec_num
>
0
))
bmc_flush_frgn_master
(
ppi
);
if
(
ppi
->
frgn_rec_num
>
0
)
{
...
...
@@ -1139,7 +1139,7 @@ int bmc(struct pp_instance *ppi)
/* Calulate Ebest Figure 25 */
bmc_update_ebest
(
ppg
);
if
(
!
ppi
->
link
UP
)
{
if
(
!
ppi
->
link
_up
)
{
/* Set it back to initializing */
next_state
=
PPS_INITIALIZING
;
}
else
if
(
ret
==
1
)
{
...
...
proto-standard/state-initializing.c
View file @
6876dba5
...
...
@@ -44,9 +44,10 @@ int pp_initializing(struct pp_instance *ppi, void *buf, int len)
struct
pp_runtime_opts
*
opt
=
OPTS
(
ppi
);
struct
pp_globals
*
ppg
=
GLBS
(
ppi
);
int
ret
=
0
;
int
i
,
j
;
int
i
;
unsigned
int
portidx
;
unsigned
int
remainder
;
int
initds
=
1
;
if
(
ppi
->
n_ops
->
init
(
ppi
)
<
0
)
/* it must handle being called twice */
goto
failure
;
...
...
@@ -54,32 +55,45 @@ int pp_initializing(struct pp_instance *ppi, void *buf, int len)
/* only fill in the data set when initializing */
if
(
DSDEF
(
ppi
)
->
numberPorts
>
1
)
{
for
(
i
=
0
;
i
<
ppg
->
defaultDS
->
numberPorts
;
i
++
)
{
if
(
INST
(
ppg
,
i
)
->
state
!=
PPS_INITIALIZING
)
{
/* Clock identity comes from mac address with 0xff:0xfe intermixed */
mac
=
ppi
->
ch
[
PP_NP_GEN
].
addr
;
/* calculate MAC of Port 0 */
portidx
=
ppi
-
ppi
->
glbs
->
pp_instances
;
remainder
=
portidx
;
for
(
j
=
5
;
j
>=
0
;
j
--
)
{
mac_port1
[
j
]
=
mac
[
j
]
-
remainder
;
if
(
mac
[
j
]
>=
remainder
)
remainder
=
0
;
else
remainder
=
1
;
}
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
0
]
=
mac_port1
[
0
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
1
]
=
mac_port1
[
1
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
2
]
=
mac_port1
[
2
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
3
]
=
0xff
;
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
4
]
=
0xfe
;
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
5
]
=
mac_port1
[
3
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
6
]
=
mac_port1
[
4
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
7
]
=
mac_port1
[
5
];
init_parent_ds
(
ppi
);
if
((
INST
(
ppg
,
i
)
->
state
!=
PPS_INITIALIZING
)
&&
(
INST
(
ppg
,
i
)
->
link_up
==
TRUE
))
initds
=
0
;
}
}
/*
* Initialize default and parent data set
*/
if
(
initds
)
{
if
(
DSDEF
(
ppi
)
->
numberPorts
>
1
)
{
/* Clock identity comes from mac address with 0xff:0xfe intermixed */
mac
=
ppi
->
ch
[
PP_NP_GEN
].
addr
;
/* calculate MAC of Port 0 */
portidx
=
ppi
-
ppi
->
glbs
->
pp_instances
;
remainder
=
portidx
;
for
(
i
=
5
;
i
>=
0
;
i
--
)
{
mac_port1
[
i
]
=
mac
[
i
]
-
remainder
;
if
(
mac
[
i
]
>=
remainder
)
remainder
=
0
;
else
remainder
=
1
;
}
}
}
else
{
/* Clock identity comes from mac address with 0xff:0xfe intermixed */
for
(
i
=
5
;
i
>=
0
;
i
--
)
mac_port1
[
i
]
=
((
unsigned
char
*
)
ppi
->
ch
[
PP_NP_GEN
].
addr
)[
i
];
}
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
0
]
=
mac_port1
[
0
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
1
]
=
mac_port1
[
1
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
2
]
=
mac_port1
[
2
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
3
]
=
0xff
;
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
4
]
=
0xfe
;
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
5
]
=
mac_port1
[
3
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
6
]
=
mac_port1
[
4
];
DSDEF
(
ppi
)
->
clockIdentity
.
id
[
7
]
=
mac_port1
[
5
];
init_parent_ds
(
ppi
);
}
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment