All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kristian Hogsberg <hogsberg@users.sourceforge.net>
To: linux-hotplug@vger.kernel.org
Subject: Hotplug scripts for ieee1394
Date: Sun, 16 Sep 2001 17:29:07 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-100066152014337@msgid-missing> (raw)

Hi linux-hotplug maitainers,

I've added hotplug support to the ieee1394 subsystem. From
linux-2.4.10 the ieee1394 bus driver calls /sbin/hotplug to load
drivers and depmod from modutils-2.4.9 will generate
/lib/modules/x.x.x/modules.ieee1394map.  The missing link is
/etc/hotplug/ieee1394.agent.

I copied over usb.agent and changed it to work with the IEEE1394
hotplug events, the result is the ieee1394.agent draft included below.
Could you include this into the linux-hotplug distribution?

Kristian


#!/bin/bash
#
# IEEE1394-specific hotplug policy agent.
#
# This should handle 2.4.* IEEE1394 hotplugging, with a consistent
# framework for adding device and driver specific treatments.
#
# Kernel IEEE1394 params are:
#	
#	ACTION­d or remove
#	VENDOR_ID$ bit vendor id
#	GUIDd bit globally unique id
#	SPEFICIER_ID$ bit id of owner of specification
#	VERSION=version of specification
#
# See IEEE1212 for details on these parameters.

. hotplug.functions

# generated by modutils, for current 2.4.x kernels
MAP_CURRENT=$MODULE_DIR/modules.ieee1394map

# accumulates list of modules we may care about
DRIVERS

# if called too early in booting, things break
# (bash creates tempfiles)
if touch /tmp/test.$$ >/dev/null 2>&1
then
	rm -f /tmp/test.$$
else
	mesg Need writable /tmp ...
	exit 1
fi

declare -i device_vendor_id device_specifier_id device_version
device_vendor_id="0x$VENDOR_ID"
device_specifier_id="0x$SPECIFIER_ID"
device_version="0x$VERSION"

declare -i MATCH_VENDOR_ID MATCH_SPECIFIER_ID MATH_VERSION
MATCH_VENDOR_ID=0x0001
MATCH_SPECIFIER_ID=0x0004
MATCH_VERSION=0x0008

#
# stdin is "modules.ieee1394map" syntax
# on return, ONE matching module was added to $DRIVERS
#
ieee1394_map_modules ()
{
    local module ignored
    declare -i match_flags vendor_id model_id
    declare -i specifier_id version

    # comment line lists (current) pci_device_id field names
    read ignored

    while read module match_flags vendor_id model_id specifier_id version
    do

	if [ $(($match_flags & $MATCH_VENDOR_ID)) -ne 0 -a $vendor_id -ne $device_vendor_id ]; then
	    continue
	fi

	if [ $(($match_flags & $MATCH_SPECIFIER_ID)) -ne 0 -a $specifier_id -ne $device_specifier_id ]; then
	    continue
	fi

	if [ $(($match_flags & $MATCH_VERSION)) -ne 0 -a $version != $device_version ]; then
	    continue
	fi

        DRIVERS="$module $DRIVERS"
	break
    done
}

#
# What to do with this IEEE1394 hotplug event?
#
case $ACTION in

add)
    # on 2.4 systems, modutils maintains MAP_CURRENT
    if [ -r $MAP_CURRENT ]; then
    	load_drivers ieee1394 $MAP_CURRENT "IEEE1394"
    fi

    if [ "$DRIVERS" = "" ]; then
	mesg "... no drivers for $LABEL"
	exit 2
    fi
    ;;

remove)
    ieee1394_map_modules < $MAP_CURRENT
    for MODULE in $DRIVERS
    do
	if [ -x /etc/hotplug/ieee1394/$MODULE ]; then
            /etc/hotplug/ieee1394/$MODULE
	fi
    done
    ;;

*)
    mesg "IEEE1394 $ACTION event not supported"
    exit 1
    ;;

esac



_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

             reply	other threads:[~2001-09-16 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-16 17:29 Kristian Hogsberg [this message]
2001-09-16 18:33 ` Hotplug scripts for ieee1394 Greg KH
2001-09-16 20:10 ` David Brownell
2001-09-16 21:32 ` Kristian Hogsberg
2001-09-16 21:39 ` David Brownell
2001-09-16 21:47 ` David Brownell
2001-09-16 22:33 ` Ben Collins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-100066152014337@msgid-missing \
    --to=hogsberg@users.sourceforge.net \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.