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
e18b3f70
Commit
e18b3f70
authored
Feb 19, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kconfig: add optization to remove masterOnly
Saves 124B Signed-off-by:
Adam Wujek
<
adam.wujek@creotech.pl
>
parent
620d330e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
7 deletions
+31
-7
Kconfig
Kconfig
+15
-0
ppsi.h
include/ppsi/ppsi.h
+9
-0
hooks.c
proto-ext-whiterabbit/hooks.c
+1
-1
bmc.c
proto-standard/bmc.c
+1
-1
open-close.c
proto-standard/open-close.c
+1
-1
state-listening.c
proto-standard/state-listening.c
+1
-1
state-master.c
proto-standard/state-master.c
+1
-1
state-passive.c
proto-standard/state-passive.c
+1
-1
state-slave.c
proto-standard/state-slave.c
+1
-1
No files found.
Kconfig
View file @
e18b3f70
...
...
@@ -354,6 +354,15 @@ config CODEOPT_SO_FORCE_DISABLED
Force slaveOnly to false to reduce the footprint.
Saves ~650B.
config CODEOPT_MO_FORCE_DISABLED
boolean "Force disabled masterOnly"
depends on CODEOPT_ENABLED
default y if ARCH_WRPC
default n
help
Force masterOnly to false to reduce the footprint.
Saves ~100B.
choice
prompt "Exclusive options"
...
...
@@ -475,6 +484,12 @@ config HAS_CODEOPT_SO_FORCE_DISABLED
default 1 if CODEOPT_SO_FORCE_DISABLED
default 0
config HAS_CODEOPT_MO_FORCE_DISABLED
int
range 0 1
default 1 if CODEOPT_MO_FORCE_DISABLED
default 0
config HAS_CODEOPT_EPC_ENABLED
int
range 0 1
...
...
include/ppsi/ppsi.h
View file @
e18b3f70
...
...
@@ -191,6 +191,15 @@ static inline int is_slaveOnly(defaultDS_t *def) {
return
CONFIG_HAS_CODEOPT_SO_FORCE_DISABLED
==
0
&&
CONFIG_HAS_CODEOPT_EPC_ENABLED
==
0
&&
def
->
slaveOnly
;
}
static
inline
int
is_masterOnly
(
portDS_t
*
portDS
)
{
#if CONFIG_HAS_CODEOPT_MO_FORCE_DISABLED
return
0
;
#else
return
portDS
->
masterOnly
;
#endif
}
static
inline
int
get_numberPorts
(
defaultDS_t
*
def
)
{
return
CONFIG_HAS_CODEOPT_SINGLE_PORT
?
1
:
def
->
numberPorts
;
}
...
...
proto-ext-whiterabbit/hooks.c
View file @
e18b3f70
...
...
@@ -57,7 +57,7 @@ static int wr_open(struct pp_instance *ppi, struct pp_runtime_opts *rt_opts)
){
WR_DSPOR
(
ppi
)
->
wrConfig
=
WR_S_ONLY
;
}
else
{
WR_DSPOR
(
ppi
)
->
wrConfig
=
(
ppi
->
portDS
->
masterOnly
||
WR_DSPOR
(
ppi
)
->
wrConfig
=
(
is_masterOnly
(
ppi
->
portDS
)
||
(
is_externalPortConfigurationEnabled
(
DSDEF
(
ppi
))
&&
ppi
->
externalPortConfigurationPortDS
.
desiredState
==
PPS_MASTER
))
?
WR_M_ONLY
:
...
...
proto-standard/bmc.c
View file @
e18b3f70
...
...
@@ -622,7 +622,7 @@ static int bmc_state_decision(struct pp_instance *ppi)
bmc_setup_local_frgn_master
(
ppi
,
&
d0
);
if
(
ppi
->
portDS
->
masterOnly
)
{
if
(
is_masterOnly
(
ppi
->
portDS
)
)
{
/* if there is a better master show these values */
if
(
ppg
->
ebest_idx
>=
0
)
{
/* don't update parent dataset */
...
...
proto-standard/open-close.c
View file @
e18b3f70
...
...
@@ -162,7 +162,7 @@ int pp_init_globals(struct pp_globals *ppg, struct pp_runtime_opts *pp_rt_opts)
Enumeration8
desiradedState
=
ppi
->
cfg
.
desiredState
;
/* Clause 17.6.5.3 : - Clause 9.2.2 shall not be in effect */
if
(
ppi
->
portDS
->
masterOnly
)
{
if
(
is_masterOnly
(
ppi
->
portDS
)
)
{
/* priority given to externalPortConfigurationEnabled */
ppi
->
portDS
->
masterOnly
=
FALSE
;
pp_printf
(
"ppsi: Wrong configuration: externalPortConfigurationEnabled=materOnly=TRUE. materOnly set to FALSE
\n
"
);
...
...
proto-standard/state-listening.c
View file @
e18b3f70
...
...
@@ -37,7 +37,7 @@ static int listening_handle_announce(struct pp_instance *ppi, void *buf, int len
* Announce messages received on a masterOnly PTP Port shall not be considered
* in the operation of the best master clock algorithm or in the update of data sets.
*/
if
(
!
DSPOR
(
ppi
)
->
masterOnly
)
{
if
(
!
is_masterOnly
(
DSPOR
(
ppi
))
)
{
struct
pp_frgn_master
frgn_master
;
bmc_store_frgn_master
(
ppi
,
&
frgn_master
,
buf
,
len
);
...
...
proto-standard/state-master.c
View file @
e18b3f70
...
...
@@ -40,7 +40,7 @@ static int master_handle_announce(struct pp_instance *ppi, void *buf, int len)
* Announce messages received on a masterOnly PTP Port shall not be considered
* in the operation of the best master clock algorithm or in the update of data sets.
*/
if
(
!
DSPOR
(
ppi
)
->
masterOnly
)
{
if
(
!
is_masterOnly
(
DSPOR
(
ppi
))
)
{
struct
pp_frgn_master
frgn_master
;
bmc_store_frgn_master
(
ppi
,
&
frgn_master
,
buf
,
len
);
...
...
proto-standard/state-passive.c
View file @
e18b3f70
...
...
@@ -39,7 +39,7 @@ static int passive_handle_announce(struct pp_instance *ppi, void *buf, int len)
* Announce messages received on a masterOnly PTP Port shall not be considered
* in the operation of the best master clock algorithm or in the update of data sets.
*/
if
(
!
DSPOR
(
ppi
)
->
masterOnly
)
{
if
(
!
is_masterOnly
(
DSPOR
(
ppi
))
)
{
struct
pp_frgn_master
frgn_master
;
bmc_store_frgn_master
(
ppi
,
&
frgn_master
,
buf
,
len
);
...
...
proto-standard/state-slave.c
View file @
e18b3f70
...
...
@@ -215,7 +215,7 @@ static int slave_handle_announce(struct pp_instance *ppi, void *buf, int len)
* Announce messages received on a masterOnly PTP Port shall not be considered
* in the operation of the best master clock algorithm or in the update of data sets.
*/
if
(
!
DSPOR
(
ppi
)
->
masterOnly
)
{
if
(
!
is_masterOnly
(
DSPOR
(
ppi
))
)
{
bmc_add_frgn_master
(
ppi
,
&
frgn_master
);
}
...
...
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