Subject: Re: SC_DEBUG macros + major numbers + conf.c
To: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: netbsd-help
Date: 01/31/1995 14:43:40
> Next, I'm using major 18:
> 
> 	cdev_disk_init(NSD,sd),		/* 13: SCSI disk */
> 	cdev_tape_init(NST,st),		/* 14: SCSI tape */
> 	cdev_disk_init(NCD,cd),		/* 15: SCSI CD-ROM */
> 	cdev_lpt_init(NLPT,lpt),	/* 16: parallel printer */
> 	cdev_ch_init(NCH,ch),		/* 17: SCSI autochanger */
> 	cdev_sj_init(NSJ,sj),		/* 18: SCSI scanner */
> 	cdev_notdef(),			/* 19: unused */
> 
> (2) Is this OK to use?  Is there an offical registry?

umm, there's an official registry, but we only assign entries in it
when and if a driver becomes part of our source tree.  (don't want to
have to GC it for "expected software" that never showed up.)


> rawread() in kern_physio.c is not good enough for me.  Scanner's need a
> "trigger" operation and experience shows that open(2) is an awful place
> for it.  I added rawsjread to sj.c (my driver) but I had to dork conf.c
> up the butt with:
> 
> cdev_decl(sd);
> cdev_decl(st);
> cdev_decl(sj);
> int	rawsjread();		/* XXX where does this really go? */
> cdev_decl(cd);
> cdev_decl(mcd);
> cdev_decl(vn);
> 
> (3) What is the proper way to extend cdev_decl(sj)?

you probably want to clone "cdev_decl" into a "cdev_sj_decl" and
extend it as appropriate.

and then do the obvious thing when creating a cdev_sj_init (i.e. use
it's read routine).


cgd