From owner-freebsd-scsi@FreeBSD.ORG Wed Jun 4 23:41:58 2003 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 01D3437B401 for ; Wed, 4 Jun 2003 23:41:57 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 0FB6F43F75 for ; Wed, 4 Jun 2003 23:41:57 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 26656 invoked by uid 1000); 5 Jun 2003 06:41:57 -0000 Date: Wed, 4 Jun 2003 23:41:57 -0700 (PDT) From: Nate Lawson To: Aniruddha Bohra In-Reply-To: <3EDD1302.6090102@cs.rutgers.edu> Message-ID: <20030604233659.V26654@root.org> References: <3ED3CCFF.4080507@cs.rutgers.edu> <20030602235514.J22029@root.org> <3EDD1302.6090102@cs.rutgers.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-scsi@FreeBSD.org Subject: Re: Emulating a SCSI device 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: Thu, 05 Jun 2003 06:41:58 -0000 On Tue, 3 Jun 2003, Aniruddha Bohra wrote: > Nate Lawson wrote: > >On Tue, 27 May 2003, Aniruddha Bohra wrote: > >> I am trying to write a SIM module for FreeBSD which basically > >>emulates a SCSI controller with a disk attached at target 0 lun 0. > > > >What is your hardware? Are you using sys/cam/scsi/scsi_target and > >src/share/examples/scsi_target? > > There is a LSI logic(mpt) SCSI controller in the system. However that is > immaterial as > I am trying to get a large memory buffer to act as a disk. > I would emulate a SCSI controller, so will handle the low level SCSI > commands myself by accessing the > memory. > > I will look at the above. I still am unclear about what you are trying to do. Are you trying to emulate an HBA? In that case, just take isp(4) or ahc(4) and strip things down to *_attach() and *_action(). > >> I go as far as the action function of the controller getting called > >>with a XPT_PATH_INQ - where I fill in the fake data. Which controller do you mean? You said above the controller is not relevant. > >> Nothing happens after that. I have looked for documentation > >>of how to get the psuedo disk attached to the da driver but did > >>not make much headway. > > > >You have to call xpt_done() on the CCB to send it back to the caller. > > I do that - Is there something special that I need to write in the ccb > header so that the caller > identifies the "device" as a disk ? Let's start over with you explaining what you are trying to do and I can give you an answer. -Nate