Re: New kernel/resource.c

David Hinds (dhinds@zen.stanford.edu)
Wed, 14 Jul 1999 13:01:25 -0700


On Wed, Jul 14, 1999 at 10:51:23PM +0300, Alon Ziv wrote:

> > This avoids the problem of defining a new API for passing resource
> > information to device drivers: they can just manipulate the driver
> > resource trees. The hardware tree will be populated by bus drivers:
> > the PCI subsystem, PnP, PCMCIA/CardBus, etc.
> >
>
> One problem still remains: that of telling the driver which physical
> device(s) it should control. And, a related problem, telling this to an
> already loaded driver (for hotplug &c).

True... when I said "avoids" above, I didn't mean that this should be
postponed indefinitely: just that I'd like for there to be continuity
in the kernel interfaces rather than major reorganizations that break
existing code. And so the changes can be done piecewise.

> It seems like we'll _have_ to introduce another initialization call to
> hotplug capable drivers, to inform them of the actual hardware they're
> controlling. One idea I had about it was that such drivers won't connect
> to the hardware in their `old-style' init function, but instead invoke
> some registration function (e.g., register_pci_driver()) to tell the
> system what hardware they support. The bus drivers will then invoke
> configuration calls on the driver and give it a list of pointers to
> resource records which belong to its hardware.

There is already some such code in the PCI drivers that have been
adapted to handle CardBus devices. I wrote the API with some
attention to what might be useful for a more general device manager,
but it should be given more thought.

> BTW, with all this talk about hotplug and such, I haven't seen any
> suggestions for solving the problem of persistently mapping the physical
> hardware to logical device numbers; we need some way to have the system
> allocate the same major/minor number to the same hardware whenever it's
> used... Any ideas?

For PCMCIA/CardBus devices, the issue is moot: I provide configuration
tools that manipulate devices based on what or where they are, rather
than their device names / minor numbers. So a config script describes
how to configure "the ethernet card in socket 0", or "the ethernet
card with hw address xx:yy:zz:aa:bb:cc" or "the IDE drive with serial
number 1234567".

-- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/