Subject: Re: Howto: Configure device that needs access to multiple busses
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 06/29/2006 17:07:37
> I'm writing a device driver for a device that has i/o on both the ISA
> bus and on a GPIO pin. Obviously I need to map handles for both
> busses so I can do I/O for the device, but I don't know how to write
> the CONFIG file entry for the device.
There may be some better way to represent it, but what I'd probably do
is to make it two devices from the point of view of config. Those two
device's drivers would then have some private form of communication
between themselves. I'd probably make both drivers just thin glue
layers in front of a single shared file that contained all the real
guts for both (the latter being compiled based on a attribute attached
to each of the other devices, and with care taken to make sure it does
something sensible if only one of the devices is configured in), but
there are doubtless other ways to do it.
You might want to look at the way wscons is put together; that has
cases where things that appear in disparate parts of the autoconfig
tree - keyboards and displays - need to be stuck together.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML email@example.com
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B