#!/bin/sh

# Usage ./1-vmap-setup

# Hack to configure eth1 and eth2 with ipv4 addresses and eth2 with mac 00:90:1F:00:00:31
ifconfig eth1 192.168.20.3 && ifconfig eth2 10.0.0.31 && ifconfig eth2 hw ether 00:90:1F:00:00:31

# The script assigns a virtual address to each port in the system.
# Chassis Configuration Requirements:

#  Slot 0: XC-008 (Video encoder card)
#  Slot 1: XC-008 (Video encoder card)
#  Slot 2: XC-006 (Audio encoder card)
#  Slot 3: XC-007 (Host card)

XSBUTIL=/usr/local/bin/xsbutil

####################################################################
# VMRW: Assigns a virtual address to each port in the system.
####################################################################

cat vmap-slot0.hex | $XSBUTIL -p 88b4 eth2 F00
cat vmap-slot1.hex | $XSBUTIL -p 88b4 eth2 F01
cat vmap-slot2.hex | $XSBUTIL -p 88b4 eth2 F02
cat vmap-slot3.hex | $XSBUTIL -p 88b4 eth2 F03
