#!/bin/sh
#
# ftl 1.18 1997/05/13 02:16:47 (David Hinds)
#
# Initialize or shutdown an FTL memory device
#
# The first argument should be the action to be performed, and the
# second, the base name for the device.
#
# The script passes an extended device address to 'ftl.opts' in the 
# ADDRESS variable, to retrieve device-specific configuration options.
# The address format is "scheme,socket,instance" where "scheme" is the
# current PCMCIA configuration scheme, "socket" is the socket number,
# and "instance" is used to number multiple partitions on a single
# card.
#

. ./shared

# Get device attributes
get_info $DEVICE

# Load site-specific settings
ADDRESS="$SCHEME,$SOCKET,$INSTANCE"
. $0.opts

case "$ACTION" in

'start')
    rm -f /dev/$DEVICE
    mknod /dev/$DEVICE b $MAJOR $MINOR
    add_blkdev /dev/$DEVICE || exit 1
    ;;

'check')
    fuser -s -m /dev/$DEVICE && exit 1
    ;;

'stop')
    rm_blkdev /dev/$DEVICE || exit 1
    rm -f /dev/$DEVICE
    ;;

'cksum')
    chk_simple "$3,$SOCKET,$INSTANCE" || exit 1
    ;;
    
'suspend'|'resume')
    ;;

*)
    usage
    ;;

esac

exit 0
