Subject: Re: "esp" driver reorg proposal
To: Guenther Grau <s_grau@ira.uka.de>
From: Chris G. Demetriou <cgd@CS.cmu.edu>
List: tech-kern
Date: 01/27/1997 18:15:38
> Just one question, though. Why does the alpha have a seperate
> directory for each bus, whereas sparc and sun3x don't? Wouldn't
> it be more logical to have seperate directories for busses on
> all architectures? I just had a look at i386 and they have
> these directories as well. Or is there just one bus in sparc
> architectures and thus it didn't get a proper name? I ask
> this, because I know that SUN is working on PCI-based workstations,
> which would introduce another bus to the sparc architecture
> (besides S-bus (and M-bus?)).
> The same holds true for other architectures like the amiga, which
> has a single dev directory.
"That depends."
The way the MI code for ISA, EISA, PCI, and TurboChannel was done
requires each port to have its own directory for each of those busses
it supports (which is where the port's md interface header for the
bus goes, at minimum).
Some ports really do only have one bus to speak of, others have two
(or more) that are so closely related that it's not really worth
seperating them out.
config (before the cfattach changes) encouraged the 'one dev
directory' layout because you could only have one driver with a given
name. Therefore, if you wanted it to live on two busses then you
needed to pick exactly one location for it to live. In that world, it
can be argued that it's 'nicer' to have one big 'dev' directory.
In the 'multiple directories' world, you run still run into a problem
when you're trying to find someplace to put bus-independent device
driver code (i.e. drivers that attach to multiple busses). I solved
this by creating arch/alpha/common to hold such code. (Not a great
name, but i didn't want to stuff it in arch/alpha/alpha since i don't
really think 'normal' device driver stuff belongs there, and i didn't
want to put it into alpha/dev since the 'dev' name is used by lots of
ports to mean something different...)
There's also the question of "how many files are there." For
instance, in /sys/arch/alpha/pci there are ~45 files, all implementing
PCI bus interfaces and alpha-specific PCI device drivers... I figure
it's unreasonable to lump those 45 files in with the _1_ file
currently in eisa, or even the ~10 currently in isa; they'd get lost
in the noise... (eventually there should be more in 'eisa', but not
right now. 8-)
chris