#ifndef _BUS_CAM_CAM_CCB_H_
#define _BUS_CAM_CAM_CCB_H_ 1
#include <sys/queue.h>
#include <sys/cdefs.h>
#include <sys/time.h>
#include <machine/limits.h>
#include <sys/callout.h>
#include "cam_debug.h"
#include "scsi/scsi_all.h"
#define IOCDBLEN CAM_MAX_CDBLEN
#define VUHBALEN 14
#define SIM_IDLEN 16
#define HBA_IDLEN 16
#define DEV_IDLEN 16
#define CCB_PERIPH_PRIV_SIZE 2
#define CCB_SIM_PRIV_SIZE 2
typedef enum {
CAM_CDB_POINTER = 0x00000001,
CAM_QUEUE_ENABLE = 0x00000002,
CAM_CDB_LINKED = 0x00000004,
CAM_NEGOTIATE = 0x00000008,
CAM_SCATTER_VALID = 0x00000010,
CAM_DIS_AUTOSENSE = 0x00000020,
CAM_DIR_RESV = 0x00000000,
CAM_DIR_IN = 0x00000040,
CAM_DIR_OUT = 0x00000080,
CAM_DIR_NONE = 0x000000C0,
CAM_DIR_MASK = 0x000000C0,
CAM_SOFT_RST_OP = 0x00000100,
CAM_ENG_SYNC = 0x00000200,
CAM_DEV_QFRZDIS = 0x00000400,
CAM_DEV_QFREEZE = 0x00000800,
CAM_HIGH_POWER = 0x00001000,
CAM_SENSE_PTR = 0x00002000,
CAM_SENSE_PHYS = 0x00004000,
CAM_TAG_ACTION_VALID = 0x00008000,
CAM_PASS_ERR_RECOVER = 0x00010000,
CAM_DIS_DISCONNECT = 0x00020000,
CAM_SG_LIST_PHYS = 0x00040000,
CAM_POLLED = 0x00080000,
CAM_QUIET = 0x00100000,
CAM_DATA_PHYS = 0x00200000,
CAM_CDB_PHYS = 0x00400000,
CAM_ENG_SGLIST = 0x00800000,
CAM_DIS_AUTOSRP = 0x01000000,
CAM_DIS_AUTODISC = 0x02000000,
CAM_TGT_CCB_AVAIL = 0x04000000,
CAM_TGT_PHASE_MODE = 0x08000000,
CAM_MSGB_VALID = 0x10000000,
CAM_STATUS_VALID = 0x20000000,
CAM_DATAB_VALID = 0x40000000,
CAM_SEND_SENSE = 0x08000000,
CAM_TERM_IO = 0x10000000,
CAM_DISCONNECT = 0x20000000,
CAM_SEND_STATUS = 0x40000000
} ccb_flags;
typedef enum {
XPT_FC_QUEUED = 0x100,
XPT_FC_USER_CCB = 0x200,
XPT_FC_XPT_ONLY = 0x400,
XPT_FC_DEV_QUEUED = 0x800 | XPT_FC_QUEUED,
XPT_NOOP = 0x00,
XPT_SCSI_IO = 0x01 | XPT_FC_DEV_QUEUED,
XPT_GDEV_TYPE = 0x02,
XPT_GDEVLIST = 0x03,
XPT_PATH_INQ = 0x04,
XPT_REL_SIMQ = 0x05,
XPT_SASYNC_CB = 0x06,
XPT_SDEV_TYPE = 0x07,
XPT_SCAN_BUS = 0x08 | XPT_FC_QUEUED | XPT_FC_USER_CCB
| XPT_FC_XPT_ONLY,
XPT_DEV_MATCH = 0x09 | XPT_FC_XPT_ONLY,
XPT_DEBUG = 0x0a,
XPT_PATH_STATS = 0x0b,
XPT_GDEV_STATS = 0x0c,
XPT_ABORT = 0x10,
XPT_RESET_BUS = 0x11 | XPT_FC_XPT_ONLY,
XPT_RESET_DEV = 0x12 | XPT_FC_DEV_QUEUED,
XPT_TERM_IO = 0x13,
XPT_SCAN_LUN = 0x14 | XPT_FC_QUEUED | XPT_FC_USER_CCB
| XPT_FC_XPT_ONLY,
XPT_GET_TRAN_SETTINGS = 0x15,
XPT_SET_TRAN_SETTINGS = 0x16,
XPT_CALC_GEOMETRY = 0x17,
XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY,
XPT_ENG_EXEC = 0x21 | XPT_FC_DEV_QUEUED,
XPT_EN_LUN = 0x30,
XPT_TARGET_IO = 0x31 | XPT_FC_DEV_QUEUED,
XPT_ACCEPT_TARGET_IO = 0x32 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
XPT_CONT_TARGET_IO = 0x33 | XPT_FC_DEV_QUEUED,
XPT_IMMED_NOTIFY = 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
XPT_NOTIFY_ACK = 0x35,
XPT_TRIM = 0x36 | XPT_FC_DEV_QUEUED,
XPT_VUNIQUE = 0x80
} xpt_opcode;
#define XPT_FC_GROUP_MASK 0xF0
#define XPT_FC_GROUP(op) ((op) & XPT_FC_GROUP_MASK)
#define XPT_FC_GROUP_COMMON 0x00
#define XPT_FC_GROUP_SCSI_CONTROL 0x10
#define XPT_FC_GROUP_HBA_ENGINE 0x20
#define XPT_FC_GROUP_TMODE 0x30
#define XPT_FC_GROUP_VENDOR_UNIQUE 0x80
#define XPT_FC_IS_DEV_QUEUED(ccb) \
(((ccb)->ccb_h.func_code & XPT_FC_DEV_QUEUED) == XPT_FC_DEV_QUEUED)
#define XPT_FC_IS_QUEUED(ccb) \
(((ccb)->ccb_h.func_code & XPT_FC_QUEUED) != 0)
typedef enum {
PROTO_UNKNOWN,
PROTO_UNSPECIFIED,
PROTO_SCSI,
PROTO_ATA,
PROTO_ATAPI,
} cam_proto;
typedef enum {
XPORT_UNKNOWN,
XPORT_UNSPECIFIED,
XPORT_SPI,
XPORT_FC,
XPORT_SSA,
XPORT_USB,
XPORT_PPB,
XPORT_ATA,
XPORT_SAS,
XPORT_SATA,
} cam_xport;
#define PROTO_VERSION_UNKNOWN (UINT_MAX - 1)
#define PROTO_VERSION_UNSPECIFIED UINT_MAX
#define XPORT_VERSION_UNKNOWN (UINT_MAX - 1)
#define XPORT_VERSION_UNSPECIFIED UINT_MAX
typedef union {
LIST_ENTRY(ccb_hdr) le;
SLIST_ENTRY(ccb_hdr) sle;
TAILQ_ENTRY(ccb_hdr) tqe;
STAILQ_ENTRY(ccb_hdr) stqe;
} camq_entry;
typedef union {
void *ptr;
u_long field;
u_int8_t bytes[sizeof(void *) > sizeof(u_long)
? sizeof(void *) : sizeof(u_long)];
} ccb_priv_entry;
typedef union {
ccb_priv_entry entries[CCB_PERIPH_PRIV_SIZE];
u_int8_t bytes[CCB_PERIPH_PRIV_SIZE * sizeof(ccb_priv_entry)];
} ccb_ppriv_area;
typedef union {
ccb_priv_entry entries[CCB_SIM_PRIV_SIZE];
u_int8_t bytes[CCB_SIM_PRIV_SIZE * sizeof(ccb_priv_entry)];
} ccb_spriv_area;
struct ccb_hdr {
cam_pinfo pinfo;
camq_entry xpt_links;
camq_entry sim_links;
camq_entry periph_links;
u_int32_t retry_count;
void (*cbfcnp)(struct cam_periph *, union ccb *);
xpt_opcode func_code;
u_int32_t status;
struct cam_path *path;
path_id_t path_id;
target_id_t target_id;
lun_id_t target_lun;
u_int32_t flags;
ccb_ppriv_area periph_priv;
ccb_spriv_area sim_priv;
u_int32_t timeout;
struct callout *timeout_ch;
char pad[48];
};
struct ccb_getdev {
struct ccb_hdr ccb_h;
struct scsi_inquiry_data inq_data;
u_int8_t serial_num[252];
u_int8_t reserved;
u_int8_t serial_num_len;
};
struct ccb_getdevstats {
struct ccb_hdr ccb_h;
int dev_openings;
int dev_active;
int devq_openings;
int devq_queued;
int held;
int maxtags;
int mintags;
struct timeval last_reset;
};
typedef enum {
CAM_GDEVLIST_LAST_DEVICE,
CAM_GDEVLIST_LIST_CHANGED,
CAM_GDEVLIST_MORE_DEVS,
CAM_GDEVLIST_ERROR
} ccb_getdevlist_status_e;
struct ccb_getdevlist {
struct ccb_hdr ccb_h;
char periph_name[DEV_IDLEN];
u_int32_t unit_number;
unsigned int generation;
u_int32_t index;
ccb_getdevlist_status_e status;
};
typedef enum {
PERIPH_MATCH_NONE = 0x000,
PERIPH_MATCH_PATH = 0x001,
PERIPH_MATCH_TARGET = 0x002,
PERIPH_MATCH_LUN = 0x004,
PERIPH_MATCH_NAME = 0x008,
PERIPH_MATCH_UNIT = 0x010,
PERIPH_MATCH_ANY = 0x01f
} periph_pattern_flags;
struct periph_match_pattern {
char periph_name[DEV_IDLEN];
u_int32_t unit_number;
path_id_t path_id;
target_id_t target_id;
lun_id_t target_lun;
periph_pattern_flags flags;
};
typedef enum {
DEV_MATCH_NONE = 0x000,
DEV_MATCH_PATH = 0x001,
DEV_MATCH_TARGET = 0x002,
DEV_MATCH_LUN = 0x004,
DEV_MATCH_INQUIRY = 0x008,
DEV_MATCH_ANY = 0x00f
} dev_pattern_flags;
struct device_match_pattern {
path_id_t path_id;
target_id_t target_id;
lun_id_t target_lun;
struct scsi_static_inquiry_pattern inq_pat;
dev_pattern_flags flags;
};
typedef enum {
BUS_MATCH_NONE = 0x000,
BUS_MATCH_PATH = 0x001,
BUS_MATCH_NAME = 0x002,
BUS_MATCH_UNIT = 0x004,
BUS_MATCH_BUS_ID = 0x008,
BUS_MATCH_ANY = 0x00f
} bus_pattern_flags;
struct bus_match_pattern {
path_id_t path_id;
char dev_name[DEV_IDLEN];
u_int32_t unit_number;
u_int32_t bus_id;
bus_pattern_flags flags;
};
union match_pattern {
struct periph_match_pattern periph_pattern;
struct device_match_pattern device_pattern;
struct bus_match_pattern bus_pattern;
};
typedef enum {
DEV_MATCH_PERIPH,
DEV_MATCH_DEVICE,
DEV_MATCH_BUS
} dev_match_type;
struct dev_match_pattern {
dev_match_type type;
union match_pattern pattern;
};
struct periph_match_result {
char periph_name[DEV_IDLEN];
u_int32_t unit_number;
path_id_t path_id;
target_id_t target_id;
lun_id_t target_lun;
};
typedef enum {
DEV_RESULT_NOFLAG = 0x00,
DEV_RESULT_UNCONFIGURED = 0x01
} dev_result_flags;
struct device_match_result {
path_id_t path_id;
target_id_t target_id;
lun_id_t target_lun;
struct scsi_inquiry_data inq_data;
dev_result_flags flags;
};
struct bus_match_result {
path_id_t path_id;
char dev_name[DEV_IDLEN];
u_int32_t unit_number;
u_int32_t bus_id;
};
union match_result {
struct periph_match_result periph_result;
struct device_match_result device_result;
struct bus_match_result bus_result;
};
struct dev_match_result {
dev_match_type type;
union match_result result;
};
typedef enum {
CAM_DEV_MATCH_LAST,
CAM_DEV_MATCH_MORE,
CAM_DEV_MATCH_LIST_CHANGED,
CAM_DEV_MATCH_SIZE_ERROR,
CAM_DEV_MATCH_ERROR
} ccb_dev_match_status;
typedef enum {
CAM_DEV_POS_NONE = 0x000,
CAM_DEV_POS_BUS = 0x001,
CAM_DEV_POS_TARGET = 0x002,
CAM_DEV_POS_DEVICE = 0x004,
CAM_DEV_POS_PERIPH = 0x008,
CAM_DEV_POS_PDPTR = 0x010,
CAM_DEV_POS_TYPEMASK = 0xf00,
CAM_DEV_POS_EDT = 0x100,
CAM_DEV_POS_PDRV = 0x200
} dev_pos_type;
struct ccb_dm_cookie {
void *bus;
void *target;
void *device;
void *periph;
void *pdrv;
};
struct ccb_dev_position {
u_int generations[4];
#define CAM_BUS_GENERATION 0x00
#define CAM_TARGET_GENERATION 0x01
#define CAM_DEV_GENERATION 0x02
#define CAM_PERIPH_GENERATION 0x03
dev_pos_type position_type;
struct ccb_dm_cookie cookie;
};
struct ccb_dev_match {
struct ccb_hdr ccb_h;
ccb_dev_match_status status;
u_int32_t num_patterns;
u_int32_t pattern_buf_len;
struct dev_match_pattern *patterns;
u_int32_t num_matches;
u_int32_t match_buf_len;
struct dev_match_result *matches;
struct ccb_dev_position pos;
};
#define CAM_VERSION 0x15
typedef enum {
PI_MDP_ABLE = 0x80,
PI_WIDE_32 = 0x40,
PI_WIDE_16 = 0x20,
PI_SDTR_ABLE = 0x10,
PI_LINKED_CDB = 0x08,
PI_TAG_ABLE = 0x02,
PI_SOFT_RST = 0x01
} pi_inqflag;
typedef enum {
PIT_PROCESSOR = 0x80,
PIT_PHASE = 0x40,
PIT_DISCONNECT = 0x20,
PIT_TERM_IO = 0x10,
PIT_GRP_6 = 0x08,
PIT_GRP_7 = 0x04
} pi_tmflag;
typedef enum {
PIM_SCANHILO = 0x80,
PIM_NOREMOVE = 0x40,
PIM_NOINITIATOR = 0x20,
PIM_NOBUSRESET = 0x10,
PIM_NO_6_BYTE = 0x08,
PIM_SEQSCAN = 0x04
} pi_miscflag;
struct ccb_pathinq_settings_spi {
u_int8_t ppr_options;
};
struct ccb_pathinq_settings_fc {
u_int64_t wwnn;
u_int64_t wwpn;
u_int32_t port;
u_int32_t bitrate;
};
struct ccb_pathinq_settings_sas {
u_int32_t bitrate;
};
#define PATHINQ_SETTINGS_SIZE 128
struct ccb_pathinq {
struct ccb_hdr ccb_h;
u_int8_t version_num;
u_int8_t hba_inquiry;
u_int8_t target_sprt;
u_int8_t hba_misc;
u_int16_t hba_eng_cnt;
u_int8_t vuhba_flags[VUHBALEN];
u_int32_t max_target;
u_int32_t max_lun;
u_int32_t async_flags;
path_id_t hpath_id;
target_id_t initiator_id;
char sim_vid[SIM_IDLEN];
char hba_vid[HBA_IDLEN];
char dev_name[DEV_IDLEN];
u_int32_t unit_number;
u_int32_t bus_id;
u_int32_t base_transfer_speed;
cam_proto protocol;
u_int protocol_version;
cam_xport transport;
u_int transport_version;
union {
struct ccb_pathinq_settings_spi spi;
struct ccb_pathinq_settings_fc fc;
struct ccb_pathinq_settings_sas sas;
char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE];
} xport_specific;
u_int maxio;
};
struct ccb_pathstats {
struct ccb_hdr ccb_h;
struct timeval last_reset;
};
typedef union {
u_int8_t *sense_ptr;
struct scsi_sense_data sense_buf;
} sense_t;
typedef union {
u_int8_t *cdb_ptr;
u_int8_t cdb_bytes[IOCDBLEN];
} cdb_t;
struct ccb_scsiio {
struct ccb_hdr ccb_h;
union ccb *next_ccb;
u_int8_t *req_map;
u_int8_t *data_ptr;
u_int32_t dxfer_len;
struct scsi_sense_data sense_data;
u_int8_t sense_len;
u_int8_t cdb_len;
u_int16_t sglist_cnt;
u_int8_t scsi_status;
u_int8_t sense_resid;
u_int32_t resid;
cdb_t cdb_io;
u_int8_t *msg_ptr;
u_int16_t msg_len;
u_int8_t tag_action;
#define CAM_TAG_ACTION_NONE 0x00
u_int tag_id;
u_int init_id;
};
struct ccb_accept_tio {
struct ccb_hdr ccb_h;
cdb_t cdb_io;
u_int8_t cdb_len;
u_int8_t tag_action;
u_int8_t sense_len;
u_int tag_id;
u_int init_id;
struct scsi_sense_data sense_data;
};
struct ccb_relsim {
struct ccb_hdr ccb_h;
u_int32_t release_flags;
#define RELSIM_ADJUST_OPENINGS 0x01
#define RELSIM_RELEASE_AFTER_TIMEOUT 0x02
#define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04
#define RELSIM_RELEASE_AFTER_QEMPTY 0x08
u_int32_t openings;
u_int32_t release_timeout;
u_int32_t qfrozen_cnt;
};
typedef enum {
AC_GETDEV_CHANGED = 0x800,
AC_INQ_CHANGED = 0x400,
AC_TRANSFER_NEG = 0x200,
AC_LOST_DEVICE = 0x100,
AC_FOUND_DEVICE = 0x080,
AC_PATH_DEREGISTERED = 0x040,
AC_PATH_REGISTERED = 0x020,
AC_SENT_BDR = 0x010,
AC_SCSI_AEN = 0x008,
AC_UNSOL_RESEL = 0x002,
AC_BUS_RESET = 0x001
} ac_code;
typedef void ac_callback_t (void *softc, u_int32_t code,
struct cam_path *path, void *args);
struct ccb_setasync {
struct ccb_hdr ccb_h;
u_int32_t event_enable;
ac_callback_t *callback;
void *callback_arg;
};
struct ccb_setdev {
struct ccb_hdr ccb_h;
u_int8_t dev_type;
};
struct ccb_abort {
struct ccb_hdr ccb_h;
union ccb *abort_ccb;
};
struct ccb_resetbus {
struct ccb_hdr ccb_h;
};
struct ccb_resetdev {
struct ccb_hdr ccb_h;
};
struct ccb_termio {
struct ccb_hdr ccb_h;
union ccb *termio_ccb;
};
typedef enum {
CTS_TYPE_CURRENT_SETTINGS,
CTS_TYPE_USER_SETTINGS
} cts_type;
struct ccb_trans_settings_scsi
{
u_int valid;
#define CTS_SCSI_VALID_TQ 0x01
u_int flags;
#define CTS_SCSI_FLAGS_TAG_ENB 0x01
};
struct ccb_trans_settings_spi
{
u_int valid;
#define CTS_SPI_VALID_SYNC_RATE 0x01
#define CTS_SPI_VALID_SYNC_OFFSET 0x02
#define CTS_SPI_VALID_BUS_WIDTH 0x04
#define CTS_SPI_VALID_DISC 0x08
#define CTS_SPI_VALID_PPR_OPTIONS 0x10
u_int flags;
#define CTS_SPI_FLAGS_DISC_ENB 0x01
u_int sync_period;
u_int sync_offset;
u_int bus_width;
u_int ppr_options;
};
struct ccb_trans_settings_fc {
u_int valid;
#define CTS_FC_VALID_WWNN 0x8000
#define CTS_FC_VALID_WWPN 0x4000
#define CTS_FC_VALID_PORT 0x2000
#define CTS_FC_VALID_SPEED 0x1000
u_int64_t wwnn;
u_int64_t wwpn;
u_int32_t port;
u_int32_t bitrate;
};
struct ccb_trans_settings_sas {
u_int valid;
#define CTS_SAS_VALID_SPEED 0x1000
u_int32_t bitrate;
};
struct ccb_trans_settings {
struct ccb_hdr ccb_h;
cts_type type;
cam_proto protocol;
u_int protocol_version;
cam_xport transport;
u_int transport_version;
union {
u_int valid;
struct ccb_trans_settings_scsi scsi;
} proto_specific;
union {
u_int valid;
struct ccb_trans_settings_spi spi;
struct ccb_trans_settings_fc fc;
struct ccb_trans_settings_sas sas;
} xport_specific;
};
struct ccb_calc_geometry {
struct ccb_hdr ccb_h;
u_int32_t block_size;
u_int64_t volume_size;
u_int32_t cylinders;
u_int8_t heads;
u_int8_t secs_per_track;
};
struct ccb_rescan {
struct ccb_hdr ccb_h;
cam_flags flags;
};
struct ccb_debug {
struct ccb_hdr ccb_h;
cam_debug_flags flags;
};
struct ccb_en_lun {
struct ccb_hdr ccb_h;
u_int16_t grp6_len;
u_int16_t grp7_len;
u_int8_t enable;
};
struct ccb_immed_notify {
struct ccb_hdr ccb_h;
struct scsi_sense_data sense_data;
u_int8_t sense_len;
u_int8_t initiator_id;
u_int8_t message_args[7];
};
struct ccb_notify_ack {
struct ccb_hdr ccb_h;
u_int16_t seq_id;
u_int8_t event;
};
typedef enum {
EIT_BUFFER,
EIT_LOSSLESS,
EIT_LOSSY,
EIT_ENCRYPT
} ei_type;
typedef enum {
EAD_VUNIQUE,
EAD_LZ1V1,
EAD_LZ2V1,
EAD_LZ2V2
} ei_algo;
struct ccb_eng_inq {
struct ccb_hdr ccb_h;
u_int16_t eng_num;
ei_type eng_type;
ei_algo eng_algo;
u_int32_t eng_memeory;
};
struct ccb_eng_exec {
struct ccb_hdr ccb_h;
u_int8_t *pdrv_ptr;
u_int8_t *req_map;
u_int8_t *data_ptr;
u_int32_t dxfer_len;
u_int8_t *engdata_ptr;
u_int16_t sglist_cnt;
u_int32_t dmax_len;
u_int32_t dest_len;
int32_t src_resid;
u_int32_t timeout;
u_int16_t eng_num;
u_int16_t vu_flags;
};
#define CAM_TIME_DEFAULT 0x00000000
#define CAM_TIME_INFINITY 0xFFFFFFFF
#define CAM_SUCCESS 0
#define CAM_FALSE 0
#define CAM_TRUE 1
#define XPT_CCB_INVALID -1
union ccb {
struct ccb_hdr ccb_h;
struct ccb_scsiio csio;
struct ccb_getdev cgd;
struct ccb_getdevlist cgdl;
struct ccb_pathinq cpi;
struct ccb_relsim crs;
struct ccb_setasync csa;
struct ccb_setdev csd;
struct ccb_pathstats cpis;
struct ccb_getdevstats cgds;
struct ccb_dev_match cdm;
struct ccb_trans_settings cts;
struct ccb_calc_geometry ccg;
struct ccb_abort cab;
struct ccb_resetbus crb;
struct ccb_resetdev crd;
struct ccb_termio tio;
struct ccb_accept_tio atio;
struct ccb_scsiio ctio;
struct ccb_en_lun cel;
struct ccb_immed_notify cin;
struct ccb_notify_ack cna;
struct ccb_eng_inq cei;
struct ccb_eng_exec cee;
struct ccb_rescan crcn;
struct ccb_debug cdbg;
};
__BEGIN_DECLS
static __inline void
cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
u_int32_t flags, u_int8_t tag_action,
u_int8_t *data_ptr, u_int32_t dxfer_len,
u_int8_t sense_len, u_int8_t cdb_len,
u_int32_t timeout);
static __inline void
cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
u_int32_t flags, u_int tag_action, u_int tag_id,
u_int init_id, u_int scsi_status, u_int8_t *data_ptr,
u_int32_t dxfer_len, u_int32_t timeout);
static __inline void
cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
u_int32_t flags, u_int8_t tag_action,
u_int8_t *data_ptr, u_int32_t dxfer_len,
u_int8_t sense_len, u_int8_t cdb_len,
u_int32_t timeout)
{
csio->ccb_h.func_code = XPT_SCSI_IO;
csio->ccb_h.flags = flags;
csio->ccb_h.retry_count = retries;
csio->ccb_h.cbfcnp = cbfcnp;
csio->ccb_h.timeout = timeout;
csio->data_ptr = data_ptr;
csio->dxfer_len = dxfer_len;
csio->sense_len = sense_len;
csio->cdb_len = cdb_len;
csio->tag_action = tag_action;
}
static __inline void
cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
u_int32_t flags, u_int tag_action, u_int tag_id,
u_int init_id, u_int scsi_status, u_int8_t *data_ptr,
u_int32_t dxfer_len, u_int32_t timeout)
{
csio->ccb_h.func_code = XPT_CONT_TARGET_IO;
csio->ccb_h.flags = flags;
csio->ccb_h.retry_count = retries;
csio->ccb_h.cbfcnp = cbfcnp;
csio->ccb_h.timeout = timeout;
csio->data_ptr = data_ptr;
csio->dxfer_len = dxfer_len;
csio->scsi_status = scsi_status;
csio->tag_action = tag_action;
csio->tag_id = tag_id;
csio->init_id = init_id;
}
void cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended);
__END_DECLS
#endif