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
3980379b
Commit
3980379b
authored
May 31, 2013
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set wr configuration at startup, according to /etc/ppsi.conf
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
77ac021b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
wrs-startup.c
arch-wrs/wrs-startup.c
+7
-4
hooks.c
proto-ext-whiterabbit/hooks.c
+30
-3
No files found.
arch-wrs/wrs-startup.c
View file @
3980379b
...
...
@@ -20,6 +20,7 @@
#include <ppsi/ppsi.h>
#include <ppsi-wrs.h>
#include "../proto-ext-whiterabbit/wr-api.h"
CONST_VERBOSITY
int
pp_diag_verbosity
=
0
;
...
...
@@ -115,16 +116,18 @@ int main(int argc, char **argv)
ppi
->
slave_only
=
1
;
}
/* FIXME set ppi ext enable as defined in its pp_link */
ppi
->
portDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
portDS
));
if
(
!
ppi
->
portDS
)
exit
(
__LINE__
);
ppi
->
portDS
->
ext_dsport
=
calloc
(
1
,
sizeof
(
struct
wr_dsport
));
if
(
!
ppi
->
portDS
->
ext_dsport
)
exit
(
__LINE__
);
/* The following default names depend on TIME= at build time */
ppi
->
n_ops
=
&
DEFAULT_NET_OPS
;
ppi
->
t_ops
=
&
DEFAULT_TIME_OPS
;
if
(
!
ppi
->
portDS
)
exit
(
__LINE__
);
}
if
(
pp_parse_cmdline
(
ppg
,
argc
,
argv
)
!=
0
)
...
...
proto-ext-whiterabbit/hooks.c
View file @
3980379b
...
...
@@ -21,10 +21,37 @@ static int wr_init(struct pp_instance *ppi, unsigned char *pkt, int plen)
static
int
wr_open
(
struct
pp_globals
*
ppg
,
struct
pp_runtime_opts
*
rt_opts
)
{
static
struct
wr_data_t
wr_data
;
/* WR-specific global data */
int
i
;
/* FIXME: used by arch-wrpc only; iface_name should be assigned
* in main in every arch*/
if
((
ppg
->
nlinks
==
1
)
&&
(
!
ppg
->
pp_instances
[
0
].
iface_name
))
ppg
->
pp_instances
[
0
].
iface_name
=
"wr1"
;
for
(
i
=
0
;
i
<
ppg
->
nlinks
;
i
++
)
{
struct
pp_link
*
lnk
=
&
ppg
->
links
[
i
];
struct
pp_instance
*
ppi
=
&
ppg
->
pp_instances
[
i
];
/* FIXME check if correct: assign to each instance the same
* wr_data. May I move it to pp_globals? */
ppg
->
pp_instances
[
i
].
ext_data
=
&
wr_data
;
if
(
lnk
->
ext
)
{
switch
(
lnk
->
role
)
{
case
1
:
WR_DSPOR
(
ppi
)
->
wrConfig
=
WR_M_ONLY
;
break
;
case
2
:
WR_DSPOR
(
ppi
)
->
wrConfig
=
WR_S_ONLY
;
break
;
default:
WR_DSPOR
(
ppi
)
->
wrConfig
=
WR_M_AND_S
;
}
}
else
WR_DSPOR
(
ppi
)
->
wrConfig
=
NON_WR
;
}
/* FIXME handle more ports */
ppg
->
pp_instances
[
0
].
iface_name
=
"wr1"
;
ppg
->
pp_instances
[
0
].
ext_data
=
&
wr_data
;
return
0
;
}
...
...
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