#!/bin/sh
#
# Steve Rosenbluth, JHCS, 9-21-1999
#
# Initialize or shutdown a PCMCIA daq device
#	this script doesn't do anything yet except prevent
#	failure beeps
#
# The first argument should be either 'start' or 'stop'.  The second
# argument is the base name for the device.
#
#

if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi

# Get device attributes
get_info $DEVICE

case "$ACTION" in

'start')
        #echo "got string $DRIVER"
    if [ "$DRIVER" = "das16s" ] ; then
	our_major=`cat /proc/devices | awk '$2=="das16s" {print $1}'`
	/bin/echo "found $DRIVER major number $our_major" >>/tmp/daq.txt		
	/bin/rm -f /dev/$DEVICE*
	/bin/mknod /dev/$DEVICE c $our_major 0
    elif [ "$DRIVER" = "daqtst" ] ; then
	our_major=`cat /proc/devices | awk '$2=="daqtsts" {print $1}'`
	/bin/echo "found $DRIVER major number $our_major" >>/tmp/daq.txt		
	/bin/rm -f /dev/$DEVICE*
	/bin/mknod /dev/$DEVICE c $our_major 0
    fi
    ;;
'check')
    echo "dummy check for $DEVICE"
    ;;

'cksum')
    echo "dummy cksum for $DEVICE"
    ;;

'stop')
    /bin/rm -f /dev/$DEVICE
    /bin/echo "stopped $DEVICE" >>/tmp/daq.txt		
    ;;

'suspend')
    echo "dummy suspend for $DEVICE"
    ;;

'resume')
    echo "dummy resume for $DEVICE"
    ;;

*)
    ;;
esac

exit 0
