#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/types.h>
#include <sys/bio.h>
#include <sys/conf.h>
#include <sys/devicestat.h>
#include <sys/malloc.h>
#include <sys/uio.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_periph.h>
#include <cam/cam_queue.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_debug.h>
#include <cam/cam_sim.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
Go to the source code of this file.
|
| __FBSDID ("$FreeBSD$") |
|
static | MALLOC_DEFINE (M_SCSIBH, "SCSI bh", "SCSI blackhole buffers") |
|
| TAILQ_HEAD (ccb_queue, ccb_hdr) |
|
static void | targbhasync (void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) |
|
static cam_status | targbhenlun (struct cam_periph *periph) |
|
static cam_status | targbhdislun (struct cam_periph *periph) |
|
static void | targbhdone (struct cam_periph *periph, union ccb *done_ccb) |
|
static struct targbh_cmd_desc * | targbhallocdescr (void) |
|
static void | targbhfreedescr (struct targbh_cmd_desc *buf) |
|
| PERIPHDRIVER_DECLARE (targbh, targbhdriver) |
|
static cam_status | targbhctor (struct cam_periph *periph, void *arg) |
|
static void | targbhdtor (struct cam_periph *periph) |
|
static void | targbhstart (struct cam_periph *periph, union ccb *start_ccb) |
|
◆ ccb_atio
◆ ccb_descr
◆ ccb_type
◆ MAX_ACCEPT
◆ MAX_BUF_SIZE
#define MAX_BUF_SIZE 256 /* Max inquiry/sense/mode page transfer */ |
◆ MAX_IMMEDIATE
◆ targbh_ccb_types
◆ targbh_flags
Enumerator |
---|
TARGBH_FLAG_NONE | |
TARGBH_FLAG_LUN_ENABLED | |
Definition at line 64 of file scsi_targ_bh.c.
◆ targbh_state
Enumerator |
---|
TARGBH_STATE_NORMAL | |
TARGBH_STATE_EXCEPTION | |
TARGBH_STATE_TEARDOWN | |
Definition at line 58 of file scsi_targ_bh.c.
◆ __FBSDID()
◆ MALLOC_DEFINE()
static MALLOC_DEFINE |
( |
M_SCSIBH |
, |
|
|
"SCSI bh" |
, |
|
|
"SCSI blackhole buffers" |
|
|
) |
| |
|
static |
◆ PERIPHDRIVER_DECLARE()
◆ TAILQ_HEAD()
◆ targbhallocdescr()
◆ targbhasync()
static void targbhasync |
( |
void * |
callback_arg, |
|
|
u_int32_t |
code, |
|
|
struct cam_path * |
path, |
|
|
void * |
arg |
|
) |
| |
|
static |
Definition at line 175 of file scsi_targ_bh.c.
References AC_PATH_DEREGISTERED, AC_PATH_REGISTERED, CAM_LUN_WILDCARD, cam_periph_alloc(), CAM_PERIPH_BIO, cam_periph_find(), cam_periph_invalidate(), CAM_REQ_CMP, CAM_TARGET_WILDCARD, ccb_pathinq::ccb_h, ccb_hdr::path_id, PIT_PROCESSOR, targbhasync(), targbhctor, targbhdtor, targbhstart, ccb_pathinq::target_sprt, xpt_create_path(), xpt_free_path(), and xpt_path_path_id().
Referenced by targbhasync().
◆ targbhctor()
Definition at line 394 of file scsi_targ_bh.c.
References targbh_softc::accept_tio_list, cam_periph_invalidate(), CAM_REQ_CMP, CAM_REQ_CMP_ERR, targbh_softc::immed_notify_slist, targbh_softc::init_level, targbh_softc::pending_queue, cam_periph::softc, targbh_softc::state, TARGBH_STATE_NORMAL, targbhenlun(), and targbh_softc::work_queue.
◆ targbhdislun()
Definition at line 343 of file scsi_targ_bh.c.
References ccb_abort::abort_ccb, targbh_softc::accept_tio_list, ccb::atio, ccb::cab, CAM_PRIORITY_NORMAL, CAM_REQ_CMP, ccb_accept_tio::ccb_h, ccb_abort::ccb_h, ccb_en_lun::ccb_h, ccb::ccb_h, ccb::cel, ccb_en_lun::enable, targbh_softc::flags, ccb_hdr::func_code, targbh_softc::immed_notify_slist, cam_periph::path, cam_periph::softc, ccb_hdr::status, TARGBH_FLAG_LUN_ENABLED, XPT_ABORT, xpt_action(), XPT_EN_LUN, and xpt_setup_ccb().
Referenced by targbhdtor(), and targbhenlun().
◆ targbhdone()
static void targbhdone |
( |
struct cam_periph * |
periph, |
|
|
union ccb * |
done_ccb |
|
) |
| |
|
static |
Definition at line 529 of file scsi_targ_bh.c.
References ccb::atio, scsi_inquiry::byte2, CAM_DEBUG, CAM_DEBUG_SUBTRACE, CAM_DEV_QFRZN, CAM_DIR_IN, CAM_DIR_NONE, CAM_DIS_DISCONNECT, CAM_LUN_WILDCARD, CAM_PRIORITY_NORMAL, cam_release_devq(), CAM_REQ_ABORTED, CAM_TARGET_WILDCARD, ccb_accept_tio::ccb_h, ccb::ccb_h, cdb_t::cdb_bytes, ccb_accept_tio::cdb_io, targbh_cmd_desc::data, targbh_cmd_desc::data_increment, targbh_cmd_desc::data_resid, ccb_hdr::flags, ccb_hdr::func_code, INQUIRY, scsi_request_sense::length, scsi_inquiry::length, no_lun_inq_data, no_lun_sense_data, scsi_inquiry::page_code, ccb_hdr::path, cam_periph::path, targbh_softc::pending_queue, REQUEST_SENSE, request_sense_size, scsi_2btoul(), SCSI_CDB6_LEN, SCSI_STATUS_CHECK_COND, SCSI_STATUS_OK, ccb_accept_tio::sense_data, ccb_accept_tio::sense_len, SI_EVPD, cam_periph::softc, targbh_softc::state, ccb_hdr::status, targbh_cmd_desc::status, TARGBH_STATE_TEARDOWN, targbhfreedescr(), ccb_hdr::target_id, ccb_hdr::target_lun, targbh_cmd_desc::timeout, targbh_softc::work_queue, XPT_ACCEPT_TARGET_IO, xpt_action(), XPT_CONT_TARGET_IO, xpt_free_ccb(), XPT_IMMEDIATE_NOTIFY, xpt_release_ccb(), and xpt_schedule().
Referenced by targbhenlun(), and targbhstart().
◆ targbhdtor()
static void targbhdtor |
( |
struct cam_periph * |
periph | ) |
|
|
static |
◆ targbhenlun()
Definition at line 232 of file scsi_targ_bh.c.
References targbh_softc::accept_tio_list, CAM_PRIORITY_NORMAL, CAM_REQ_CMP, CAM_REQ_CMP_ERR, CAM_REQ_INPROG, CAM_RESRC_UNAVAIL, ccb_hdr::cbfcnp, ccb_accept_tio::ccb_h, ccb_immediate_notify::ccb_h, ccb::ccb_h, ccb::cel, ccb_en_lun::enable, targbh_softc::flags, ccb_hdr::func_code, ccb_en_lun::grp6_len, ccb_en_lun::grp7_len, targbh_softc::immed_notify_slist, MAX_ACCEPT, cam_periph::path, cam_periph::softc, ccb_hdr::status, targbh_cmd_desc::status, TARGBH_FLAG_LUN_ENABLED, targbhallocdescr(), targbhdislun(), targbhdone(), XPT_ACCEPT_TARGET_IO, xpt_action(), XPT_EN_LUN, XPT_IMMEDIATE_NOTIFY, xpt_print(), and xpt_setup_ccb().
Referenced by targbhctor().
◆ targbhfreedescr()
◆ targbhstart()
static void targbhstart |
( |
struct cam_periph * |
periph, |
|
|
union ccb * |
start_ccb |
|
) |
| |
|
static |
Definition at line 445 of file scsi_targ_bh.c.
References CAM_DEBUG, CAM_DEBUG_SUBTRACE, CAM_DEV_QFRZN, CAM_DIR_MASK, CAM_DIS_DISCONNECT, cam_fill_ctio(), CAM_PRIORITY_NORMAL, cam_release_devq(), CAM_SEND_SENSE, CAM_SEND_STATUS, CAM_TAG_ACTION_VALID, ccb_accept_tio::ccb_h, ccb::ccb_h, ccb::csio, targbh_cmd_desc::data, targbh_cmd_desc::data_increment, targbh_cmd_desc::data_resid, ccb_hdr::flags, ccb_accept_tio::init_id, MSG_SIMPLE_Q_TAG, cam_periph::path, targbh_softc::pending_queue, ccb_scsiio::sense_data, ccb_accept_tio::sense_data, ccb_scsiio::sense_len, ccb_accept_tio::sense_len, cam_periph::softc, ccb_hdr::status, targbh_cmd_desc::status, ccb_accept_tio::tag_id, TARGBH_CCB_WORKQ, targbhdone(), ccb_hdr::target_id, ccb_hdr::target_lun, targbh_cmd_desc::timeout, targbh_softc::work_queue, xpt_action(), xpt_release_ccb(), and xpt_schedule().
◆ no_lun_inq_data
◆ no_lun_sense_data
Initial value:=
{
0,
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
0x25, 0
}
#define SSD_KEY_NOT_READY
#define SSD_ERRCODE_VALID
#define SSD_CURRENT_ERROR
Definition at line 116 of file scsi_targ_bh.c.
Referenced by targbhdone().
◆ request_sense_size
◆ targbhctor
◆ targbhdriver
Initial value:=
{
}
static periph_init_t targbhinit
static struct periph_driver targbhdriver
Definition at line 148 of file scsi_targ_bh.c.
◆ targbhdtor
◆ targbhinit
static void targbhinit |
( |
void |
| ) |
|
|
static |
◆ targbhstart