Where should devctl notifications be sent from?

Nik Clayton nik at freebsd.org
Sat Mar 27 00:55:47 PST 2004


Apologies in advance if this is too trivial for -arch.

I'm trying to work out where it's appropriate to add devctl
notifications.

The specific problem I'm trying to solve involves an iPod connected
through firewire.  I'd like to be able to have devd be notified when the
iPod arrives, so that various processes can kick off automatically.  In
an ideal world, I'll drop the iPod in the dock, and some backup
processes start, thereby allowing me to justify the purchase of a model
several sizes larger than I actually need :-)

It looks like there are several places where the devctl_queue_data() and
related calls could be placed:

    firewire(4) -- when the device is plugged in
    fwohci(4) -- when the interface arrives
    sbp(4) -- when it's recognised as a mass storage device
    geom(4) -- when geom creates the device (/dev/da2 (and da2s2) in my
               case).  Robert Watson has a patch that implements this.
    devfs -- specifically, in make_dev(9) and destroy_dev(9)

The limited research that I've done suggests that the most generic place
to put this code is inside make_dev(9) and destroy_dev(9).  But this
seems so trivial that I can't believe no one else hasn't done the work,
so I figure there's probably something important that I'm missing.

N
-- 
FreeBSD: The Power to Serve      http://www.freebsd.org/               (__)
FreeBSD Documentation Project    http://www.freebsd.org/docproj/    \\\'',)
                                                                      \/  \ ^
   --- 15B8 3FFC DDB4 34B0 AA5F  94B7 93A8 0764 2C37 E375 ---         .\._/_)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20040327/63a10141/attachment.bin


More information about the freebsd-arch mailing list