# labbot4_subsystem.sh: configures CAN interfaces for HIL tester labbot4-tester.zooxlabs.com
# @copyright: Highly Confidential and Proprietary Information. Copyright (c) Zoox
#
# Date Created: January 7, 2020
# Author: dparikh
#
# Author's note: defaults for labbot4-tester.zooxlabs.com

# Configure DR_CAN1
ip link set can0 name DR_CAN1
ip link set DR_CAN1 type can bitrate 500000 restart-ms 100
ip link set DR_CAN1 txqueuelen 4096
# Configure DR_CAN2
ip link set can1 name DR_CAN2
ip link set DR_CAN2 type can bitrate 500000 restart-ms 100
ip link set DR_CAN2 txqueuelen 4096
# Configure DR_CAN3
ip link set can2 name DR_CAN3
ip link set DR_CAN3 type can bitrate 500000 restart-ms 100
ip link set DR_CAN3 txqueuelen 4096
# Configure DR_CAN4
ip link set can3 name DR_CAN4
ip link set DR_CAN4 type can bitrate 500000 restart-ms 100
ip link set DR_CAN4 txqueuelen 4096
# Configure BDY_CAN1
ip link set can4 name BDY_CAN1
ip link set BDY_CAN1 type can bitrate 500000 restart-ms 100
ip link set BDY_CAN1 txqueuelen 4096
# Configure BDY_CAN2
ip link set can5 name BDY_CAN2
ip link set BDY_CAN2 type can bitrate 500000 restart-ms 100
ip link set BDY_CAN2 txqueuelen 4096
# Configure DIAG_CAN
ip link set can6 name DIAG_CAN
ip link set DIAG_CAN type can bitrate 500000 restart-ms 100
ip link set DIAG_CAN txqueuelen 4096
# Configure AI_CAN
ip link set can7 name AI_CAN
ip link set AI_CAN type can bitrate 500000 restart-ms 100
ip link set AI_CAN txqueuelen 4096
# Configure LUX_CAN
ip link set can8 name LUX_CAN
ip link set LUX_CAN type can bitrate 500000 restart-ms 100
ip link set LUX_CAN txqueuelen 4096
# Configure EMU_BDY_CAN2
ip link set can9 name EMU_BDY_CAN2
ip link set EMU_BDY_CAN2 type can bitrate 500000 restart-ms 100
ip link set EMU_BDY_CAN2 txqueuelen 4096
# Configure EMU_DR_CAN3
ip link set can10 name EMU_DR_CAN3
ip link set EMU_DR_CAN3 type can bitrate 500000 restart-ms 100
ip link set EMU_DR_CAN3 txqueuelen 4096
# Configure EMU_DR_CAN4
ip link set can11 name EMU_DR_CAN4
ip link set EMU_DR_CAN4 type can bitrate 500000 restart-ms 100
ip link set EMU_DR_CAN4 txqueuelen 4096
# Bring up all the interfaces
ifconfig DR_CAN1 up
ifconfig DR_CAN2 up
ifconfig DR_CAN3 up
ifconfig DR_CAN4 up
ifconfig BDY_CAN1 up
ifconfig BDY_CAN2 up
ifconfig DIAG_CAN up
ifconfig AI_CAN up
ifconfig LUX_CAN up
ifconfig EMU_BDY_CAN2 up
ifconfig EMU_DR_CAN3 up
ifconfig EMU_DR_CAN4 up
