Subject: Re: Call for review: The New Block/Character Device Switch
To: None <matt@3am-software.com>
From: MAEKAWA Masahide <maekawa@math.sci.kobe-u.ac.jp>
List: tech-kern
Date: 06/28/2001 22:55:49
Matt Thomas <matt@3am-software.com> wrote:
>>- What do you think that many macros for each devices are defined in
>>sys/conf.h
>> or machine/conf.h? In addition, in order to use that macros compels us to
>> define many new functions same as nullop/enodev and kludge aliases.
>
>Shouldn't be needed; but they do make prototypes easier.
Yes. But we should consider which is useful or not, I think.
>>The bdevsw/cdevsw tables are dealed with in the abstract to support
>>to attach/detach the bdevsw/cdevsw data dynamically. Each drivers should
>>use devsw_get(9) and devsw_lookup(9) to get the device interface instead of
>>accessing them directly.
>
>decsw_get I like. Not sure about devsw_lookup. It seems hackish.
In some ports we must generate dev_t from the devsw name at
the boot time, right?
(yes, after applied my patch, still remain hard-coding of majors...)
>>In order to support this feature, add the new grammer 'device-switch'
>>to 'files'. In my current implementation, all 'device-switch' is in
>>the new file 'devsw.<arch>' under sys/arch/<arch>/conf.
>
>Sigh. Another file.
Now devsw.<arch> is included from files.<arch>.
Should 'device-switch'es be just in files.<arch>?
Even so, I can change very easily. ok. No problems.
>And are placed in ioconf.c? or someplace else?
I'm not sure...
>Somehow I think this needs to connected to struct cfdriver but
>the don't exist for pseudo-devices (maybe they should).
I think so.
>>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.)
>
>Does really need to be in the devsw? Considering how little it will
>be used, it could be calculated and would allow the devsw to read-only.
Now I am trying to remove this field. Just wait for a moment.
>options are like pty or fd or scsibus?
Yes.
>If you have multi device-switch for the same name, will the latter
>take priority?
Sorry, I don't think of an example sooner...
Could you show me an example?
--- MAEKAWA Masahide