Re: [GIT]: Networking

Sam Ravnborg
2009-01-06T08:10:10Z

On Mon, Jan 05, 2009 at 10:07:42PM -0800, David Miller wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Tue, 6 Jan 2009 06:51:44 +0100
>
> > We should avoid a central file and push this information
> > out to the Kconfig files that are at the driver site.
> >
> > Then we can postprocess autoconf.h to get the filenames etc.
>
> I'll take this opportunity to once again promote my idea wherein build
> information (and perhaps other bits like firmware info) for a driver
> is encoded into the source of the driver itself, and the build system
> just extracts that stuff into Makefiles and whatnot at build time. :-)

One of the pratical issues I have with this is when to read which files.

What we could do is something like:

- during *config scan all "wildcard enabled" directories
and read the Kconfig info from the relevant .C files.
- record which .C files which included Kconfig and do
an automatic "scan + oldconfig" when one of these files
changes

When we add new Kconfig info to a file we would have
to manually do the *config to trigger a scan for the .C files

In the .C file we should restrict us to the first 100 lines or so
to have the Kconfig info to speedd up the 'parse' for this info.

Something like this:

/* Kconfig
config FOO
tristate "A self contained driver"
depends on USB
source mydriver-debug.c if DEBUG
modulename foobar
help
This is a driver for ...
*/

The source file where this info is contained is implicit a source
of this module.
And if we can convince the firmware guys then the firmware info could
be included in the same section.

Sam