Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Sep 2003 12:42:42 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Chuck Tuffli <chuck_tuffli@agilent.com>
Cc:        freebsd-scsi@freebsd.org
Subject:   Re: difference between scsi_target and scsi_targ_bh
Message-ID:  <20030917124026.Q12649@root.org>
In-Reply-To: <20030917173211.GB37253@cre85086tuf.rose.agilent.com>
References:  <20030917173211.GB37253@cre85086tuf.rose.agilent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 17 Sep 2003, Chuck Tuffli wrote:
> I'm in the process of trying to understand how the targ(4) emulator
> works from top to bottom and ran into some confusion over
> scsi_target.c vs. scsi_targ_bh.c. From Nate's README, it appears that
> you need both of these drivers for the target to work. What confuses
> me is that there seems to be some hefty overlap between the two. For
> example, the LUN enable/disable code is almost identical, the
> constructors are similar, and the "start" functions are similar.
>
> My questions are
> 1) are both scsi_target and scsi_targ_bh needed
> 2) if so what is the general difference
>
> Thanks!

The scsi_target kernel driver enables target mode and then passes CCBs
back and forth between a userland component.  The scsi_targ_bh driver
auto-attaches to any LUNs that are enabled but don't have a listener.  It
returns valid "device not here" reponses.  On isp(4), for instance, you
can't just enable one LUN.  The firmware enables all LUNs when it gets an
enable commands.  The scsi_targ_bh device handles the LUNs that you didn't
really want.

-Nate



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