Skip to content

Commit

Permalink
fix(ptp): embed the setup_hsr.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
StaticRocket authored and praneethbajjuri committed Jan 8, 2025
1 parent a085272 commit d36b4f5
Showing 1 changed file with 47 additions and 5 deletions.
52 changes: 47 additions & 5 deletions source/linux/Industrial_Protocols/PTP/_PTP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1846,13 +1846,55 @@ each clock plays in this test is as follows:
Procedure
~~~~~~~~~

The script file
`setup\_hsr.sh <http://processors.wiki.ti.com/images/1/18/Setup_hsr.pdf>`__
and clock configuration files e.g. dut_1_hsr_oc.cfg, dut_2_hsr_oc.cfg,
dut_3_hsr_oc.cfg (each identical, same as listed in
`PTP Redundancy <Industrial_Protocols_PTP.html#redundancy-hsr-prp>`__
The script file :ref:`setup-hsr` and clock configuration files e.g.
dut_1_hsr_oc.cfg, dut_2_hsr_oc.cfg, dut_3_hsr_oc.cfg (each identical, same as
listed in `PTP Redundancy <Industrial_Protocols_PTP.html#redundancy-hsr-prp>`__
section for HSR) will be used in the setup of the tests.

.. code-block:: bash
:caption: setup_hsr.sh
:name: setup-hsr
#!/bin/bash
ETHA=eth2
MACA=70:FF:76:1C:18:09
ETHB=eth3
MACB=70:FF:76:1C:18:0A
RED_IP=192.168.8.3
########################################################
# Do not modify below
########################################################
HSR=hsr0
echo "ifconfig $ETHA hw ether $MACA"
ifconfig $ETHA hw ether $MACA
sleep 1
echo "ifconfig $ETHB hw ether $MACA"
ifconfig $ETHB hw ether $MACA
sleep 1
echo "ethtool -K $ETHA hsr-rx-offload on"
ethtool -K $ETHA hsr-rx-offload on
sleep 1
echo "ethtool -K $ETHB hsr-rx-offload on"
ethtool -K $ETHB hsr-rx-offload on
sleep 1
echo "ifconfig $ETHA up"
ifconfig $ETHA up
sleep 1
echo "ifconfig $ETHB up"
ifconfig $ETHB up
sleep 1
echo "ip link add name $HSR type hsr slave1 $ETHA slave2 $ETHB supervision 45 version 1"
ip link add name $HSR type hsr slave1 $ETHA slave2 $ETHB supervision 45 version 1
sleep 1
echo "ifconfig $HSR $RED_IP"
ifconfig $HSR $RED_IP
sleep 1
ifconfig $HSR
echo
echo "configured $HSR on $ETHA $ETHB"
- For each DUT-X, copy the setup script setup\_hsr.sh and the clock
configuration file dut\_X\_hsr\_oc.cfg into the target filesystem of
DUT-X. For the sample setup above
Expand Down

0 comments on commit d36b4f5

Please sign in to comment.