From owner-freebsd-scsi Thu Mar 2 2:49:54 2000 Delivered-To: freebsd-scsi@freebsd.org Received: from procsys.com (PPP-190-104.bng.vsnl.net.in [203.197.190.104]) by hub.freebsd.org (Postfix) with SMTP id E51A937C01A; Thu, 2 Mar 2000 02:49:41 -0800 (PST) (envelope-from nanda@procsys.com) Received: from nanda ([192.168.1.70]) by procsys.com with SMTP; Thu, 02 Mar 2000 16:22:21 +0800 Message-ID: <38BE4879.F41@procsys.com> Date: Thu, 02 Mar 2000 16:24:49 +0530 From: Nanda Kumar Reply-To: nanda@procsys.com X-Mailer: Mozilla 3.01Gold (Win95; I) MIME-Version: 1.0 To: Mike Smith Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: IOCTL support in SCSI block driver References: <200003010807.AAA04798@mass.cdrom.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, I went through the mylex code to find how they implement the control interface. But i have some doubts regarding this. Mainly these doubts come since i am still quiete new to the FreeBSD world and don't have good text books regarding how to write device drivers etc. 1). In the user space how do i specify a controller to communicate with that ? For eg. if i want to open the device and a send an IOCTL how do i specify that ? In our case actual disks will be seen as part of target discovery done through the CAM SCSI interface. 2). I found that the while registering the character device the "softc" structure does not come to picture at all. But later while opening the device the "softc" structure is obtained using "devclass_get_softc". How is it obtained ? If there are some documents regarding these you can tell me and i will go through it. Regards, Nandan >Mike Smith wrote: > > > > No. The key issue here, and one that you still haven't answered is: Does > > > your RAID device take SCSI commands, or does it have a different > > > interface? > > > > Our RAID device takes SCSI commands. Typically the parameters passed to > > the firmware includes SCSI CDB,path id,target id,LUN number,data > > direction flag,SCSI tag queing attribute,data buffer pointers etc. > > Status returned consists of SCSI status and sense information. > > Ok. In that case, you're right on the target for using CAM. > > > But my driver should also handle the IOCTL support for proprietary > > communication which will be used by a JAVA based Array Manager program > > for the purpose of getting statistics and configuring the card. Can i > > pass IOCTLs directly to the HAB SCSI CAM driver ? > > No. You will want to create a per-adapter device instance that takes the > bus/target/lun information and passes it along with the ioctl data to the > firmware. You can see an instance of this in the Mylex driver I > referenced previously. > > > I want to avoid writing another character driver just for the sake of > > IOCTL handling we could do this in Linux and Windows NT. > > You don't need another entire driver; just a few extra lines to > instantiate a control interface node for the adapter. > > -- > \\ Give a man a fish, and you feed him for a day. \\ Mike Smith > \\ Tell him he should learn how to fish himself, \\ msmith@freebsd.org > \\ and he'll hate you for a lifetime. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message