From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kristian Hogsberg Date: Sun, 16 Sep 2001 17:29:07 +0000 Subject: Hotplug scripts for ieee1394 Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org 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: #=09 # ACTION=ADd or remove # VENDOR_ID$ bit vendor id # GUIDd bit globally unique id # SPEFICIER_ID$ bit id of owner of specification # VERSION=3Dversion of specification # # See IEEE1212 for details on these parameters. . hotplug.functions # generated by modutils, for current 2.4.x kernels MAP_CURRENT=3D$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=3D"0x$VENDOR_ID" device_specifier_id=3D"0x$SPECIFIER_ID" device_version=3D"0x$VERSION" declare -i MATCH_VENDOR_ID MATCH_SPECIFIER_ID MATH_VERSION MATCH_VENDOR_ID=3D0x0001 MATCH_SPECIFIER_ID=3D0x0004 MATCH_VERSION=3D0x0008 # # 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 $d= evice_specifier_id ]; then continue fi if [ $(($match_flags & $MATCH_VERSION)) -ne 0 -a $version !=3D $device_ver= sion ]; then continue fi DRIVERS=3D"$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" =3D "" ]; 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