#!/bin/bash
RET=0
/sbin/modprobe isdn
case "$PROTOCOL" in
    1tr6)   PROTOCOL_NR=1 ;;
    euro)   PROTOCOL_NR=2 ;;
    leased) PROTOCOL_NR=3 ;;
    ni1)    PROTOCOL_NR=4 ;;
    *)      PROTOCOL_NR=2 ;;
esac
/sbin/modprobe --ignore-install ${DRV} protocol=${PROTOCOL_NR}
get_first_free_idx
/sbin/modprobe --ignore-install ${DRV_CS}
RET=$?
if [ $RET -eq 0 ]; then
	start_isdnlog $free_idx ${CONTR}
	echo "$free_idx" > /var/run/pcmcia_isdn_${MODALIAS}.idx
	if [ -n "$EAZMAP" ]; then
		get_i4l_id $free_idx
		/sbin/isdnctrl mapping $card_id $EAZMAP >& /dev/null
	fi
fi
