FreeBSD kernel CAM code
|
#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/devicestat.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/ptio.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_periph.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_debug.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pt.h>
#include "opt_pt.h"
Go to the source code of this file.
Data Structures | |
struct | pt_softc |
Macros | |
#define | ccb_state ppriv_field0 |
#define | ccb_bp ppriv_ptr1 |
#define | SCSI_PT_DEFAULT_TIMEOUT 60 |
Enumerations | |
enum | pt_state { PT_STATE_PROBE , PT_STATE_NORMAL } |
enum | pt_flags { PT_FLAG_NONE = 0x00 , PT_FLAG_OPEN = 0x01 , PT_FLAG_DEVICE_INVALID = 0x02 , PT_FLAG_RETRY_UA = 0x04 } |
enum | pt_ccb_state { PT_CCB_BUFFER_IO = 0x01 , PT_CCB_RETRY_UA = 0x04 , PT_CCB_BUFFER_IO_UA = PT_CCB_BUFFER_IO|PT_CCB_RETRY_UA } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | ptasync (void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) |
static void | ptdone (struct cam_periph *periph, union ccb *done_ccb) |
static int | pterror (union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) |
void | scsi_send_receive (struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int tag_action, int readop, u_int byte2, u_int32_t xfer_len, u_int8_t *data_ptr, u_int8_t sense_len, u_int32_t timeout) |
PERIPHDRIVER_DECLARE (pt, ptdriver) | |
static int | ptopen (struct cdev *dev, int flags, int fmt, struct thread *td) |
static int | ptclose (struct cdev *dev, int flag, int fmt, struct thread *td) |
static void | ptstrategy (struct bio *bp) |
static cam_status | ptctor (struct cam_periph *periph, void *arg) |
static void | ptoninvalidate (struct cam_periph *periph) |
static void | ptdtor (struct cam_periph *periph) |
static void | ptstart (struct cam_periph *periph, union ccb *start_ccb) |
static int | ptioctl (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) |
Variables | |
static d_open_t | ptopen |
static d_close_t | ptclose |
static d_strategy_t | ptstrategy |
static periph_init_t | ptinit |
static periph_ctor_t | ptctor |
static periph_oninv_t | ptoninvalidate |
static periph_dtor_t | ptdtor |
static periph_start_t | ptstart |
static d_ioctl_t | ptioctl |
static struct periph_driver | ptdriver |
static struct cdevsw | pt_cdevsw |
#define ccb_bp ppriv_ptr1 |
#define ccb_state ppriv_field0 |
enum pt_ccb_state |
enum pt_flags |
__FBSDID | ( | "$FreeBSD$" | ) |
PERIPHDRIVER_DECLARE | ( | pt | , |
ptdriver | |||
) |
|
static |
Definition at line 359 of file scsi_pt.c.
References AC_BUS_RESET, AC_FOUND_DEVICE, AC_SENT_BDR, cam_periph_alloc(), cam_periph_async(), CAM_PERIPH_BIO, CAM_REQ_CMP, CAM_REQ_INPROG, ccb_getdev::inq_data, PROTO_SCSI, ccb_getdev::protocol, PT_CCB_RETRY_UA, PT_FLAG_RETRY_UA, ptasync(), ptctor, ptdtor, ptoninvalidate, ptstart, SID_QUAL, SID_QUAL_LU_CONNECTED, SID_TYPE, cam_periph::softc, and T_PROCESSOR.
Referenced by ptasync(), ptctor(), and ptoninvalidate().
|
static |
Definition at line 170 of file scsi_pt.c.
References cam_periph_lock, cam_periph_release_locked(), cam_periph_unlock, and cam_periph::softc.
|
static |
Definition at line 247 of file scsi_pt.c.
References AC_BUS_RESET, AC_LOST_DEVICE, AC_SENT_BDR, pt_softc::bio_queue, cam_periph_lock, cam_periph_unlock, CAM_REQ_CMP, CAM_REQ_CMP_ERR, pt_softc::device_stats, ccb_getdev::inq_data, cam_periph::path, cam_periph::periph_name, pt_cdevsw, PT_STATE_NORMAL, ptasync(), SCSI_PT_DEFAULT_TIMEOUT, SID_TYPE, cam_periph::softc, ccb_pathinq::transport, cam_periph::unit_number, XPORT_DEVSTAT_TYPE, xpt_announce_periph(), xpt_path_inq(), and xpt_register_async().
|
static |
Definition at line 473 of file scsi_pt.c.
References pt_softc::bio_queue, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DEV_QFRZN, cam_release_devq(), CAM_REQ_CMP, CAM_RETRY_SELTO, CAM_STATUS_MASK, ccb_scsiio::ccb_h, ccb::ccb_h, ccb::csio, pt_softc::device_stats, ccb_hdr::path, cam_periph::path, PT_CCB_BUFFER_IO, PT_CCB_BUFFER_IO_UA, PT_CCB_RETRY_UA, PT_FLAG_DEVICE_INVALID, pterror(), ccb_scsiio::resid, SF_RETRY_UA, cam_periph::softc, ccb_hdr::status, xpt_print(), and xpt_release_ccb().
Referenced by ptstart().
|
static |
Definition at line 345 of file scsi_pt.c.
References cam_periph_lock, cam_periph_unlock, pt_softc::device_stats, and cam_periph::softc.
|
static |
Definition at line 561 of file scsi_pt.c.
References cam_periph_error().
Referenced by ptdone(), and ptioctl().
|
static |
Definition at line 568 of file scsi_pt.c.
References cam_periph_ioctl(), cam_periph_lock, cam_periph_unlock, pterror(), and cam_periph::softc.
|
static |
Definition at line 323 of file scsi_pt.c.
References pt_softc::bio_queue, cam_periph::path, PT_FLAG_DEVICE_INVALID, ptasync(), cam_periph::softc, and xpt_register_async().
|
static |
Definition at line 136 of file scsi_pt.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_acquire(), cam_periph_lock, cam_periph_release(), cam_periph_release_locked(), cam_periph_unlock, cam_periph::path, PT_FLAG_DEVICE_INVALID, PT_FLAG_OPEN, and cam_periph::softc.
|
static |
Definition at line 420 of file scsi_pt.c.
References pt_softc::bio_queue, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_PRIORITY_NORMAL, ccb::ccb_h, ccb::csio, pt_softc::device_stats, MSG_SIMPLE_Q_TAG, cam_periph::path, PT_CCB_BUFFER_IO_UA, ptdone(), scsi_send_receive(), cam_periph::softc, SSD_FULL_SIZE, xpt_action(), xpt_release_ccb(), and xpt_schedule().
|
static |
Definition at line 192 of file scsi_pt.c.
References pt_softc::bio_queue, cam_periph_lock, cam_periph_unlock, CAM_PRIORITY_NORMAL, PT_FLAG_DEVICE_INVALID, cam_periph::softc, and xpt_schedule().
void scsi_send_receive | ( | struct ccb_scsiio * | csio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
u_int | tag_action, | ||
int | readop, | ||
u_int | byte2, | ||
u_int32_t | xfer_len, | ||
u_int8_t * | data_ptr, | ||
u_int8_t | sense_len, | ||
u_int32_t | timeout | ||
) |
Definition at line 606 of file scsi_pt.c.
References scsi_send_receive::byte2, CAM_DIR_IN, CAM_DIR_OUT, cam_fill_csio(), cdb_t::cdb_bytes, ccb_scsiio::cdb_io, scsi_send_receive::control, scsi_send_receive::opcode, RECEIVE, scsi_ulto3b(), SEND, and scsi_send_receive::xfer_len.
Referenced by ptstart().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |