Re: Polymorphic devices

Brad Spencer <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
Iain Hibbert <[email protected]> writes:

> On Fri, 5 Jan 2024, Brad Spencer wrote:
>
>> I see a few options for doing this, such as simply matching all of the
>> possible children and using sysctl to enable the one you want.  Probably
>> followed by a rescan call.  That seems ugly, however.  The use of
>> 'drvctl -r -a <attribute>' seemed to hold promise.  It seems like a
>> better idea to require the detachment of whatever followed by the rescan
>> with the attribute indicating which sort of thing you wanted to attach
>> (detach ucom in favor of i2c, for example).  But I do not completely
>> understand if this sort of thing is possible.
>
> I don't see why it shouldn't be.. you attach your main driver as a bus, 
> then send it a message as to what configuration you need, then it 
> essentially rescans and finds and attaches or detaches sub-drivers as 
> appropriate.
>
> I did this sort of thing in software with bthub(4)
>
> iain

Thanks for that.  bthub(4) appears to be close to the idea I need.  I
will look at it in detail.



-- 
Brad Spencer - [email protected] - KC8VKS - http://anduin.eldar.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.