FreeBsd 4.7: scsi target device driver
John Linwood Griffin
griffin2+freebsd-scsi at ece.cmu.edu
Wed Jan 7 21:30:13 PST 2004
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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
> To unsubscribe, send any mail to "freebsd-scsi-unsubscribe at freebsd.org"
>
More information about the freebsd-scsi
mailing list