Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Mar 2000 16:24:49 +0530
From:      Nanda Kumar <nanda@procsys.com>
To:        Mike Smith <msmith@freebsd.org>
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: IOCTL support in SCSI block driver
Message-ID:  <38BE4879.F41@procsys.com>
References:  <200003010807.AAA04798@mass.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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