Commit 474fe4bf authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: add vlan support to assembly_ppsi_conf.sh

Specify vlans for ppsi in dot-config's field PORTXX_PARAMS.
Use ppsi_vlans for that, with a colon separated list.
PORTXX_PARAMS="...,ppsi_vlans=1:2:9"
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 5b878f0c
......@@ -300,11 +300,11 @@ config PORT01_PARAMS
default "name=wri1,proto=raw,tx=223896,rx=226310,role=slave,fiber=0" if TIME_BC
default "name=wri1,proto=raw,tx=223896,rx=226310,role=master,fiber=0"
help
This item, and the following ones, are used to assign the
This item, and the following ones, are used to assign the tx and rx
constant delays (likely from calibration), protocol type (raw or udp),
port roles and type of fiber (number referring to the corresponding
FIBERXX_PARAMS) for each of the ports. Please refer to
the user manual for more information.
port roles, type of fiber (number referring to the corresponding
FIBERXX_PARAMS) and vlan configuration of PPSi for each of the ports.
Please refer to the user manual for more information.
"role" can be one of the following:
- master - configure port as a master
- slave - configure port as a slave
......@@ -314,6 +314,9 @@ config PORT01_PARAMS
not in DB, copper SFP connected, non 1GB SFP etc.
- none - disable White Rabbit and PTP on a portdisable White Rabbit
on a port, keep PTP
ppsi_vlans - colon separated list describing which vlans shall be
assigned to the particular ppsi instance
config PORT02_PARAMS
string "Parameters for port 2"
......
......@@ -647,6 +647,9 @@ value is changed by the web interface, proper action is taken.
(@t{CONFIG_FIBERXX_PARAMS})
should be used for a fiber connected to
a particular port
@item @t{ppsi_vlans} -- colon separated list describing which
vlans shall be assigned to the
particular ppsi instance
@end itemize
Most likely the default values work for you.
......
......@@ -25,6 +25,7 @@ for i_zero in {01..18};do
unset p_name
unset p_proto
unset p_role
unset p_ppsi_vlans
# parse parameters
param_line=$(eval "echo \$CONFIG_PORT"$i_zero"_PARAMS")
IFS_OLD=$IFS
......@@ -36,13 +37,19 @@ for i_zero in {01..18};do
do
# split pairs
IFS='=' read param value <<< "$pair"
case $param in
case "$param" in
"name")
p_name="$value";;
"proto")
p_proto="$value";;
"role")
p_role="$value";;
"ppsi_vlans")
p_ppsi_vlans="$value";;
"rx"|"tx"|"fiber")
continue;;
*)
echo "Invalid parameter $param in CONFIG_PORT"$i_zero"_PARAMS" ;;
esac
done
......@@ -66,8 +73,13 @@ for i_zero in {01..18};do
if [ -n "$p_role" ]; then
echo "role $p_role" >> $OUTPUT_FILE
fi
#hardcode whiterabbit as extension
#hardcode whiterabbit as extension even for non-wr
echo "extension whiterabbit" >> $OUTPUT_FILE
# add vlans
if [ -n "$p_ppsi_vlans" ]; then
mod_vlans=${p_ppsi_vlans//:/,}
echo "vlan $mod_vlans" >> $OUTPUT_FILE
fi
# separate ports
echo "" >> $OUTPUT_FILE
......
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