Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2002 18:32:07 -0700 
From:      yiding_wang@agilent.com
To:        freebsd-scsi@freebsd.org
Subject:   Starting questions about FreeBSD PCI scsi driver.
Message-ID:  <334DD5C2ADAB9245B60F213F49C5EBCD019C7AB5@axcs03.cos.agilent.com>

next in thread | raw e-mail | index | archive | help
Hello There,

This is the first expecrience for me with FreeBSD and I am going to start making fuss here.

I am writing a drivers for iSCSI and FC PCI initiator as well as target ramdisk on FreeBSD, and just installed 4.7 and downloaded a few docs.  By looking into CVS, I got a few initial questions.  I will use Buslogic driver bt.c as an example.  For better understanding, any reference to scsi driver under Linux, Unixware. Solaris, SCO OS5 will be welcomed since I have written drivers for scsi / FC / iSCSI under those enviornments.

Here comes the first set of question:

1, I noticed that there are a few places drivers are spreaded.  For example
    /sys/dev/buslogic/bt.c, v
    /sys/dev/buslogic/bt_pci.c, v
    /sys/dev/buslogic/btreg.h, v

   and same files and others which cover same hardware are located at:
   /sys/i386/scsi/Attic/bt.c, v
   /sys/i386/scsi/Attic/btreg.h, v
   /sys/pci/Attic/bt9xx.c, v
   /sys/pci/Attic/bt_pci.c, v
   etc.

   Why these drivers are spreaded?  
   If I only have a pci initiator driver, can the source only be located under /sys/dev/vendor instead of also put some part of code under /sys/pci/Attic?

2, Does FreeBSD requires realmode driver to boot? Those bus (EISA, ISA, PCI) related subdirectories look like Solaris realmode driver distribution.

3, Where is proper place for driver source code?  If this driver does not intend for a boot device, can it be placed anywhere like other Unixes?

4, There are Makefiles for aic7xxx, e.g. under module, but nothing for bt.c.  Does that mean buslogic driver not supporting loadable module?

5, There are utility of "pkg_add" for driver loading, similar to Solaris, and "kldload" for module loading, similar to Linux.  Can I assume both methods work for scsi driver.  The difference will be kldload works only for this boot and module will be gone after "kldunload" or system reboot, but "pkg_add" will hook driver to kernel from boot to boot till pkg_delete is performed.  

6, If driver will be loaded with pkg_add, where are those related package required header files located?

7, Does FreeBSD support multi-initiator?  If it does, how the devices are scanned?  
    For example, if I have two card in the system.  During the xxx-probe routine, pci_get_devid(dev) is called.  Is this function being called once for every card by kernel or
    driver needs to call the function multi times to discover those cards?

8, If driver support character device too, how to determine the major number?  Assign it randomly by driver or assigned by kernel and can be retreaved by driver?

9, I don't see detailed driver structure and system function calls from man page as well as handbooks (e.g. pci_get_devid).  Where is the best place to get those information?

Many thanks!

Eddie (Yiding) Wang

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?334DD5C2ADAB9245B60F213F49C5EBCD019C7AB5>