From owner-freebsd-scsi@FreeBSD.ORG Wed Jan 7 09:26:02 2004 Return-Path: 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 345B716A4CE for ; Wed, 7 Jan 2004 09:26:02 -0800 (PST) Received: from msgbas1x.net.europe.agilent.com (msgbas1x.net.europe.agilent.com [192.25.19.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85B0B43D41 for ; Wed, 7 Jan 2004 09:26:00 -0800 (PST) (envelope-from chuck_tuffli@agilent.com) Received: from relcos2.cos.agilent.com (relcos2.cos.agilent.com [130.29.152.237]) by msgbas1x.net.europe.agilent.com (Postfix) with ESMTP id 6BC351A78; Wed, 7 Jan 2004 18:25:59 +0100 (MET) Received: from rtl.rose.agilent.com (rtl.rose.agilent.com [130.30.179.189]) by relcos2.cos.agilent.com (Postfix) with ESMTP id 4EEAB368; Wed, 7 Jan 2004 10:20:56 -0700 (MST) Received: from cre85086tuf.rose.agilent.com (cre85086tuf [130.30.174.150]) ESMTP id JAA18846; Wed, 7 Jan 2004 09:20:54 -0800 (PST) Received: by cre85086tuf.rose.agilent.com (Postfix, from userid 1001) id 93D6019E2A6; Wed, 7 Jan 2004 09:20:02 -0800 (PST) Date: Wed, 7 Jan 2004 09:20:02 -0800 From: Chuck Tuffli To: Chhavi Kansal Message-ID: <20040107172002.GD9945@cre85086tuf.rose.agilent.com> References: <20040107161605.95908.qmail@web21501.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040107161605.95908.qmail@web21501.mail.yahoo.com> User-Agent: Mutt/1.4i cc: freebsd-scsi@freebsd.org Subject: Re: scsi_target driver on FreeBSD 4.7 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2004 17:26:02 -0000 On Wed, Jan 07, 2004 at 08:16:05AM -0800, Chhavi Kansal wrote: > Hi all, > I want to write a scsi target driver to send some vendor > specific commands to the scsi disk. For that I have modified the Uh, who is sending the commands? Is the initiator sending a vendor specific command that the target driver passes along to the disk? Or, is the CAM/SIM driver receiving a command and translating it into a vendor specific command? Can you describe your setup a little bit more? > scsi_target.c. But it doesn't seems to be loading properly. I've > given printf's to all the functions. But it doesn't printing the > printf for init() function itself. Which HBA are you using (QLogic, ...)? Is the backing store the SCSI Disk Emulator (share/examples/scsi_target) or something else? > Do you have any idea, if I need to add anything in the existing > scsi_target.c available in sys/cam/scsi dir. > > How can we register a scsi driver module to the cam interface. It looks very similar to the initiator case that is documented (i.e. xpt_bus_register()). One difference is that the driver needs to set the target_sprt variable in the ccb->cpi structure. See the isp(4) driver for an example. > Is there any document where I can look to the flow of the driver calls. ? Use the code ;) I'm not 100% sure on this, but my understanding is that the disk emulator tells the CAM target driver how many IO's it can handle by allocating and sending ccb_accept_tio structures to the driver via write(). Once the SIM driver receives a CDB, it copies the CDB info to one of the ATIO structures and completes the command with xpt_done(). > Any pointer would be of great help ... > > regards, > Chhavi > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > _______________________________________________ > freebsd-scsi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" -- Chuck Tuffli Agilent Technologies, Storage Area Networking