Re: NM & ath0 trouble

On Thu, 2006-01-05 at 11:01 -0500, Dan Williams wrote:

> So in the 3rd Edition of your book, Robert, can you pleasepleaseplease
> add a chapter for "Making your driver play nice with others, including
> HAL" that has a section on what to do to get the correct sysfs entries,
> ie stuff like SET_NETDEV_DEV and ensuring the sysfs 'driver' link is
> correct by passing the correct driver structure to the device init
> routines (which I believe is SET_MODULE_OWNER)?
> It seems there's complete lack of documentation on how to make drivers
> interact with sysfs.

God, yes.

Linux drivers are absolutely horrid and networking is the worst
subsystem and wireless the worst grouping therein.  Just terrible.

But the problem really lies on three issues

	(a) No documentation.  Driver writers do not know what to do
	    or how to do it.
	(b) Incomplete implementation in current kernels, so driver
	    writers "roll their own" solution.  Nice in the short-term,
	    awful in the longer term.
	(c) Other kernel hackers and some users just don't care.  Until
	    things like HAL, g-v-m, and NM, the need for a unified API
	    just was not there.

And there is one other concern, broader in scope: People simply do not
treat sysfs as API--immutable and important--in the same way they treat
system calls or even, for that matter, device nodes.

I added a brief sysfs section to the 2ed, but it was largely a "sysfs
internals" -- how to hack the sysfs code, not work with sysfs in your
own driver.  A 3ed will surely do better.

Also, I think Linux Device Drivers 3ed has a decent treatment of this
material.  But probably not enough.

We really need to outline MANDATORY behavior and MANDATORY sysfs entries
that all drivers need support.  It is a lot of work to document all of

But, damn, we need it.

	Robert Love

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]