Subject: when bdev_xxx_init(c,n) is called ?
To: None <grefen@hprc.tandem.com>
From: Sera <esha@sharada.ncore.soft.net>
List: tech-kern
Date: 11/06/1998 11:58:53
Ground info : writing NetBSD/i386 device driver for JPEG card on PCI
bus.

I suppose that the init() entry point is called by the kernel
immediately after the system is booted, so that is provides the driver
with an opportunity to initialize the driver and the hardware as well as
to display messages announcing the presence of the driver and the
hardware. But the entry points for drivers in  conf.c don't have this
xxx_init().

1.But if you take an example like sd (SCSI Disk) then it has
bdev_disk_init(NSD,sd) (Is it because SCSC Disk belongs to disk category
it is initialized by bdev_disk_init() ? )


2. If so, then how many types of this init functions are there, or can
we have our own defined bdev_xxx_init() functions ?

3. When and where these bdev_xxx_init() functions are called ? Because I
found these bdev_xxx_init() functions as members of a struct 'bdevsw' in
the file /usr/src/sys/arch/i386/i386/conf.c

4. One last question... in /usr/src/sys/sys/conf.h there is a #define
defining  dev_init(c,n,t) as

((c) > 0 ? __CONCAT(n,t) : (__CONCAT(dev_type_,t)((*))) enxio)

this I could understand, but what is 'dev_type_  ' there ?


Thanx so much
Sera