#!/bin/bash
# $Id: ccw.agent 269 2004-08-16 13:07:06Z hare $
# vim: syntax=sh
#
# CCW hotplug policy agent for Linux 2.6 kernels
#
# Kernel CCW hotplug params include:
#	
#	ACTION=%s [register or unregister]
#       CU_TYPE=%04x [CU type of the device]
#       CU_MODEL=%02x [CU model of the device]
#       DEV_TYPE=%04x [Devtype of the device]
#       DEV_MODEL=%02x [Devmodel of the device]
#       DEVPATH=%s [sysfs-path of the device]
#

# set -x

SYSFS=needed
cd /etc/hotplug
. hotplug.functions

CHAN_ID=${DEVPATH##*/}

case $ACTION in
    register|add)
	mesg "Configuring channel $CHAN_ID for event 'ccw'"
	hwup ccw-devpath-${SYSFS}${DEVPATH} -o hotplug fast
	;;

    unregister|remove)
        # Nothing to be done here ...
	exit 0
	;;

    *)
	debug_mesg CCW $ACTION event not supported
	exit 1 ;;

esac
