Where should devctl notifications be sent from?

From: Nik Clayton (nik_at_freebsd.org)
Date: 03/27/04

  • Next message: Cyrille Lefevre: "Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin)"
    Date: Sat, 27 Mar 2004 08:55:37 +0000
    To: arch@freebsd.org
    
    
    

    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 message: Cyrille Lefevre: "Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin)"

    Relevant Pages

    • devctl attach/detach notification for disks
      ... I'm working on a bit of code to get devctl notifications for attaching ... when a disk is attached or removed from the system. ... struct g_provider *pp; ...
      (freebsd-hackers)
    • Re: Where should devctl notifications be sent from?
      ... I'd like to be able to have devd be notified when the ... iPod arrives, so that various processes can kick off automatically. ... so the firewire driver's doing the right thing as ... device notifications, and directories for other events. ...
      (freebsd-arch)
    • Re: devctl (alike?) for devfs
      ... Is it possible to get notifications about changes in devfs - appearance ... devctl currently notifies about real devices handled by ... Or if I want to monitor appearance and disappearance of ad* and da* ...
      (freebsd-hackers)