Deleted Added
full compact
cam_ccb.h (44499) cam_ccb.h (46581)
1/*
2 * Data structures and definitions for CAM Control Blocks (CCBs).
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*
2 * Data structures and definitions for CAM Control Blocks (CCBs).
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $Id: cam_ccb.h,v 1.3 1998/12/10 04:05:49 gibbs Exp $
28 * $Id: cam_ccb.h,v 1.4 1999/03/05 23:13:20 gibbs Exp $
29 */
30
31#ifndef _CAM_CAM_CCB_H
32#define _CAM_CAM_CCB_H 1
33
34#include <sys/queue.h>
35#include <sys/cdefs.h>
36#ifndef KERNEL

--- 56 unchanged lines hidden (view full) ---

93/* Host target Mode flags */
94 CAM_TERM_IO = 0x20000000,/* Terminate I/O Message sup. */
95 CAM_DISCONNECT = 0x40000000,/* Disconnects are mandatory */
96 CAM_SEND_STATUS = 0x80000000,/* Send status after data phase */
97} ccb_flags;
98
99/* XPT Opcodes for xpt_action */
100typedef enum {
29 */
30
31#ifndef _CAM_CAM_CCB_H
32#define _CAM_CAM_CCB_H 1
33
34#include <sys/queue.h>
35#include <sys/cdefs.h>
36#ifndef KERNEL

--- 56 unchanged lines hidden (view full) ---

93/* Host target Mode flags */
94 CAM_TERM_IO = 0x20000000,/* Terminate I/O Message sup. */
95 CAM_DISCONNECT = 0x40000000,/* Disconnects are mandatory */
96 CAM_SEND_STATUS = 0x80000000,/* Send status after data phase */
97} ccb_flags;
98
99/* XPT Opcodes for xpt_action */
100typedef enum {
101/* Function code flags are bits greater than 0xff */
102 XPT_FC_QUEUED = 0x100,
103 /* Non-immediate function code */
104 XPT_FC_USER_CCB = 0x200,
105 XPT_FC_XPT_ONLY = 0x400,
106 /* Only for the transport layer device */
101/* Common function commands: 0x00->0x0F */
107/* Common function commands: 0x00->0x0F */
102 XPT_NOOP, /* Execute Nothing */
103 XPT_SCSI_IO, /* Execute the requested I/O operation */
104 XPT_GDEV_TYPE, /* Get type information for specified device */
105 XPT_GDEVLIST, /* Get a list of peripheral devices */
106 XPT_PATH_INQ, /* Path routing inquiry */
107 XPT_REL_SIMQ, /* Release a frozen SIM queue */
108 XPT_SASYNC_CB, /* Set Asynchronous Callback Parameters */
109 XPT_SDEV_TYPE, /* Set device type information */
110 XPT_SCAN_BUS, /* (Re)Scan the SCSI Bus */
111 XPT_DEV_MATCH, /* Get EDT entries matching the given pattern */
112 XPT_DEBUG, /* Turn on debugging for a bus, target or lun */
108 XPT_NOOP = 0x00,
109 /* Execute Nothing */
110 XPT_SCSI_IO = 0x01 | XPT_FC_QUEUED,
111 /* Execute the requested I/O operation */
112 XPT_GDEV_TYPE = 0x02,
113 /* Get type information for specified device */
114 XPT_GDEVLIST = 0x03,
115 /* Get a list of peripheral devices */
116 XPT_PATH_INQ = 0x04,
117 /* Path routing inquiry */
118 XPT_REL_SIMQ = 0x05,
119 /* Release a frozen SIM queue */
120 XPT_SASYNC_CB = 0x06,
121 /* Set Asynchronous Callback Parameters */
122 XPT_SDEV_TYPE = 0x07,
123 /* Set device type information */
124 XPT_SCAN_BUS = 0x08 | XPT_FC_QUEUED | XPT_FC_USER_CCB
125 | XPT_FC_XPT_ONLY,
126 /* (Re)Scan the SCSI Bus */
127 XPT_DEV_MATCH = 0x09 | XPT_FC_XPT_ONLY,
128 /* Get EDT entries matching the given pattern */
129 XPT_DEBUG = 0x0a,
130 /* Turn on debugging for a bus, target or lun */
113/* SCSI Control Functions: 0x10->0x1F */
131/* SCSI Control Functions: 0x10->0x1F */
114 XPT_ABORT = 0x10, /* Abort the specified CCB */
115 XPT_RESET_BUS, /* Reset the specified SCSI bus */
116 XPT_RESET_DEV, /* Bus Device Reset the specified SCSI device */
117 XPT_TERM_IO, /* Terminate the I/O process */
118 XPT_SCAN_LUN, /* Scan Logical Unit */
119 XPT_GET_TRAN_SETTINGS, /*
132 XPT_ABORT = 0x10,
133 /* Abort the specified CCB */
134 XPT_RESET_BUS = 0x11 | XPT_FC_XPT_ONLY,
135 /* Reset the specified SCSI bus */
136 XPT_RESET_DEV = 0x12,
137 /* Bus Device Reset the specified SCSI device */
138 XPT_TERM_IO = 0x13,
139 /* Terminate the I/O process */
140 XPT_SCAN_LUN = 0x14 | XPT_FC_QUEUED | XPT_FC_USER_CCB
141 | XPT_FC_XPT_ONLY,
142 /* Scan Logical Unit */
143 XPT_GET_TRAN_SETTINGS = 0x15,
144 /*
120 * Get default/user transfer settings
121 * for the target
122 */
145 * Get default/user transfer settings
146 * for the target
147 */
123 XPT_SET_TRAN_SETTINGS, /*
148 XPT_SET_TRAN_SETTINGS = 0x16,
149 /*
124 * Set transfer rate/width
125 * negotiation settings
126 */
150 * Set transfer rate/width
151 * negotiation settings
152 */
127 XPT_CALC_GEOMETRY, /*
153 XPT_CALC_GEOMETRY = 0x17,
154 /*
128 * Calculate the geometry parameters for
129 * a device give the sector size and
130 * volume size.
131 */
132
133/* HBA engine commands 0x20->0x2F */
155 * Calculate the geometry parameters for
156 * a device give the sector size and
157 * volume size.
158 */
159
160/* HBA engine commands 0x20->0x2F */
134 XPT_ENG_INQ = 0x20, /* HBA engine feature inquiry */
135 XPT_ENG_EXEC, /* HBA execute engine request */
161 XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY,
162 /* HBA engine feature inquiry */
163 XPT_ENG_EXEC = 0x21 | XPT_FC_QUEUED | XPT_FC_XPT_ONLY,
164 /* HBA execute engine request */
136
137/* Target mode commands: 0x30->0x3F */
165
166/* Target mode commands: 0x30->0x3F */
138 XPT_EN_LUN = 0x30, /* Enable LUN as a target */
139 XPT_TARGET_IO, /* Execute target I/O request */
140 XPT_ACCEPT_TARGET_IO, /* Accept Host Target Mode CDB */
141 XPT_CONT_TARGET_IO, /* Continue Host Target I/O Connection */
142 XPT_IMMED_NOTIFY, /* Notify Host Target driver of event */
143 XPT_NOTIFY_ACK, /* Acknowledgement of event */
167 XPT_EN_LUN = 0x30,
168 /* Enable LUN as a target */
169 XPT_TARGET_IO = 0x31 | XPT_FC_QUEUED,
170 /* Execute target I/O request */
171 XPT_ACCEPT_TARGET_IO = 0x32 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
172 /* Accept Host Target Mode CDB */
173 XPT_CONT_TARGET_IO = 0x33 | XPT_FC_QUEUED,
174 /* Continue Host Target I/O Connection */
175 XPT_IMMED_NOTIFY = 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
176 /* Notify Host Target driver of event */
177 XPT_NOTIFY_ACK = 0x35,
178 /* Acknowledgement of event */
144
145/* Vendor Unique codes: 0x80->0x8F */
179
180/* Vendor Unique codes: 0x80->0x8F */
146 XPT_VUNIQUE = 0x80
181 XPT_VUNIQUE = 0x80
147} xpt_opcode;
148
182} xpt_opcode;
183
149#define XPT_OPCODE_GROUP_MASK 0xF0
150#define XPT_OPCODE_GROUP(op) ((op) & XPT_OPCODE_GROUP_MASK)
151#define XPT_OPCODE_GROUP_COMMON 0x00
152#define XPT_OPCODE_GROUP_SCSI_CONTROL 0x10
153#define XPT_OPCODE_GROUP_HBA_ENGINE 0x20
154#define XPT_OPCODE_GROUP_TMODE 0x30
155#define XPT_OPCODE_GROUP_VENDOR_UNIQUE 0x80
184#define XPT_FC_GROUP_MASK 0xF0
185#define XPT_FC_GROUP(op) ((op) & XPT_FC_GROUP_MASK)
186#define XPT_FC_GROUP_COMMON 0x00
187#define XPT_FC_GROUP_SCSI_CONTROL 0x10
188#define XPT_FC_GROUP_HBA_ENGINE 0x20
189#define XPT_FC_GROUP_TMODE 0x30
190#define XPT_FC_GROUP_VENDOR_UNIQUE 0x80
156
157typedef union {
158 LIST_ENTRY(ccb_hdr) le;
159 SLIST_ENTRY(ccb_hdr) sle;
160 TAILQ_ENTRY(ccb_hdr) tqe;
161 STAILQ_ENTRY(ccb_hdr) stqe;
162} camq_entry;
163

--- 47 unchanged lines hidden (view full) ---

211 int dev_openings; /* Space left for more work on device*/
212 int dev_active; /* Transactions running on the device */
213 int devq_openings;/* Space left for more queued work */
214 int devq_queued; /* Transactions queued to be sent */
215 int held; /*
216 * CCBs held by peripheral drivers
217 * for this device
218 */
191
192typedef union {
193 LIST_ENTRY(ccb_hdr) le;
194 SLIST_ENTRY(ccb_hdr) sle;
195 TAILQ_ENTRY(ccb_hdr) tqe;
196 STAILQ_ENTRY(ccb_hdr) stqe;
197} camq_entry;
198

--- 47 unchanged lines hidden (view full) ---

246 int dev_openings; /* Space left for more work on device*/
247 int dev_active; /* Transactions running on the device */
248 int devq_openings;/* Space left for more queued work */
249 int devq_queued; /* Transactions queued to be sent */
250 int held; /*
251 * CCBs held by peripheral drivers
252 * for this device
253 */
219 u_int8_t maxtags; /*
254 int maxtags; /*
220 * Boundary conditions for number of
221 * tagged operations
222 */
255 * Boundary conditions for number of
256 * tagged operations
257 */
223 u_int8_t mintags;
258 int mintags;
224};
225
226
227typedef enum {
228 CAM_GDEVLIST_LAST_DEVICE,
229 CAM_GDEVLIST_LIST_CHANGED,
230 CAM_GDEVLIST_MORE_DEVS,
231 CAM_GDEVLIST_ERROR

--- 81 unchanged lines hidden (view full) ---

313struct periph_match_result {
314 char periph_name[DEV_IDLEN];
315 u_int32_t unit_number;
316 path_id_t path_id;
317 target_id_t target_id;
318 lun_id_t target_lun;
319};
320
259};
260
261
262typedef enum {
263 CAM_GDEVLIST_LAST_DEVICE,
264 CAM_GDEVLIST_LIST_CHANGED,
265 CAM_GDEVLIST_MORE_DEVS,
266 CAM_GDEVLIST_ERROR

--- 81 unchanged lines hidden (view full) ---

348struct periph_match_result {
349 char periph_name[DEV_IDLEN];
350 u_int32_t unit_number;
351 path_id_t path_id;
352 target_id_t target_id;
353 lun_id_t target_lun;
354};
355
356typedef enum {
357 DEV_RESULT_NOFLAG = 0x00,
358 DEV_RESULT_UNCONFIGURED = 0x01
359} dev_result_flags;
360
321struct device_match_result {
322 path_id_t path_id;
323 target_id_t target_id;
324 lun_id_t target_lun;
325 struct scsi_inquiry_data inq_data;
361struct device_match_result {
362 path_id_t path_id;
363 target_id_t target_id;
364 lun_id_t target_lun;
365 struct scsi_inquiry_data inq_data;
366 dev_result_flags flags;
326};
327
328struct bus_match_result {
329 path_id_t path_id;
330 char dev_name[DEV_IDLEN];
331 u_int32_t unit_number;
332 u_int32_t bus_id;
333};

--- 57 unchanged lines hidden (view full) ---

391 u_int32_t match_buf_len;
392 struct dev_match_result *matches;
393 struct ccb_dev_position pos;
394};
395
396/*
397 * Definitions for the path inquiry CCB fields.
398 */
367};
368
369struct bus_match_result {
370 path_id_t path_id;
371 char dev_name[DEV_IDLEN];
372 u_int32_t unit_number;
373 u_int32_t bus_id;
374};

--- 57 unchanged lines hidden (view full) ---

432 u_int32_t match_buf_len;
433 struct dev_match_result *matches;
434 struct ccb_dev_position pos;
435};
436
437/*
438 * Definitions for the path inquiry CCB fields.
439 */
399#define CAM_VERSION 0x10 /* Hex value for current version */
440#define CAM_VERSION 0x11 /* Hex value for current version */
400
401typedef enum {
402 PI_MDP_ABLE = 0x80, /* Supports MDP message */
403 PI_WIDE_32 = 0x40, /* Supports 32 bit wide SCSI */
404 PI_WIDE_16 = 0x20, /* Supports 16 bit wide SCSI */
405 PI_SDTR_ABLE = 0x10, /* Supports SDTR message */
406 PI_LINKED_CDB = 0x08, /* Supports linked CDBs */
407 PI_TAG_ABLE = 0x02, /* Supports tag queue messages */

--- 31 unchanged lines hidden (view full) ---

439 u_int32_t async_flags; /* Installed Async handlers */
440 path_id_t hpath_id; /* Highest Path ID in the subsystem */
441 target_id_t initiator_id; /* ID of the HBA on the SCSI bus */
442 char sim_vid[SIM_IDLEN]; /* Vendor ID of the SIM */
443 char hba_vid[HBA_IDLEN]; /* Vendor ID of the HBA */
444 char dev_name[DEV_IDLEN];/* Device name for SIM */
445 u_int32_t unit_number; /* Unit number for SIM */
446 u_int32_t bus_id; /* Bus ID for SIM */
441
442typedef enum {
443 PI_MDP_ABLE = 0x80, /* Supports MDP message */
444 PI_WIDE_32 = 0x40, /* Supports 32 bit wide SCSI */
445 PI_WIDE_16 = 0x20, /* Supports 16 bit wide SCSI */
446 PI_SDTR_ABLE = 0x10, /* Supports SDTR message */
447 PI_LINKED_CDB = 0x08, /* Supports linked CDBs */
448 PI_TAG_ABLE = 0x02, /* Supports tag queue messages */

--- 31 unchanged lines hidden (view full) ---

480 u_int32_t async_flags; /* Installed Async handlers */
481 path_id_t hpath_id; /* Highest Path ID in the subsystem */
482 target_id_t initiator_id; /* ID of the HBA on the SCSI bus */
483 char sim_vid[SIM_IDLEN]; /* Vendor ID of the SIM */
484 char hba_vid[HBA_IDLEN]; /* Vendor ID of the HBA */
485 char dev_name[DEV_IDLEN];/* Device name for SIM */
486 u_int32_t unit_number; /* Unit number for SIM */
487 u_int32_t bus_id; /* Bus ID for SIM */
488 u_int32_t base_transfer_speed;/* Base bus speed in KB/sec */
447};
448
449typedef union {
450 u_int8_t *sense_ptr; /*
451 * Pointer to storage
452 * for sense information
453 */
454 /* Storage Area for sense information */

--- 340 unchanged lines hidden ---
489};
490
491typedef union {
492 u_int8_t *sense_ptr; /*
493 * Pointer to storage
494 * for sense information
495 */
496 /* Storage Area for sense information */

--- 340 unchanged lines hidden ---