linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Hotplug scripts for ieee1394
@ 2001-09-16 17:29 Kristian Hogsberg
  2001-09-16 18:33 ` Greg KH
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Kristian Hogsberg @ 2001-09-16 17:29 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Hotplug scripts for ieee1394
  2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
@ 2001-09-16 18:33 ` Greg KH
  2001-09-16 20:10 ` David Brownell
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2001-09-16 18:33 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Sep 16, 2001 at 07:29:07PM +0200, Kristian Hogsberg wrote:
> 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?

I just added it to cvs, thanks a lot for doing this!

It's looking like it's time for another linux-hotplug release, does
anyone have any outstanding issues that need to be addressed before I
make another release?

thanks,

greg k-h

_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Hotplug scripts for ieee1394
  2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
  2001-09-16 18:33 ` Greg KH
@ 2001-09-16 20:10 ` David Brownell
  2001-09-16 21:32 ` Kristian Hogsberg
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2001-09-16 20:10 UTC (permalink / raw)
  To: linux-hotplug

Way cool!

> I just added it to cvs, thanks a lot for doing this!

You barely beat me to it ... :)

I added a couple things to this.  The LABEL variable wasn't set, which
meant that "no such driver" diagnostics wouldn't be helpful.  I added
the ": case $expected $actual" statements to the match logic, so that
it's easier to use "sh -x" to debug things (as it is for the other agents).
And also tweaked the doc a little, so it's clear that 2.4.10 and the right
modutils are needed, and there's a HISTORY section.

Is there something that addresses the "cold-plugging" (boot time) init
of ieee1394/firewire/i-link/... devices, like the "usbmodules" command?

* Scenario:  firewire driver is statically linked, device is connected at boot
  time, but hotplugging won't behave since filesystems aren't ready yet.
* Solution:  a /etc/hotplug/ieee1394.rc script that scans the bus and
  issues fake hotplug events for those devices.

There could be other solutions of course.


> It's looking like it's time for another linux-hotplug release, does
> anyone have any outstanding issues that need to be addressed before I
> make another release?

I finally got around to integrating a bunch of the fixes from SuSE,
though not all of them.  It would be good to have the scripts sense
whether they're running on a RedHat-ish system or SuSE one, and
use the appropriate style admin scripts for (a) hotplug options, and
(b) network administration.  (Best to have distros agree more on
such stuff, but that's a bit out of scope for me ... :)

Unless someone else wants to volunteer to address those issues
in the near future, I think it's a fine time to release.  This one will
have the "fxload" utility (hotplugging can load EZ-USB FX/FX2
firmware), some of the SuSE support, bugfixes, IEEE1394, and
stuff I've forgotten ... should be interesting! :)

- Dave




_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Hotplug scripts for ieee1394
  2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
  2001-09-16 18:33 ` Greg KH
  2001-09-16 20:10 ` David Brownell
@ 2001-09-16 21:32 ` Kristian Hogsberg
  2001-09-16 21:39 ` David Brownell
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kristian Hogsberg @ 2001-09-16 21:32 UTC (permalink / raw)
  To: linux-hotplug

David Brownell <david-b@pacbell.net> writes:

> Way cool!
> 
> > I just added it to cvs, thanks a lot for doing this!
> 
> You barely beat me to it ... :)
> 
> I added a couple things to this.  The LABEL variable wasn't set, which
> meant that "no such driver" diagnostics wouldn't be helpful.  I added
> the ": case $expected $actual" statements to the match logic, so that
> it's easier to use "sh -x" to debug things (as it is for the other agents).
> And also tweaked the doc a little, so it's clear that 2.4.10 and the right
> modutils are needed, and there's a HISTORY section.

Nice, I knew I must have missed some details -- I'm not too familiar
with those shell-script details...

> Is there something that addresses the "cold-plugging" (boot time) init
> of ieee1394/firewire/i-link/... devices, like the "usbmodules" command?
> 
> * Scenario: firewire driver is statically linked, device is
>   connected at boot time, but hotplugging won't behave since
>   filesystems aren't ready yet.
> * Solution:  a /etc/hotplug/ieee1394.rc script that scans the bus and
>   issues fake hotplug events for those devices.
> 
> There could be other solutions of course.

Currently there is no such mechanism, the ieee1394 subsystem maintains
no /proc entries at the moment.  I'd like to add it eventually, but
currently it can't be supported easily.

Kristian


_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Hotplug scripts for ieee1394
  2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2001-09-16 21:39 UTC (permalink / raw)
  To: linux-hotplug

I provided some skeletal documentation:

http://linux-hotplug.sourceforge.net/?selected=ieee1394

As more information becomes available, it can easily be integrated.
The CONFIG_HOTPLUG page also now lists ieee1394 as one
of the hotpluggable subsystems.

There are a few "TBS" entries that should get completed.  I don't
know 1394, and my current kernel is only at pre2, so I'm not clear
what the answers should be.  For example, does 1394 probe()
drivers for its hotplugging (like PCI and USB), using the device_id
table entry that matches?  And pre2 doesn't seem to have docs on
the ieee1394 subsystem (in Documentation/*) so I just pointed
to the sf.net project.  (I'd rather have both ... :)

- Dave



_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Hotplug scripts for ieee1394
  2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
                   ` (3 preceding siblings ...)
  2001-09-16 21:39 ` David Brownell
@ 2001-09-16 21:47 ` David Brownell
  2001-09-16 22:33 ` Ben Collins
  5 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2001-09-16 21:47 UTC (permalink / raw)
  To: linux-hotplug

> > Is there something that addresses the "cold-plugging" (boot time) init
> > of ieee1394/firewire/i-link/... devices, like the "usbmodules" command?
> 
> Currently there is no such mechanism, the ieee1394 subsystem maintains
> no /proc entries at the moment.  I'd like to add it eventually, but
> currently it can't be supported easily.

OK, it's a known issue then.  Workaround is simple:  either re-plug,
or statically link the relevant drivers.  Providing subsystem status is a
significant issue, it's worth NOT rushing it ... :)

- Dave



_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Hotplug scripts for ieee1394
  2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
                   ` (4 preceding siblings ...)
  2001-09-16 21:47 ` David Brownell
@ 2001-09-16 22:33 ` Ben Collins
  5 siblings, 0 replies; 7+ messages in thread
From: Ben Collins @ 2001-09-16 22:33 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Sep 16, 2001 at 02:39:56PM -0700, David Brownell wrote:
> I provided some skeletal documentation:
> 
> http://linux-hotplug.sourceforge.net/?selected=ieee1394
> 
> As more information becomes available, it can easily be integrated.
> The CONFIG_HOTPLUG page also now lists ieee1394 as one
> of the hotpluggable subsystems.
> 
> There are a few "TBS" entries that should get completed.  I don't
> know 1394, and my current kernel is only at pre2, so I'm not clear
> what the answers should be.  For example, does 1394 probe()
> drivers for its hotplugging (like PCI and USB), using the device_id
> table entry that matches?  And pre2 doesn't seem to have docs on
> the ieee1394 subsystem (in Documentation/*) so I just pointed
> to the sf.net project.  (I'd rather have both ... :)

modutils should handle loading protocol drivers for ieee1394 devices
with Kristian's patches submitted to them. As for docs, I'll try to whip
some up this week. Thanks for the work guys. IEEE 1394 support seems to
be maturing nicely :)


Ben

-- 
 .----------====-=-===-=====-----------===------------=-=-----.
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=====------====-------------=-=-----=-==-===-------=--=---'

_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-09-16 22:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-16 17:29 Hotplug scripts for ieee1394 Kristian Hogsberg
2001-09-16 18:33 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).