Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PPSi
Manage
Activity
Members
Labels
Plan
Issues
55
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
PPSi
Commits
1038075c
Commit
1038075c
authored
1 year ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
arch-wrs/wrs-startup: when switching a profile, set the default values defined by the new profile
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
76821197
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch-wrs/wrs-startup.c
+53
-0
53 additions, 0 deletions
arch-wrs/wrs-startup.c
include/ppsi/ppsi.h
+11
-0
11 additions, 0 deletions
include/ppsi/ppsi.h
tools/ppsi_conf.c
+4
-0
4 additions, 0 deletions
tools/ppsi_conf.c
with
68 additions
and
0 deletions
arch-wrs/wrs-startup.c
+
53
−
0
View file @
1038075c
...
...
@@ -257,6 +257,50 @@ static int set_extension(struct pp_instance *ppi, int extension)
return
0
;
}
static
void
set_profile_params
(
struct
pp_instance
*
ppi
)
{
/* When switching a profile, set the default values for the new profile. */
/* For don't change any parametres when switching to
* PPSI_PROFILE_CUSTOM */
if
(
ppi
->
cfg
.
profile
==
PPSI_PROFILE_CUSTOM
)
{
/* Don't change parameters for the custom profile */
return
;
}
if
(
!
is_profile_supported
(
ppi
->
cfg
.
profile
))
{
/* Profile not supported */
return
;
}
if
(
DSPOR
(
ppi
)
->
logMinDelayReqInterval
!=
lut_profile_logMinDelayReqInterval_default
[
ppi
->
cfg
.
profile
])
{
pp_diag
(
ppi
,
config
,
1
,
"Seting logMinDelayReqInterval (current %d) to the default value (%d) for %s profile
\n
"
,
DSPOR
(
ppi
)
->
logMinDelayReqInterval
,
lut_profile_logMinDelayReqInterval_default
[
ppi
->
cfg
.
profile
],
lut_profile_name
[
ppi
->
cfg
.
profile
]);
set_param_inst_logMinDelayReqInterval
(
ppi
,
lut_profile_logMinDelayReqInterval_default
[
ppi
->
cfg
.
profile
]);
}
if
(
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
!=
lut_profile_logMinPdelayReqInterval_default
[
ppi
->
cfg
.
profile
])
{
pp_diag
(
ppi
,
config
,
1
,
"Seting logMinPdelayReqInterval (current %d) to the default value (%d) for %s profile
\n
"
,
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
lut_profile_logMinPdelayReqInterval_default
[
ppi
->
cfg
.
profile
],
lut_profile_name
[
ppi
->
cfg
.
profile
]);
set_param_inst_logMinPdelayReqInterval
(
ppi
,
lut_profile_logMinPdelayReqInterval_default
[
ppi
->
cfg
.
profile
]);
}
if
(
DSPOR
(
ppi
)
->
logSyncInterval
!=
lut_profile_logSyncInterval_default
[
ppi
->
cfg
.
profile
])
{
pp_diag
(
ppi
,
config
,
1
,
"Seting logSyncInterval (current %d) to the default value (%d) for %s profile
\n
"
,
DSPOR
(
ppi
)
->
logSyncInterval
,
lut_profile_logSyncInterval_default
[
ppi
->
cfg
.
profile
],
lut_profile_name
[
ppi
->
cfg
.
profile
]);
set_param_inst_logSyncInterval
(
ppi
,
lut_profile_logSyncInterval_default
[
ppi
->
cfg
.
profile
]);
}
}
static
void
set_l1sync_params
(
struct
pp_instance
*
ppi
)
{
/* Force mandatory attributes - Do not take care of the configuration */
...
...
@@ -288,6 +332,11 @@ static int set_profile(struct pp_instance *ppi, int profile, int extension,
/* Do not take care of L1SYNC */
enable_asymmetryCorrection
(
ppi
,
ppi
->
cfg
.
asymmetryCorrectionEnable
);
if
(
!
startup
)
{
set_profile_params
(
ppi
);
}
break
;
case
PPSI_PROFILE_HA_WR
:
...
...
@@ -319,6 +368,10 @@ static int set_profile(struct pp_instance *ppi, int profile, int extension,
}
}
if
(
!
startup
)
{
set_profile_params
(
ppi
);
}
if
(
CONFIG_HAS_EXT_L1SYNC
)
{
/* Set L1Sync params even for WR profile, since we allow
* configuration WR profile with L1Sync extension */
...
...
This diff is collapsed.
Click to expand it.
include/ppsi/ppsi.h
+
11
−
0
View file @
1038075c
...
...
@@ -464,6 +464,17 @@ extern void pdstate_set_state_pdetection(struct pp_instance * ppi);
extern
void
pdstate_set_state_pdetected
(
struct
pp_instance
*
ppi
);
extern
void
pdstate_enable_extension
(
struct
pp_instance
*
ppi
);
static
inline
int
is_profile_supported
(
int
profile
)
{
if
((
CONFIG_HAS_PROFILE_PTP
&&
profile
==
PPSI_PROFILE_PTP
)
||
(
CONFIG_HAS_PROFILE_HA_WR
&&
profile
==
PPSI_PROFILE_HA_WR
)
||
(
CONFIG_HAS_PROFILE_CUSTOM
&&
profile
==
PPSI_PROFILE_CUSTOM
))
return
1
;
return
0
;
}
/* Protocol extensions */
#include
"../proto-ext-whiterabbit/wr-api.h"
#include
"../proto-ext-l1sync/l1e-api.h"
...
...
This diff is collapsed.
Click to expand it.
tools/ppsi_conf.c
+
4
−
0
View file @
1038075c
...
...
@@ -103,6 +103,10 @@ void help(char *prgname)
" - sets the extension; extension has to be supported by a selected profile
\n
"
" --profile=<ptp|wr|ha|ha_wr|custom>
\n
"
" - sets the profile; ha_wr, ha and wr are the same profile
\n
"
" setting a profile (also to the current one) may change number
\n
"
" of attributes to its default values (not necessary the same
\n
"
" as defined in ppsi.conf);
\n
"
" changing a profile to custom does not change any parameters;
\n
"
" --sync-interval=<num>
\n
"
" - sets logarithm to the base 2 of the mean interval of sync
\n
"
" message transmission; used when a port is in Master state
\n
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment