Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2004 00:29:37 -0500 (EST)
From:      John Linwood Griffin <griffin2+freebsd-scsi@ece.cmu.edu>
To:        Chhavi Kansal <chhavi_kansal@yahoo.com>
Cc:        freebsd-scsi@freebsd.org
Subject:   Re: FreeBsd 4.7: scsi target device driver
Message-ID:  <Pine.LNX.4.53L-ECE.CMU.EDU.0401080014330.20747@glee.pdl.cmu.edu>
In-Reply-To: <20040108045209.38601.qmail@web21509.mail.yahoo.com>
References:  <20040108045209.38601.qmail@web21509.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
To reiterate Chuck's question, could you state exactly how you intend to
use the system?  Your statement of "probing the SCSI devices connected to
the host" almost sounds like you're talking about using SCSI passthrough,
not SCSI target-mode.

I agree that it's frustrating to go from writing Linux modules to thinking
about FreeBSD modules (I looked at writing FreeBSD modules briefly, and
then threw my hands up in the air and decided to go another route).
However, in my experience the existing scsi_target kernel-mode and
user-mode code division results in a pretty flexible setup -- and give
much of the benefits of using a module:

- You can start and stop the user-mode code at will, similar to loading
and unloading a module.  You can also recompile the user-mode code and
restart it without rebooting the system.  (Of course, you can't do this
for the kernel code without a module; perhaps that's what you want...)

- Every time you start the user-mode code (from
usr/share/examples/scsi_target) you specify which LUN on which device on
which bus you're emulating, which is similar to passing options at module
load time.

Anyway, before you commit yourself to slogging through building a new
module, I recommend taking another look at the existing
sys/cam/scsi/scsi_target code and the usr/share/examples/scsi_target
user-mode code to see if they can't be adapted to your purposes.  At a
minimum, perhaps you'll only need to rewrite the user-mode code.


On Wed, 7 Jan 2004, Chhavi Kansal wrote:

> Hi All,
> I am in the process of writing a scsi target driver on FreeBSD 4.7,
> as a module.  I have faced some problems like, registering the
> module with CAM, probing the scsi devices connected to the host etc.,
> I'm from the world of linux, wherein if I register the scsi device
> driver module ( not the HBA ), using scsi_register_module(...)
> I will get the Scsi_Device *SDp to my template implementations
> like init, detect, attach, detach, finish.
>
> On FreeBSD, there must be the way to do the same kinda thing,
> by registering my module with CAM layer.  If anyone could
> throw some light, that would be of great help.
> Thanks in advance,
> Chhavi Kansal.
>
>
>
> ---------------------------------
> 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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.53L-ECE.CMU.EDU.0401080014330.20747>