From owner-freebsd-scsi Tue Dec 3 23:11:52 2002 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E8EF37B401 for ; Tue, 3 Dec 2002 23:11:51 -0800 (PST) Received: from msgbas1x.cos.agilent.com (msgbas1x.cos.agilent.com [192.25.240.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E5C343EAF for ; Tue, 3 Dec 2002 23:11:50 -0800 (PST) (envelope-from yiding_wang@agilent.com) Received: from relcos2.cos.agilent.com (relcos2.cos.agilent.com [130.29.152.237]) by msgbas1x.cos.agilent.com (Postfix) with ESMTP id 20D4C136AF for ; Tue, 3 Dec 2002 18:32:09 -0700 (MST) Received: from axcsbh4.cos.agilent.com (axcsbh4.cos.agilent.com [130.29.152.145]) by relcos2.cos.agilent.com (Postfix) with SMTP id E4AB5472 for ; Tue, 3 Dec 2002 18:32:08 -0700 (MST) Received: from 130.29.152.145 by axcsbh4.cos.agilent.com (InterScan E-Mail VirusWall NT); Tue, 03 Dec 2002 18:32:08 -0700 Received: by axcsbh4.cos.agilent.com with Internet Mail Service (5.5.2653.19) id ; Tue, 3 Dec 2002 18:32:08 -0700 Message-ID: <334DD5C2ADAB9245B60F213F49C5EBCD019C7AB5@axcs03.cos.agilent.com> From: yiding_wang@agilent.com To: freebsd-scsi@freebsd.org Subject: Starting questions about FreeBSD PCI scsi driver. Date: Tue, 3 Dec 2002 18:32:07 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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