FreeBSD kernel CAM code
scsi_xpt.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/time.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/md5.h>
#include <sys/sbuf.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_queue.h>
#include <cam/cam_periph.h>
#include <cam/cam_sim.h>
#include <cam/cam_xpt.h>
#include <cam/cam_xpt_sim.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_xpt_internal.h>
#include <cam/cam_debug.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>
#include <machine/stdarg.h>
#include "opt_cam.h"
Include dependency graph for scsi_xpt.c:

Go to the source code of this file.

Data Structures

struct  scsi_quirk_entry
 
struct  probe_softc
 
struct  scsi_scan_bus_info
 

Macros

#define CAM_QUIRK_NOLUNS   0x01
 
#define CAM_QUIRK_NOVPDS   0x02
 
#define CAM_QUIRK_HILUNS   0x04
 
#define CAM_QUIRK_NOHILUNS   0x08
 
#define CAM_QUIRK_NORPTLUNS   0x10
 
#define SCSI_QUIRK(dev)   ((struct scsi_quirk_entry *)((dev)->quirk))
 
#define CAM_SCSI2_MAXLUN   8
 
#define CAM_CAN_GET_SIMPLE_LUN(x, i)
 
#define CAM_GET_SIMPLE_LUN(lp, i, lval)
 
#define CAM_GET_LUN(lp, i, lval)
 
#define CAN_SRCH_HI_SPARSE(dv)
 
#define CAN_SRCH_HI_DENSE(dv)
 
#define PROBE_SET_ACTION(softc, newaction)
 
#define SCSI_XPT_XPORT(x, X)
 
#define CCB_COMPLETED_OK(ccb)   (((ccb).status & CAM_STATUS_MASK) == CAM_REQ_CMP)
 

Enumerations

enum  probe_action {
  PROBE_RESET , PROBE_IDENTIFY , PROBE_POWER_OFF , PROBE_GET_HOST_OCR ,
  PROBE_RESET_BUS , PROBE_SET_ID_FREQ , PROBE_SET_CS , PROBE_GO_IDLE_STATE ,
  PROBE_SDIO_RESET , PROBE_SEND_IF_COND , PROBE_SDIO_INIT , PROBE_MMC_INIT ,
  PROBE_SEND_APP_OP_COND , PROBE_GET_CID , PROBE_GET_CSD , PROBE_SEND_RELATIVE_ADDR ,
  PROBE_MMC_SET_RELATIVE_ADDR , PROBE_SELECT_CARD , PROBE_DONE , PROBE_INVALID ,
  PROBE_TUR , PROBE_INQUIRY , PROBE_FULL_INQUIRY , PROBE_REPORT_LUNS ,
  PROBE_MODE_SENSE , PROBE_SUPPORTED_VPD_LIST , PROBE_DEVICE_ID , PROBE_EXTENDED_INQUIRY ,
  PROBE_SERIAL_NUM , PROBE_TUR_FOR_NEGOTIATION , PROBE_INQUIRY_BASIC_DV1 , PROBE_INQUIRY_BASIC_DV2 ,
  PROBE_DV_EXIT , PROBE_DONE , PROBE_INVALID
}
 
enum  probe_flags { PROBE_INQUIRY_CKSUM = 0x01 , PROBE_NO_ANNOUNCE = 0x04 , PROBE_EXTLUN = 0x08 }
 

Functions

 __FBSDID ("$FreeBSD$")
 
 SYSCTL_INT (_kern_cam, OID_AUTO, cam_srch_hi, CTLFLAG_RWTUN, &cam_srch_hi, 0, "Search above LUN 7 for SCSI3 and greater devices")
 
 PERIPHDRIVER_DECLARE (probe, probe_driver)
 
static cam_status proberegister (struct cam_periph *periph, void *arg)
 
static void probeschedule (struct cam_periph *probe_periph)
 
static void probestart (struct cam_periph *periph, union ccb *start_ccb)
 
static void proberequestdefaultnegotiation (struct cam_periph *periph)
 
static int proberequestbackoff (struct cam_periph *periph, struct cam_ed *device)
 
static void probedone (struct cam_periph *periph, union ccb *done_ccb)
 
static void probe_purge_old (struct cam_path *path, struct scsi_report_luns_data *new, probe_flags flags)
 
static void probecleanup (struct cam_periph *periph)
 
static void scsi_find_quirk (struct cam_ed *device)
 
static void scsi_scan_bus (struct cam_periph *periph, union ccb *ccb)
 
static void scsi_scan_lun (struct cam_periph *periph, struct cam_path *path, cam_flags flags, union ccb *ccb)
 
static void xptscandone (struct cam_periph *periph, union ccb *done_ccb)
 
static struct cam_edscsi_alloc_device (struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
 
static void scsi_devise_transport (struct cam_path *path)
 
static void scsi_set_transfer_settings (struct ccb_trans_settings *cts, struct cam_path *path, int async_update)
 
static void scsi_toggle_tags (struct cam_path *path)
 
static void scsi_dev_async (u_int32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, void *async_arg)
 
static void scsi_action (union ccb *start_ccb)
 
static void scsi_announce_periph (struct cam_periph *periph)
 
static void scsi_announce_periph_sbuf (struct cam_periph *periph, struct sbuf *sb)
 
static void scsi_proto_announce (struct cam_ed *device)
 
static void scsi_proto_announce_sbuf (struct cam_ed *device, struct sbuf *sb)
 
static void scsi_proto_denounce (struct cam_ed *device)
 
static void scsi_proto_denounce_sbuf (struct cam_ed *device, struct sbuf *sb)
 
static void scsi_proto_debug_out (union ccb *ccb)
 
static void _scsi_announce_periph (struct cam_periph *, u_int *, u_int *, struct ccb_trans_settings *)
 
 SCSI_XPT_XPORT (spi, SPI)
 
 SCSI_XPT_XPORT (sas, SAS)
 
 SCSI_XPT_XPORT (fc, FC)
 
 SCSI_XPT_XPORT (usb, USB)
 
 SCSI_XPT_XPORT (iscsi, ISCSI)
 
 SCSI_XPT_XPORT (srp, SRP)
 
 SCSI_XPT_XPORT (ppb, PPB)
 
 CAM_XPT_PROTO (scsi_proto)
 
static void scsi_dev_advinfo (union ccb *start_ccb)
 

Variables

static int cam_srch_hi = 0
 
static periph_init_t probe_periph_init
 
static struct periph_driver probe_driver
 
static char * probe_action_text []
 
static const char quantum [] = "QUANTUM"
 
static const char sony [] = "SONY"
 
static const char west_digital [] = "WDIGTL"
 
static const char samsung [] = "SAMSUNG"
 
static const char seagate [] = "SEAGATE"
 
static const char microp [] = "MICROP"
 
static struct scsi_quirk_entry scsi_quirk_table []
 
static struct xpt_xport_ops scsi_xport_ops
 
static struct xpt_proto_ops scsi_proto_ops
 
static struct xpt_proto scsi_proto
 

Macro Definition Documentation

◆ CAM_CAN_GET_SIMPLE_LUN

#define CAM_CAN_GET_SIMPLE_LUN (   x,
 
)
Value:
((((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \
RPL_LUNDATA_ATYP_PERIPH) || \
(((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \
#define RPL_LUNDATA_ATYP_MASK
Definition: scsi_all.h:3023
#define RPL_LUNDATA_ATYP_FLAT
Definition: scsi_all.h:3025

Definition at line 86 of file scsi_xpt.c.

◆ CAM_GET_LUN

#define CAM_GET_LUN (   lp,
  i,
  lval 
)
Value:
(lval) = scsi_8btou64((lp)->luns[(i)].lundata); \
(lval) = CAM_EXTLUN_BYTE_SWIZZLE(lval);
#define CAM_EXTLUN_BYTE_SWIZZLE(lun)
Definition: cam.h:51
static __inline uint64_t scsi_8btou64(const uint8_t *bytes)
Definition: scsi_all.h:4459

Definition at line 101 of file scsi_xpt.c.

◆ CAM_GET_SIMPLE_LUN

#define CAM_GET_SIMPLE_LUN (   lp,
  i,
  lval 
)
Value:
if (((lp)->luns[(i)].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \
(lval) = (lp)->luns[(i)].lundata[1]; \
} else { \
(lval) = (lp)->luns[(i)].lundata[0]; \
(lval) <<= 8; \
(lval) |= (lp)->luns[(i)].lundata[1]; \
}
#define RPL_LUNDATA_FLAT_LUN_MASK
Definition: scsi_all.h:3014
#define RPL_LUNDATA_ATYP_PERIPH
Definition: scsi_all.h:3024

Definition at line 91 of file scsi_xpt.c.

◆ CAM_QUIRK_HILUNS

#define CAM_QUIRK_HILUNS   0x04

Definition at line 73 of file scsi_xpt.c.

◆ CAM_QUIRK_NOHILUNS

#define CAM_QUIRK_NOHILUNS   0x08

Definition at line 74 of file scsi_xpt.c.

◆ CAM_QUIRK_NOLUNS

#define CAM_QUIRK_NOLUNS   0x01

Definition at line 71 of file scsi_xpt.c.

◆ CAM_QUIRK_NORPTLUNS

#define CAM_QUIRK_NORPTLUNS   0x10

Definition at line 75 of file scsi_xpt.c.

◆ CAM_QUIRK_NOVPDS

#define CAM_QUIRK_NOVPDS   0x02

Definition at line 72 of file scsi_xpt.c.

◆ CAM_SCSI2_MAXLUN

#define CAM_SCSI2_MAXLUN   8

Definition at line 85 of file scsi_xpt.c.

◆ CAN_SRCH_HI_DENSE

#define CAN_SRCH_HI_DENSE (   dv)
Value:
(((SCSI_QUIRK(dv)->quirks & CAM_QUIRK_NOHILUNS) == 0) \
&& ((SCSI_QUIRK(dv)->quirks & CAM_QUIRK_HILUNS) \
|| (SID_ANSI_REV(&dv->inq_data) > SCSI_REV_2)))
#define SCSI_REV_2
Definition: scsi_all.h:2222
#define SID_ANSI_REV(inq_data)
Definition: scsi_all.h:2219
#define CAM_QUIRK_NOHILUNS
Definition: scsi_xpt.c:74
#define CAM_QUIRK_HILUNS
Definition: scsi_xpt.c:73
#define SCSI_QUIRK(dev)
Definition: scsi_xpt.c:79

Definition at line 117 of file scsi_xpt.c.

◆ CAN_SRCH_HI_SPARSE

#define CAN_SRCH_HI_SPARSE (   dv)
Value:
(((SCSI_QUIRK(dv)->quirks & CAM_QUIRK_NOHILUNS) == 0) \
&& ((SCSI_QUIRK(dv)->quirks & CAM_QUIRK_HILUNS) \
|| (SID_ANSI_REV(&dv->inq_data) > SCSI_REV_2 && cam_srch_hi)))
static int cam_srch_hi
Definition: scsi_xpt.c:81

Definition at line 112 of file scsi_xpt.c.

◆ CCB_COMPLETED_OK

#define CCB_COMPLETED_OK (   ccb)    (((ccb).status & CAM_STATUS_MASK) == CAM_REQ_CMP)

Definition at line 1167 of file scsi_xpt.c.

◆ PROBE_SET_ACTION

#define PROBE_SET_ACTION (   softc,
  newaction 
)
Value:
do { \
char **text; \
CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \
("Probe %s to %s\n", text[(softc)->action], \
text[(newaction)])); \
(softc)->action = (newaction); \
} while(0)
@ CAM_DEBUG_PROBE
Definition: cam_debug.h:46
static char * probe_action_text[]
Definition: scsi_xpt.c:151

Definition at line 169 of file scsi_xpt.c.

◆ SCSI_QUIRK

#define SCSI_QUIRK (   dev)    ((struct scsi_quirk_entry *)((dev)->quirk))

Definition at line 79 of file scsi_xpt.c.

◆ SCSI_XPT_XPORT

#define SCSI_XPT_XPORT (   x,
 
)
Value:
static struct xpt_xport scsi_xport_ ## x = { \
.xport = XPORT_ ## X, \
.name = #x, \
}; \
CAM_XPT_XPORT(scsi_xport_ ## x);
static struct xpt_xport_ops scsi_xport_ops
Definition: scsi_xpt.c:607
cam_xport xport
struct xpt_xport_ops * ops

Definition at line 614 of file scsi_xpt.c.

Enumeration Type Documentation

◆ probe_action

Enumerator
PROBE_RESET 
PROBE_IDENTIFY 
PROBE_POWER_OFF 
PROBE_GET_HOST_OCR 
PROBE_RESET_BUS 
PROBE_SET_ID_FREQ 
PROBE_SET_CS 
PROBE_GO_IDLE_STATE 
PROBE_SDIO_RESET 
PROBE_SEND_IF_COND 
PROBE_SDIO_INIT 
PROBE_MMC_INIT 
PROBE_SEND_APP_OP_COND 
PROBE_GET_CID 
PROBE_GET_CSD 
PROBE_SEND_RELATIVE_ADDR 
PROBE_MMC_SET_RELATIVE_ADDR 
PROBE_SELECT_CARD 
PROBE_DONE 
PROBE_INVALID 
PROBE_TUR 
PROBE_INQUIRY 
PROBE_FULL_INQUIRY 
PROBE_REPORT_LUNS 
PROBE_MODE_SENSE 
PROBE_SUPPORTED_VPD_LIST 
PROBE_DEVICE_ID 
PROBE_EXTENDED_INQUIRY 
PROBE_SERIAL_NUM 
PROBE_TUR_FOR_NEGOTIATION 
PROBE_INQUIRY_BASIC_DV1 
PROBE_INQUIRY_BASIC_DV2 
PROBE_DV_EXIT 
PROBE_DONE 
PROBE_INVALID 

Definition at line 133 of file scsi_xpt.c.

◆ probe_flags

Enumerator
PROBE_INQUIRY_CKSUM 
PROBE_NO_ANNOUNCE 
PROBE_EXTLUN 

Definition at line 179 of file scsi_xpt.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ _scsi_announce_periph()

◆ CAM_XPT_PROTO()

CAM_XPT_PROTO ( scsi_proto  )

◆ PERIPHDRIVER_DECLARE()

PERIPHDRIVER_DECLARE ( probe  ,
probe_driver   
)

◆ probe_purge_old()

static void probe_purge_old ( struct cam_path path,
struct scsi_report_luns_data new,
probe_flags  flags 
)
static

◆ probecleanup()

static void probecleanup ( struct cam_periph periph)
static

Definition at line 1897 of file scsi_xpt.c.

References cam_periph::softc.

Referenced by scsi_scan_lun().

Here is the caller graph for this function:

◆ probedone()

static void probedone ( struct cam_periph periph,
union ccb done_ccb 
)
static

Definition at line 1170 of file scsi_xpt.c.

References AC_FOUND_DEVICE, AC_LOST_DEVICE, scsi_mode_header_6::blk_desc_len, cam_ccb_status(), CAM_DEBUG, CAM_DEBUG_PROBE, CAM_DEBUG_TRACE, CAM_DEV_DV_HIT_BOTTOM, CAM_DEV_IN_DV, CAM_DEV_INQUIRY_DATA_VALID, CAM_DEV_QFRZN, CAM_DEV_UNCONFIGURED, CAM_GET_LUN, cam_periph_assert, cam_periph_error(), cam_periph_invalidate(), cam_periph_release_locked(), CAM_QUIRK_NORPTLUNS, cam_release_devq(), CAM_REQ_CMP, CCB_COMPLETED_OK, ccb_scsiio::ccb_h, ccb::ccb_h, ccb::csio, ccb_scsiio::data_ptr, cam_path::device, cam_ed::device_id, cam_ed::device_id_len, ccb_scsiio::dxfer_len, cam_ed::ext_inq, cam_ed::ext_inq_len, cam_ed::flags, scsi_inquiry_data::flags, scsi_vpd_extended_inquiry_data::flags1, ccb_hdr::func_code, cam_ed::inq_data, INQ_DATA_TQ_ENABLED, scsi_vpd_supported_page_list::length, scsi_vpd_unit_serial_number::length, scsi_vpd_device_id::length, scsi_report_luns_data::length, cam_ed::lun_id, scsi_report_luns_lundata::lundata, scsi_report_luns_data::luns, scsi_vpd_extended_inquiry_data::page_length, ccb_hdr::path, cam_periph::path, ccb_hdr::pinfo, cam_pinfo::priority, PROBE_DEVICE_ID, PROBE_DONE, PROBE_DV_EXIT, PROBE_EXTENDED_INQUIRY, PROBE_FULL_INQUIRY, PROBE_INQUIRY, PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, PROBE_INQUIRY_CKSUM, PROBE_INVALID, PROBE_MODE_SENSE, PROBE_NO_ANNOUNCE, probe_purge_old(), PROBE_REPORT_LUNS, PROBE_SERIAL_NUM, PROBE_SET_ACTION, PROBE_SUPPORTED_VPD_LIST, PROBE_TUR, PROBE_TUR_FOR_NEGOTIATION, proberequestbackoff(), proberequestdefaultnegotiation(), probeschedule(), cam_ed::queue_flags, scsi_control_page::queue_flags, ccb_scsiio::resid, cam_et::rpl_size, scsi_2btoul(), scsi_4btoul(), scsi_devise_transport(), scsi_find_quirk(), SCSI_QUIRK, SCSI_REV_SPC2, cam_ed::serial_num, scsi_vpd_unit_serial_number::serial_num, cam_ed::serial_num_len, SF_NO_PRINT, SF_NO_RECOVERY, SF_NO_RETRY, SF_QUIET_IR, SF_RETRY_UA, SHORT_INQUIRY_LENGTH, SID_ADDITIONAL_LENGTH, SID_ANSI_REV, SID_QUAL, SID_QUAL_LU_CONNECTED, SID_QUAL_LU_OFFLINE, SID_Sync, cam_periph::softc, ccb_hdr::status, cam_ed::supported_vpds, cam_ed::supported_vpds_len, SVPD_DEVICE_ID_HDR_LEN, SVPD_SUPPORTED_PAGES_HDR_LEN, cam_path::target, ccb_hdr::target_lun, xpt_acquire_device(), xpt_action(), xpt_async(), xpt_done(), XPT_GDEV_TYPE, xpt_print(), xpt_release_ccb(), xpt_release_devq(), and xpt_schedule().

Referenced by probestart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proberegister()

static cam_status proberegister ( struct cam_periph periph,
void *  arg 
)
static

Definition at line 652 of file scsi_xpt.c.

References cam_path::bus, CAM_DEBUG, CAM_DEBUG_PROBE, cam_periph_acquire(), cam_periph_freeze_after_event(), CAM_REQ_CMP, CAM_REQ_CMP_ERR, ccb::ccb_h, cam_eb::last_reset, cam_periph::path, PROBE_INVALID, probeschedule(), scsi_delay, scsi_devise_transport(), and cam_periph::softc.

Referenced by scsi_scan_lun().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proberequestbackoff()

◆ proberequestdefaultnegotiation()

static void proberequestdefaultnegotiation ( struct cam_periph periph)
static

Definition at line 1046 of file scsi_xpt.c.

References cam_ccb_status(), CAM_PRIORITY_NONE, CAM_REQ_CMP, cts, CTS_TYPE_CURRENT_SETTINGS, CTS_TYPE_USER_SETTINGS, cam_periph::path, xpt_action(), XPT_GET_TRAN_SETTINGS, XPT_SET_TRAN_SETTINGS, and xpt_setup_ccb().

Referenced by probedone(), and probeschedule().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ probeschedule()

◆ probestart()

◆ scsi_action()

◆ scsi_alloc_device()

◆ scsi_announce_periph()

◆ scsi_announce_periph_sbuf()

◆ scsi_dev_advinfo()

◆ scsi_dev_async()

◆ scsi_devise_transport()

◆ scsi_find_quirk()

static void scsi_find_quirk ( struct cam_ed device)
static

Definition at line 1903 of file scsi_xpt.c.

References cam_quirkmatch(), cam_ed::inq_data, cam_ed::maxtags, scsi_quirk_entry::maxtags, cam_ed::mintags, scsi_quirk_entry::mintags, cam_ed::quirk, scsi_inquiry_match(), and scsi_quirk_table.

Referenced by probedone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scsi_proto_announce()

static void scsi_proto_announce ( struct cam_ed device)
static

Definition at line 3217 of file scsi_xpt.c.

References cam_ed::inq_data, and scsi_print_inquiry().

Here is the call graph for this function:

◆ scsi_proto_announce_sbuf()

static void scsi_proto_announce_sbuf ( struct cam_ed device,
struct sbuf *  sb 
)
static

Definition at line 3211 of file scsi_xpt.c.

References cam_ed::inq_data, and scsi_print_inquiry_sbuf().

Here is the call graph for this function:

◆ scsi_proto_debug_out()

static void scsi_proto_debug_out ( union ccb ccb)
static

◆ scsi_proto_denounce()

static void scsi_proto_denounce ( struct cam_ed device)
static

Definition at line 3229 of file scsi_xpt.c.

References cam_ed::inq_data, and scsi_print_inquiry_short().

Here is the call graph for this function:

◆ scsi_proto_denounce_sbuf()

static void scsi_proto_denounce_sbuf ( struct cam_ed device,
struct sbuf *  sb 
)
static

Definition at line 3223 of file scsi_xpt.c.

References cam_ed::inq_data, and scsi_print_inquiry_short_sbuf().

Here is the call graph for this function:

◆ scsi_scan_bus()

static void scsi_scan_bus ( struct cam_periph periph,
union ccb ccb 
)
static

Definition at line 1935 of file scsi_xpt.c.

References cam_et::bus, cam_path::bus, CAM_CAN_GET_SIMPLE_LUN, cam_ccb_status(), CAM_DEBUG, CAM_DEBUG_PROBE, CAM_DEBUG_TRACE, CAM_DEV_INQUIRY_DATA_VALID, CAM_DEV_UNCONFIGURED, CAM_GET_LUN, CAM_GET_SIMPLE_LUN, CAM_PRIORITY_NONE, CAM_QUIRK_NOLUNS, CAM_REQ_CMP, CAM_RESRC_UNAVAIL, CAM_SCSI2_MAXLUN, CAM_UNLOCKED, CAN_SRCH_HI_DENSE, CAN_SRCH_HI_SPARSE, ccb_hdr::cbfcnp, ccb::ccb_h, scsi_scan_bus_info::counter, ccb::cpi, scsi_scan_bus_info::cpi, ccb::crcn, cam_path::device, cam_eb::eb_mtx, ccb_hdr::flags, ccb_rescan::flags, cam_ed::flags, ccb_hdr::func_code, ccb_pathinq::hba_inquiry, ccb_pathinq::hba_misc, ccb_pathinq::initiator_id, cam_eb::last_reset, scsi_report_luns_data::length, cam_ed::lun_id, scsi_scan_bus_info::lunindex, cam_et::luns, cam_et::luns_mtx, ccb_pathinq::max_lun, ccb_pathinq::max_target, ccb_hdr::path, ccb_hdr::path_id, PI_SDTR_ABLE, PI_WIDE_16, PI_WIDE_32, PIM_EXTLUNS, PIM_NOBUSRESET, PIM_NOINITIATOR, PIM_SEQSCAN, ccb_hdr::pinfo, cam_pinfo::priority, scsi_scan_bus_info::request_ccb, scsi_4btoul(), SCSI_QUIRK, scsi_scan_bus(), ccb_hdr::status, cam_ed::target, cam_path::target, ccb_hdr::target_id, ccb_hdr::target_lun, xpt_action(), xpt_alloc_ccb_nowait(), xpt_create_path(), xpt_done(), xpt_free_ccb(), xpt_free_path(), XPT_PATH_INQ, xpt_path_mtx(), XPT_RESET_BUS, XPT_SCAN_BUS, XPT_SCAN_LUN, XPT_SCAN_TGT, and xpt_setup_ccb().

Referenced by scsi_action(), and scsi_scan_bus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scsi_scan_lun()

◆ scsi_set_transfer_settings()

static void scsi_set_transfer_settings ( struct ccb_trans_settings cts,
struct cam_path path,
int  async_update 
)
static

Definition at line 2666 of file scsi_xpt.c.

References ccb_trans_settings_spi::bus_width, cam_ccb_status(), CAM_DEV_INQUIRY_DATA_VALID, CAM_DEV_TAG_AFTER_COUNT, CAM_PATH_INVALID, CAM_PRIORITY_NONE, CAM_REQ_CMP, CAM_TAG_DELAY_COUNT, ccb_pathinq::ccb_h, ccb_trans_settings::ccb_h, cts, CTS_SCSI_FLAGS_TAG_ENB, CTS_SCSI_VALID_TQ, CTS_SPI_FLAGS_DISC_ENB, CTS_SPI_VALID_BUS_WIDTH, CTS_SPI_VALID_DISC, CTS_SPI_VALID_PPR_OPTIONS, CTS_SPI_VALID_SYNC_OFFSET, CTS_SPI_VALID_SYNC_RATE, CTS_TYPE_CURRENT_SETTINGS, CTS_TYPE_USER_SETTINGS, cam_path::device, ccb_trans_settings_scsi::flags, ccb_trans_settings_spi::flags, cam_ed::flags, scsi_inquiry_data::flags, ccb_hdr::func_code, ccb_pathinq::hba_inquiry, cam_ed::inq_data, INQ_DATA_TQ_ENABLED, cam_ed::inq_flags, cam_ed::mintags, MSG_EXT_WDTR_BUS_16_BIT, MSG_EXT_WDTR_BUS_32_BIT, MSG_EXT_WDTR_BUS_8_BIT, PI_SDTR_ABLE, PI_TAG_ABLE, PI_WIDE_16, PI_WIDE_32, ccb_pathinq_settings_spi::ppr_options, ccb_trans_settings_spi::ppr_options, PROTO_SCSI, PROTO_UNKNOWN, PROTO_UNSPECIFIED, PROTO_VERSION_UNKNOWN, PROTO_VERSION_UNSPECIFIED, cam_ed::protocol, cam_ed::protocol_version, cam_ed::queue_flags, SCP_QUEUE_DQUE, scsi_toggle_tags(), SID_CmdQue, SID_SPI_CLOCK_DT, SID_SPI_IUS, SID_SPI_QAS, SID_Sync, SID_WBus16, SID_WBus32, ccb_pathinq::spi, ccb_trans_settings::spi, scsi_inquiry_data::spi3data, ccb_trans_settings_spi::sync_offset, ccb_trans_settings_spi::sync_period, cam_ed::tag_delay_count, cam_ed::transport, cam_ed::transport_version, ccb_trans_settings::type, ccb_trans_settings_scsi::valid, ccb_trans_settings_spi::valid, ccb_pathinq::xport_specific, ccb_trans_settings::xport_specific, XPORT_SPI, XPORT_UNKNOWN, XPORT_UNSPECIFIED, XPORT_VERSION_UNKNOWN, XPORT_VERSION_UNSPECIFIED, xpt_action(), xpt_action_default(), xpt_done(), XPT_GET_TRAN_SETTINGS, XPT_PATH_INQ, xpt_print(), xpt_setup_ccb(), and xpt_stop_tags().

Referenced by scsi_action(), scsi_dev_async(), and scsi_toggle_tags().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scsi_toggle_tags()

static void scsi_toggle_tags ( struct cam_path path)
static

◆ SCSI_XPT_XPORT() [1/7]

SCSI_XPT_XPORT ( fc  ,
FC   
)

◆ SCSI_XPT_XPORT() [2/7]

SCSI_XPT_XPORT ( iscsi  ,
ISCSI   
)

◆ SCSI_XPT_XPORT() [3/7]

SCSI_XPT_XPORT ( ppb  ,
PPB   
)

◆ SCSI_XPT_XPORT() [4/7]

SCSI_XPT_XPORT ( sas  ,
SAS   
)

◆ SCSI_XPT_XPORT() [5/7]

SCSI_XPT_XPORT ( spi  ,
SPI   
)

◆ SCSI_XPT_XPORT() [6/7]

SCSI_XPT_XPORT ( srp  ,
SRP   
)

◆ SCSI_XPT_XPORT() [7/7]

SCSI_XPT_XPORT ( usb  ,
USB   
)

◆ SYSCTL_INT()

SYSCTL_INT ( _kern_cam  ,
OID_AUTO  ,
cam_srch_hi  ,
CTLFLAG_RWTUN  ,
cam_srch_hi,
,
"Search above LUN 7 for SCSI3 and greater devices"   
)

◆ xptscandone()

static void xptscandone ( struct cam_periph periph,
union ccb done_ccb 
)
static

Definition at line 2390 of file scsi_xpt.c.

References ccb::ccb_h, ccb_hdr::path, xpt_free_ccb(), and xpt_free_path().

Referenced by scsi_scan_lun().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cam_srch_hi

int cam_srch_hi = 0
static

Definition at line 81 of file scsi_xpt.c.

◆ microp

const char microp[] = "MICROP"
static

Definition at line 199 of file scsi_xpt.c.

◆ probe_action_text

char* probe_action_text[]
static
Initial value:
= {
"PROBE_TUR",
"PROBE_INQUIRY",
"PROBE_FULL_INQUIRY",
"PROBE_REPORT_LUNS",
"PROBE_MODE_SENSE",
"PROBE_SUPPORTED_VPD_LIST",
"PROBE_DEVICE_ID",
"PROBE_EXTENDED_INQUIRY",
"PROBE_SERIAL_NUM",
"PROBE_TUR_FOR_NEGOTIATION",
"PROBE_INQUIRY_BASIC_DV1",
"PROBE_INQUIRY_BASIC_DV2",
"PROBE_DV_EXIT",
"PROBE_DONE",
"PROBE_INVALID"
}

Definition at line 151 of file scsi_xpt.c.

◆ probe_driver

struct periph_driver probe_driver
static
Initial value:
=
{
TAILQ_HEAD_INITIALIZER(probe_driver.units), 0,
}
#define CAM_PERIPH_DRV_EARLY
Definition: cam_periph.h:99
static periph_init_t probe_periph_init
Definition: scsi_xpt.c:122
static struct periph_driver probe_driver
Definition: scsi_xpt.c:124

Definition at line 124 of file scsi_xpt.c.

◆ probe_periph_init

static void probe_periph_init ( void  )
static

Definition at line 122 of file scsi_xpt.c.

◆ quantum

const char quantum[] = "QUANTUM"
static

Definition at line 194 of file scsi_xpt.c.

◆ samsung

const char samsung[] = "SAMSUNG"
static

Definition at line 197 of file scsi_xpt.c.

◆ scsi_proto

struct xpt_proto scsi_proto
static
Initial value:
= {
.proto = PROTO_SCSI,
.name = "scsi",
.ops = &scsi_proto_ops,
}
@ PROTO_SCSI
Definition: cam_ccb.h:279
static struct xpt_proto_ops scsi_proto_ops
Definition: scsi_xpt.c:632

Definition at line 639 of file scsi_xpt.c.

◆ scsi_proto_ops

struct xpt_proto_ops scsi_proto_ops
static
Initial value:
= {
.announce = scsi_proto_announce,
.announce_sbuf = scsi_proto_announce_sbuf,
.denounce = scsi_proto_denounce,
.denounce_sbuf = scsi_proto_denounce_sbuf,
.debug_out = scsi_proto_debug_out,
}
static void scsi_proto_debug_out(union ccb *ccb)
Definition: scsi_xpt.c:3235
static void scsi_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb)
Definition: scsi_xpt.c:3223
static void scsi_proto_announce(struct cam_ed *device)
Definition: scsi_xpt.c:3217
static void scsi_proto_denounce(struct cam_ed *device)
Definition: scsi_xpt.c:3229
static void scsi_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb)
Definition: scsi_xpt.c:3211

Definition at line 632 of file scsi_xpt.c.

◆ scsi_quirk_table

struct scsi_quirk_entry scsi_quirk_table[]
static

Definition at line 201 of file scsi_xpt.c.

Referenced by scsi_alloc_device(), and scsi_find_quirk().

◆ scsi_xport_ops

struct xpt_xport_ops scsi_xport_ops
static
Initial value:
= {
.alloc_device = scsi_alloc_device,
.action = scsi_action,
.async = scsi_dev_async,
.announce = scsi_announce_periph,
.announce_sbuf = scsi_announce_periph_sbuf,
}
static void scsi_announce_periph(struct cam_periph *periph)
Definition: scsi_xpt.c:3154
static void scsi_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
Definition: scsi_xpt.c:3097
static void scsi_dev_async(u_int32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, void *async_arg)
Definition: scsi_xpt.c:2971
static struct cam_ed * scsi_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
Definition: scsi_xpt.c:2398
static void scsi_action(union ccb *start_ccb)
Definition: scsi_xpt.c:2627

Definition at line 607 of file scsi_xpt.c.

◆ seagate

const char seagate[] = "SEAGATE"
static

Definition at line 198 of file scsi_xpt.c.

◆ sony

const char sony[] = "SONY"
static

Definition at line 195 of file scsi_xpt.c.

◆ west_digital

const char west_digital[] = "WDIGTL"
static

Definition at line 196 of file scsi_xpt.c.