#! /bin/sh

TYPE=t1
TDDIN=1

finalize() {
	true
}

case $CARD in

t1isa|t1bisa)
        if [ "$TIOADDR" == "" ]; then
                LIOADDR=150
                LIRQ=5
		kick=0
		clinec="Please insert the appropriate values in columns 'io', 'irq' and 'cardnr'"
        else
                LIOADDR=$TIOADDR
                LIRQ=$TIRQ
		kick=1
		clinec="Columns 'io', 'irq' and 'cardnr' have been set via the dialog"
	fi
	cline1="t1isa           %F   %P    0x%I   %V       -       0"
	cline2=""
	ok=1
	;;
t1pci|t1bpci)
	cline1="t1pci           %F   %P    -       -       -       -"
	cline2=""
	clinec=""
	kick=1
	ok=1
	;;
*)	
	echo -e "\a\nUnknown or missing controller name:\n"
	echo -e "Expected: t1isa, t1bisa, t1pci or t1bpci.\n"
	ok=0
	;;
esac

if [ "$CARD" == "t1bisa" -o "$CARD" == "t1bpci" ]; then
	fwdss1=t1b.t4
	fw1tr6=t1b-1tr6.t4
else
	fwdss1=t1.t4
	fw1tr6=t1-1tr6.t4
fi

if [ $ok -eq 1 ]; then
	case $TFILE in
	dss1)   LFILE=$fwdss1
        	;;
	1tr6)   LFILE=$fw1tr6
        	;;
	*)      echo -e "\a\nNo firmware for $TFILE available!\n"
        	ok=0
	esac

	case $TPROTO in
	dss1)   LPROTO=DSS1
		HAVE_DDI=1
	        ;;
	1tr6)   LPROTO=1TR6
		HAVE_DDI=0
	        ;;
	*)      echo -e "\a\n$TPROTO is no supported protocol!\n"
        	ok=0
	esac
fi

echo -n "* Parameters: $TPROTO/$TFILE - " >> install.log
echo -n " protocol $LPROTO" >> install.log
echo " firmware $LFILE" >> install.log

