Subject: Re: prototype in GENERIC for APC UPS?
To: Martin Husemann <martin@duskware.de>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 04/23/2007 10:57:46
On Mon, 23 Apr 2007 16:50:29 +0200
Martin Husemann <martin@duskware.de> wrote:

> On Mon, Apr 23, 2007 at 10:43:12AM -0400, Steven M. Bellovin wrote:
> > I wonder if we should include a commented-out line like this in the
> > GENERIC config file:
> > 
> > 	# Detect APC UPS as ugen instead of uhid
> > 	#ugen*   at uhub? port ? vendor "0x051d" flags 1
> > 
> > and perhaps others if appropriate.
> 
> Why don't we have a list inside ugen.c that it matches against the
> device and returns UMATCH_GENERIC+1 if it finds a known "this should
> be ugen" device?
> 
Wouldn't we have to change a bit more?  Ugen is currently scanned
last, I thought; for that, we'd have to have it scanned first for
cases like these, and again at the end for devices not matched by
something else, right?

In principle, you're right, though I'd prefer a scheme where such a
table can be loaded and modified dynamically.  One shouldn't have to
change a kernel config file or (worse yet) change kernel source to
handle a situation like this.  

More philosophically, putting the special knowledge in a config file
instead of in a kernel source file is a bit cleaner -- users have to
change less in the source tree to handle such things.  I like to have a
read-only /usr/src -- my config files are in ~/sys -- because it makes
upgrading to a new release a lot easier.



		--Steve Bellovin, http://www.cs.columbia.edu/~smb