Subject: Re: Call for review: The New Block/Character Device Switch
To: MAEKAWA Masahide <maekawa@math.sci.kobe-u.ac.jp>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 07/01/2001 16:36:43
At 01:25 PM 6/28/2001 +0900, MAEKAWA Masahide wrote:
>d_major         - An alias to the major number to avoid linear searching 
>tables
>                   (should be -1 in the source. In initialization phase or
>                    dynamically attach phase, filled out by proper value.)
>d_name          - An alias of bdevsw/cdevsw to search by name
>                   (should be same as a devbase and be null-teminated.)

I've been mulling this over for a while and I think the proper place for the
d_major number(s) is in the cfdriver struct.  cd_bmajor, cd_cmajor, cd_devsw.


>device-switch <name> chr <num> [blk <num>] [<options>]
>
>name            - The prefix of bdevsw/cdevsw entry (required)
>chr             - A character major number (required)
>blk             - A block major number (optional)
>options         - Conditions to determine whether should be attached or not
>                   (optional)

The more I ponder this, the less I like it.  Why extend the current

major { wd = 17 }

options are needed.  if you put a cfdriver for <name> in ioconf.c, you emit the
hooks for devsw as well.

major { wd = { block 17 } { char 27 } }

--
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message