tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: autoconf question



On Fri, 4 Jul 2008, Quentin Garnier wrote:

That's what the attach args (aux) are for.  Have the parent enough

That and the interface attribute (the ia in the API).  If there are
two classes of child devices, that begs for different interface
attributes.  Please don't abuse the attach args for that.

Hmmm. Based on the docs available, I was under the impression that interface attributes were for the child to be able to attach to different parents. Such as the ld(4) driver attaching to all sorts of RAID controllers. In fact, one of the children of my driver is yet another (non-RAID) interface for ld.

So what I've got is

        device  sdhc: sdmmcbus
        attach  sdhc at pci with sdhc_pci
        file . . . .

        device  sdmmc { }
        attach  sdmmc at sdmmcbus
        file . . . .

        attach ld at sdmmc with ld_sdmmc
        file .../ld_sdmmc.c

        device flashcard at sdmmc
        file ...

When an instance of sdmmc attaches to the sdmmcbus (ie, a card is inserted), I want to attach an ld and a card-specific I/O driver for each "function" offered by the card. The configuration process seems only to evaluate the match of all possible children and picks the best one.

Since I need to have _two_ children, I can run config_match*() twice, but I need to have the ld driver get selected the first time, and the other driver selected on the second call.

I suppose I could make use of a pseudo-locator but that seems to me to be at least as ugly as passing a dont't-let-ld-match value in the attach_args.

----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul%whooppee.com@localhost   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette%juniper.net@localhost |
----------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index