FreeBSD kernel CAM code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/endian.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/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/nvme/nvme_all.h>
#include <machine/stdarg.h>
#include "opt_cam.h"
Go to the source code of this file.
Data Structures | |
struct | nvme_quirk_entry |
struct | nvme_probe_softc |
Macros | |
#define | CAM_QUIRK_MAXTAGS 1 |
#define | NVME_PROBE_SET_ACTION(softc, newaction) |
#define | NVME_XPT_XPORT(x, X) |
Enumerations | |
enum | nvme_probe_action { NVME_PROBE_IDENTIFY_CD , NVME_PROBE_IDENTIFY_NS , NVME_PROBE_DONE , NVME_PROBE_INVALID } |
enum | nvme_probe_flags { NVME_PROBE_NO_ANNOUNCE = 0x04 } |
Functions | |
__FBSDID ("$FreeBSD$") | |
PERIPHDRIVER_DECLARE (nvme_probe, nvme_probe_driver) | |
static cam_status | nvme_probe_register (struct cam_periph *periph, void *arg) |
static void | nvme_probe_schedule (struct cam_periph *nvme_probe_periph) |
static void | nvme_probe_start (struct cam_periph *periph, union ccb *start_ccb) |
static void | nvme_probe_done (struct cam_periph *periph, union ccb *done_ccb) |
static void | nvme_probe_cleanup (struct cam_periph *periph) |
static void | nvme_scan_lun (struct cam_periph *periph, struct cam_path *path, cam_flags flags, union ccb *ccb) |
static struct cam_ed * | nvme_alloc_device (struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id) |
static void | nvme_device_transport (struct cam_path *path) |
static void | nvme_dev_async (u_int32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, void *async_arg) |
static void | nvme_action (union ccb *start_ccb) |
static void | nvme_announce_periph (struct cam_periph *periph) |
static void | nvme_proto_announce (struct cam_ed *device) |
static void | nvme_proto_denounce (struct cam_ed *device) |
static void | nvme_proto_debug_out (union ccb *ccb) |
NVME_XPT_XPORT (nvme, NVME) | |
CAM_XPT_PROTO (nvme_proto) | |
static void | nvme_dev_advinfo (union ccb *start_ccb) |
Variables | |
static periph_init_t | nvme_probe_periph_init |
static struct periph_driver | nvme_probe_driver |
static char * | nvme_probe_action_text [] |
static struct nvme_quirk_entry | nvme_quirk_table [] |
static const int | nvme_quirk_table_size |
static struct xpt_xport_ops | nvme_xport_ops |
static struct xpt_proto_ops | nvme_proto_ops |
static struct xpt_proto | nvme_proto |
#define CAM_QUIRK_MAXTAGS 1 |
Definition at line 68 of file nvme_xpt.c.
#define NVME_PROBE_SET_ACTION | ( | softc, | |
newaction | |||
) |
Definition at line 99 of file nvme_xpt.c.
#define NVME_XPT_XPORT | ( | x, | |
X | |||
) |
Definition at line 170 of file nvme_xpt.c.
enum nvme_probe_action |
Enumerator | |
---|---|
NVME_PROBE_IDENTIFY_CD | |
NVME_PROBE_IDENTIFY_NS | |
NVME_PROBE_DONE | |
NVME_PROBE_INVALID |
Definition at line 85 of file nvme_xpt.c.
enum nvme_probe_flags |
Enumerator | |
---|---|
NVME_PROBE_NO_ANNOUNCE |
Definition at line 109 of file nvme_xpt.c.
__FBSDID | ( | "$FreeBSD$" | ) |
CAM_XPT_PROTO | ( | nvme_proto | ) |
|
static |
Definition at line 740 of file nvme_xpt.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, ccb::ccb_h, ccb::crcn, ccb_rescan::flags, ccb_hdr::func_code, nvme_dev_advinfo(), nvme_scan_lun(), ccb_hdr::path, cam_path::periph, xpt_action_default(), XPT_DEV_ADVINFO, XPT_SCAN_BUS, XPT_SCAN_LUN, and XPT_SCAN_TGT.
|
static |
Definition at line 593 of file nvme_xpt.c.
References cam_ed::device_id, cam_ed::device_id_len, cam_ed::inq_flags, cam_ed::lun_id, cam_ed::maxtags, cam_ed::mintags, nvme_quirk_table, nvme_quirk_table_size, cam_ed::queue_flags, cam_ed::quirk, cam_ed::serial_num, cam_ed::serial_num_len, cam_ed::target, and xpt_alloc_device().
|
static |
Definition at line 786 of file nvme_xpt.c.
References cam_periph_assert, CAM_PRIORITY_NORMAL, CAM_REQ_CMP, CAM_STATUS_MASK, cts, CTS_NVME_VALID_LINK, CTS_TYPE_CURRENT_SETTINGS, ccb_trans_settings_nvme::lanes, ccb_trans_settings_nvme::max_lanes, ccb_trans_settings_nvme::max_speed, cam_periph::path, cam_path::periph, cam_periph::periph_name, ccb_trans_settings_nvme::spec, ccb_trans_settings_nvme::speed, cam_periph::unit_number, ccb_trans_settings_nvme::valid, xpt_action(), XPT_GET_TRAN_SETTINGS, xpt_path_inq(), and xpt_setup_ccb().
|
static |
Definition at line 650 of file nvme_xpt.c.
References AC_ADVINFO_CHANGED, ccb_dev_advinfo::buf, ccb_dev_advinfo::bufsiz, ccb_dev_advinfo::buftype, CAM_REQ_ABORTED, CAM_REQ_CMP, CAM_REQ_INVALID, ccb::ccb_h, ccb::cdai, CDAI_FLAG_STORE, CDAI_TYPE_NVME_CNTRL, CDAI_TYPE_NVME_NS, CDAI_TYPE_PHYS_PATH, CDAI_TYPE_SCSI_DEVID, CDAI_TYPE_SERIAL_NUM, cam_path::device, cam_ed::device_id, cam_ed::device_id_len, ccb_dev_advinfo::flags, cam_ed::nvme_cdata, cam_ed::nvme_data, ccb_hdr::path, cam_ed::physpath, cam_ed::physpath_len, ccb_dev_advinfo::provsiz, cam_ed::serial_num, cam_ed::serial_num_len, ccb_hdr::status, xpt_async(), and xpt_path_assert.
Referenced by nvme_action().
|
static |
Definition at line 767 of file nvme_xpt.c.
References AC_LOST_DEVICE, CAM_DEV_UNCONFIGURED, CAM_LUN_WILDCARD, CAM_TARGET_WILDCARD, cam_ed::flags, cam_ed::lun_id, cam_et::target_id, and xpt_release_device().
|
static |
Definition at line 620 of file nvme_xpt.c.
References CAM_PRIORITY_NONE, cts, CTS_TYPE_CURRENT_SETTINGS, cam_path::device, ccb_pathinq::protocol, cam_ed::protocol, ccb_pathinq::protocol_version, cam_ed::protocol_version, ccb_pathinq::transport, cam_ed::transport, ccb_pathinq::transport_version, cam_ed::transport_version, xpt_action(), xpt_path_inq(), XPT_SET_TRAN_SETTINGS, and xpt_setup_ccb().
Referenced by nvme_probe_done().
|
static |
Definition at line 494 of file nvme_xpt.c.
References cam_periph::softc.
Referenced by nvme_scan_lun().
|
static |
Definition at line 305 of file nvme_xpt.c.
References AC_FOUND_DEVICE, AC_LOST_DEVICE, nvme_probe_softc::action, CAM_DEBUG, CAM_DEBUG_PROBE, CAM_DEBUG_TRACE, CAM_DEV_QFRZN, CAM_DEV_UNCONFIGURED, cam_periph_error(), cam_periph_invalidate(), cam_periph_release_locked(), cam_release_devq(), CAM_REQ_CMP, CAM_REQ_CMP_ERR, CAM_STATUS_MASK, cam_strvis_flag(), CAM_STRVIS_FLAG_NONASCII_SPC, ccb::ccb_h, cam_path::device, scsi_vpd_device_id::device, cam_ed::device_id, cam_ed::device_id_len, cam_ed::flags, ccb_hdr::func_code, scsi_vpd_id_descriptor::id_type, scsi_vpd_id_descriptor::identifier, scsi_vpd_device_id::length, scsi_vpd_id_descriptor::length, cam_ed::nvme_cdata, cam_ed::nvme_data, nvme_device_transport(), NVME_PROBE_DONE, NVME_PROBE_IDENTIFY_CD, NVME_PROBE_IDENTIFY_NS, NVME_PROBE_INVALID, nvme_probe_schedule(), NVME_PROBE_SET_ACTION, scsi_vpd_device_id::page_code, ccb_hdr::path, cam_periph::path, ccb_hdr::pinfo, cam_pinfo::priority, scsi_vpd_id_descriptor::proto_codeset, nvme_probe_softc::restart, scsi_ulto2b(), cam_ed::serial_num, cam_ed::serial_num_len, SF_NO_RECOVERY, SF_NO_RETRY, SID_QUAL_LU_CONNECTED, cam_periph::softc, ccb_hdr::status, SVPD_DEVICE_ID, SVPD_DEVICE_ID_HDR_LEN, SVPD_ID_ASSOC_LUN, SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_EUI64, T_DIRECT, 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 nvme_probe_start().
|
static |
Definition at line 200 of file nvme_xpt.c.
References nvme_probe_softc::action, CAM_DEBUG, CAM_DEBUG_PROBE, cam_periph_acquire(), CAM_REQ_CMP, CAM_REQ_CMP_ERR, ccb::ccb_h, nvme_probe_softc::flags, NVME_PROBE_INVALID, nvme_probe_schedule(), cam_periph::path, nvme_probe_softc::periph, and cam_periph::softc.
Referenced by nvme_scan_lun().
|
static |
Definition at line 238 of file nvme_xpt.c.
References CAM_EXPECT_INQ_CHANGE, CAM_PRIORITY_XPT, ccb, ccb::crcn, ccb_rescan::flags, nvme_probe_softc::flags, NVME_PROBE_IDENTIFY_CD, NVME_PROBE_NO_ANNOUNCE, NVME_PROBE_SET_ACTION, cam_periph::softc, and xpt_schedule().
Referenced by nvme_probe_done(), and nvme_probe_register().
|
static |
Definition at line 257 of file nvme_xpt.c.
References nvme_probe_softc::action, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DEV_QFREEZE, CAM_DIR_IN, cam_fill_nvmeadmin(), ccb::ccb_h, ccb_hdr::flags, nvme_ns_cmd(), nvme_probe_done(), NVME_PROBE_IDENTIFY_CD, NVME_PROBE_IDENTIFY_NS, NVME_PROBE_SET_ACTION, ccb::nvmeio, ccb_hdr::path, cam_periph::path, nvme_probe_softc::restart, cam_periph::softc, xpt_action(), and xpt_path_lun_id().
Referenced by nvme_scan_lun().
|
static |
Definition at line 824 of file nvme_xpt.c.
References cam_ed::nvme_cdata, cam_ed::nvme_data, and nvme_print_ident().
Referenced by nvme_proto_denounce().
|
static |
Definition at line 843 of file nvme_xpt.c.
References CAM_DEBUG, CAM_DEBUG_CDB, ccb::ccb_h, ccb_nvmeio::cmd, ccb_hdr::func_code, nvme_cmd_string(), nvme_op_string(), ccb::nvmeio, ccb_hdr::path, XPT_NVME_ADMIN, and XPT_NVME_IO.
|
static |
Definition at line 836 of file nvme_xpt.c.
References nvme_proto_announce().
|
static |
Definition at line 526 of file nvme_xpt.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, CAM_LUN_WILDCARD, cam_periph_alloc(), CAM_PERIPH_BIO, cam_periph_find(), CAM_PERIPH_INVALID, CAM_REQ_CMP, CAM_REQ_CMP_ERR, ccb_pathinq::ccb_h, ccb::ccb_h, cam_periph::flags, nvme_probe_cleanup(), nvme_probe_register(), nvme_probe_start(), ccb_hdr::path, cam_periph::path, cam_periph::softc, ccb_hdr::status, xpt_done(), xpt_path_inq(), xpt_path_lock, xpt_path_lun_id(), xpt_path_owned, xpt_path_unlock, and xpt_print().
Referenced by nvme_action().
NVME_XPT_XPORT | ( | nvme | , |
NVME | |||
) |
PERIPHDRIVER_DECLARE | ( | nvme_probe | , |
nvme_probe_driver | |||
) |
|
static |
Definition at line 92 of file nvme_xpt.c.
|
static |
Definition at line 76 of file nvme_xpt.c.
|
static |
Definition at line 74 of file nvme_xpt.c.
|
static |
Definition at line 187 of file nvme_xpt.c.
|
static |
Definition at line 182 of file nvme_xpt.c.
|
static |
Definition at line 125 of file nvme_xpt.c.
Referenced by nvme_alloc_device().
|
static |
|
static |
Definition at line 164 of file nvme_xpt.c.