FreeBSD kernel CAM code
ctl_io.h
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2003 Silicon Graphics International Corp.
5 * Copyright (c) 2014-2015 Alexander Motin <mav@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions, and the following disclaimer,
13 * without modification.
14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15 * substantially similar to the "NO WARRANTY" disclaimer below
16 * ("Disclaimer") and any redistribution must be conditioned upon
17 * including a substantially similar Disclaimer requirement for further
18 * binary redistribution.
19 *
20 * NO WARRANTY
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGES.
32 *
33 * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_io.h#5 $
34 * $FreeBSD$
35 */
36/*
37 * CAM Target Layer data movement structures/interface.
38 *
39 * Author: Ken Merry <ken@FreeBSD.org>
40 */
41
42#ifndef _CTL_IO_H_
43#define _CTL_IO_H_
44
45#ifndef _KERNEL
46#include <stdbool.h>
47#endif
48
49#define CTL_MAX_CDBLEN 32
50/*
51 * Uncomment this next line to enable printing out times for I/Os
52 * that take longer than CTL_TIME_IO_SECS seconds to get to the datamove
53 * and/or done stage.
54 */
55#define CTL_TIME_IO
56#ifdef CTL_TIME_IO
57#define CTL_TIME_IO_DEFAULT_SECS 90
58#endif
59
60/*
61 * Uncomment this next line to enable the CTL I/O delay feature. You
62 * can delay I/O at two different points -- datamove and done. This is
63 * useful for diagnosing abort conditions (for hosts that send an abort on a
64 * timeout), and for determining how long a host's timeout is.
65 */
66//#define CTL_IO_DELAY
67
68typedef enum {
69 CTL_STATUS_NONE, /* No status */
70 CTL_SUCCESS, /* Transaction completed successfully */
71 CTL_CMD_TIMEOUT, /* Command timed out, shouldn't happen here */
72 CTL_SEL_TIMEOUT, /* Selection timeout, shouldn't happen here */
73 CTL_ERROR, /* General CTL error XXX expand on this? */
74 CTL_SCSI_ERROR, /* SCSI error, look at status byte/sense data */
75 CTL_CMD_ABORTED, /* Command aborted, don't return status */
76 CTL_STATUS_MASK = 0xfff,/* Mask off any status flags */
77 CTL_AUTOSENSE = 0x1000 /* Autosense performed */
79
80/*
81 * WARNING: Keep the data in/out/none flags where they are. They're used
82 * in conjunction with ctl_cmd_flags. See comment above ctl_cmd_flags
83 * definition in ctl_private.h.
84 */
85typedef enum {
86 CTL_FLAG_NONE = 0x00000000, /* no flags */
87 CTL_FLAG_DATA_IN = 0x00000001, /* DATA IN */
88 CTL_FLAG_DATA_OUT = 0x00000002, /* DATA OUT */
89 CTL_FLAG_DATA_NONE = 0x00000003, /* no data */
90 CTL_FLAG_DATA_MASK = 0x00000003,
91 CTL_FLAG_DO_AUTOSENSE = 0x00000020, /* grab sense info */
92 CTL_FLAG_USER_REQ = 0x00000040, /* request came from userland */
93 CTL_FLAG_ALLOCATED = 0x00000100, /* data space allocated */
94 CTL_FLAG_ABORT_STATUS = 0x00000400, /* return TASK ABORTED status */
95 CTL_FLAG_ABORT = 0x00000800, /* this I/O should be aborted */
96 CTL_FLAG_DMA_INPROG = 0x00001000, /* DMA in progress */
97 CTL_FLAG_DELAY_DONE = 0x00004000, /* delay injection done */
98 CTL_FLAG_INT_COPY = 0x00008000, /* internal copy, no done call*/
101 CTL_FLAG_IS_WAS_ON_RTR = 0x00040000, /* Don't rerun cmd on failover*/
102 CTL_FLAG_BUS_ADDR = 0x00080000, /* ctl_sglist contains BUS
103 addresses, not virtual ones*/
104 CTL_FLAG_IO_CONT = 0x00100000, /* Continue I/O instead of
105 completing */
106#if 0
107 CTL_FLAG_ALREADY_DONE = 0x00200000 /* I/O already completed */
108#endif
110 CTL_FLAG_DMA_QUEUED = 0x00800000, /* DMA queued but not started*/
111 CTL_FLAG_STATUS_QUEUED = 0x01000000, /* Status queued but not sent*/
112
113 CTL_FLAG_FAILOVER = 0x04000000, /* Killed by a failover */
114 CTL_FLAG_IO_ACTIVE = 0x08000000, /* I/O active on this SC */
115 CTL_FLAG_STATUS_SENT = 0x10000000, /* Status sent by datamove */
116 CTL_FLAG_SERSEQ_DONE = 0x20000000 /* All storage I/O started */
118
120 uint64_t lba;
121 uint32_t len;
122};
123
125 uint64_t lba;
126 uint32_t len;
127 uint32_t flags;
128#define CTL_LLF_FUA 0x04000000
129#define CTL_LLF_DPO 0x08000000
130#define CTL_LLF_READ 0x10000000
131#define CTL_LLF_WRITE 0x20000000
132#define CTL_LLF_VERIFY 0x40000000
133#define CTL_LLF_COMPARE 0x80000000
134};
135
137 uint8_t *ptr;
138 uint32_t len;
139 uint32_t flags;
140};
141
142union ctl_priv {
143 uint8_t bytes[sizeof(uint64_t) * 2];
144 uint64_t integer;
145 uint64_t integers[2];
146 void *ptr;
147 void *ptrs[2];
148};
149
150/*
151 * Number of CTL private areas.
152 */
153#define CTL_NUM_PRIV 6
154
155/*
156 * Which private area are we using for a particular piece of data?
157 */
158#define CTL_PRIV_LUN 0 /* CTL LUN pointer goes here */
159#define CTL_PRIV_LBA_LEN 1 /* Decoded LBA/len for read/write*/
160#define CTL_PRIV_MODEPAGE 1 /* Modepage info for config write */
161#define CTL_PRIV_BACKEND 2 /* Reserved for block, RAIDCore */
162#define CTL_PRIV_BACKEND_LUN 3 /* Backend LUN pointer */
163#define CTL_PRIV_FRONTEND 4 /* Frontend storage */
164#define CTL_PRIV_FRONTEND2 5 /* Another frontend storage */
165
166#define CTL_LUN(io) ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[0])
167#define CTL_SOFTC(io) ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1])
168#define CTL_BACKEND_LUN(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptrs[0])
169#define CTL_PORT(io) (((struct ctl_softc *)CTL_SOFTC(io))-> \
170 ctl_ports[(io)->io_hdr.nexus.targ_port])
171
172/*
173 * These are used only on Originating SC in XFER mode, where requests don't
174 * ever reach backends, so we can reuse backend's private storage.
175 */
176#define CTL_RSGL(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[0])
177#define CTL_LSGL(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[1])
178#define CTL_RSGLT(io) ((struct ctl_sg_entry *)CTL_RSGL(io))
179#define CTL_LSGLT(io) ((struct ctl_sg_entry *)CTL_LSGL(io))
180
181#define CTL_INVALID_PORTNAME 0xFF
182#define CTL_UNMAPPED_IID 0xFF
183
185 void *addr;
186 size_t len;
187};
188
189typedef enum {
194
195struct ctl_nexus {
196 uint32_t initid; /* Initiator ID */
197 uint32_t targ_port; /* Target port, filled in by PORT */
198 uint32_t targ_lun; /* Destination lun */
199 uint32_t targ_mapped_lun; /* Destination lun CTL-wide */
200};
201
202typedef enum {
211 CTL_MSG_UA, /* Set/clear UA on secondary. */
212 CTL_MSG_PORT_SYNC, /* Information about port. */
213 CTL_MSG_LUN_SYNC, /* Information about LUN. */
214 CTL_MSG_IID_SYNC, /* Information about initiator. */
215 CTL_MSG_LOGIN, /* Information about HA peer. */
216 CTL_MSG_MODE_SYNC, /* Mode page current content. */
217 CTL_MSG_FAILOVER /* Fake, never sent though the wire */
219
220struct ctl_scsiio;
221
223 uint32_t version; /* interface version XXX */
224 ctl_io_type io_type; /* task I/O, SCSI I/O, etc. */
226 struct ctl_nexus nexus; /* Initiator, port, target, lun */
227 uint32_t iid_indx; /* the index into the iid mapping */
228 uint32_t flags; /* transaction flags */
229 uint32_t status; /* transaction status */
230 uint32_t port_status; /* trans status, set by PORT, 0 = good*/
231 uint32_t timeout; /* timeout in ms */
232 uint32_t retries; /* retry count */
233#ifdef CTL_IO_DELAY
234 struct callout delay_callout;
235#endif /* CTL_IO_DELAY */
236#ifdef CTL_TIME_IO
237 time_t start_time; /* I/O start time */
238 struct bintime start_bt; /* Timer start ticks */
239 struct bintime dma_start_bt; /* DMA start ticks */
240 struct bintime dma_bt; /* DMA total ticks */
241#endif /* CTL_TIME_IO */
242 uint32_t num_dmas; /* Number of DMAs */
243 union ctl_io *remote_io; /* I/O counterpart on remote HA side */
244 union ctl_io *blocker; /* I/O blocking this one */
245 void *pool; /* I/O pool */
246 union ctl_priv ctl_private[CTL_NUM_PRIV];/* CTL private area */
247 TAILQ_HEAD(, ctl_io_hdr) blocked_queue; /* I/Os blocked by this one */
248 STAILQ_ENTRY(ctl_io_hdr) links; /* linked list pointer */
249 LIST_ENTRY(ctl_io_hdr) ooa_links; /* ooa_queue links */
250 TAILQ_ENTRY(ctl_io_hdr) blocked_links; /* blocked_queue links */
251};
252
253typedef enum {
260
261union ctl_io;
262
263typedef void (*ctl_ref)(void *arg, int diff);
264
265/*
266 * SCSI passthrough I/O structure for the CAM Target Layer. Note
267 * that some of these fields are here for completeness, but they aren't
268 * used in the CTL implementation. e.g., timeout and retries won't be
269 * used.
270 *
271 * Note: Make sure the io_hdr is *always* the first element in this
272 * structure.
273 */
275 struct ctl_io_hdr io_hdr; /* common to all I/O types */
276
277 /*
278 * The ext_* fields are generally intended for frontend use; CTL itself
279 * doesn't modify or use them.
280 */
281 uint32_t ext_sg_entries; /* 0 = no S/G list, > 0 = num entries */
282 uint8_t *ext_data_ptr; /* data buffer or S/G list */
283 uint32_t ext_data_len; /* Data transfer length */
284 uint32_t ext_data_filled; /* Amount of data filled so far */
285
286 /*
287 * The number of scatter/gather entries in the list pointed to
288 * by kern_data_ptr. 0 means there is no list, just a data pointer.
289 */
291
292 uint32_t rem_sg_entries; /* Unused. */
293
294 /*
295 * The data pointer or a pointer to the scatter/gather list.
296 */
298
299 /*
300 * Length of the data buffer or scatter/gather list. It's also
301 * the length of this particular piece of the data transfer,
302 * ie. number of bytes expected to be transferred by the current
303 * invocation of frontend's datamove() callback. It's always
304 * less than or equal to kern_total_len.
305 */
307
308 /*
309 * Total length of data to be transferred during this particular
310 * SCSI command, as decoded from SCSI CDB.
311 */
313
314 /*
315 * Amount of data left after the current data transfer.
316 */
318
319 /*
320 * Byte offset of this transfer, equal to the amount of data
321 * already transferred for this SCSI command during previous
322 * datamove() invocations.
323 */
325
326 struct scsi_sense_data sense_data; /* sense data */
327 uint8_t sense_len; /* Returned sense length */
328 uint8_t scsi_status; /* SCSI status byte */
329 uint8_t seridx; /* Serialization index. */
330 uint8_t priority; /* Command priority */
331 uint32_t residual; /* Unused */
332 uint32_t tag_num; /* tag number */
333 ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/
334 uint8_t cdb_len; /* CDB length */
335 uint8_t cdb[CTL_MAX_CDBLEN]; /* CDB */
336 int (*be_move_done)(union ctl_io *io, bool samethr); /* called by fe */
337 int (*io_cont)(union ctl_io *io); /* to continue processing */
338 ctl_ref kern_data_ref; /* Method to reference/release data */
339 void *kern_data_arg; /* Opaque argument for kern_data_ref() */
340};
341
342typedef enum {
357
358typedef enum {
365
366/*
367 * Task management I/O structure. Aborts, bus resets, etc., are sent using
368 * this structure.
369 *
370 * Note: Make sure the io_hdr is *always* the first element in this
371 * structure.
372 */
374 struct ctl_io_hdr io_hdr; /* common to all I/O types */
375 ctl_task_type task_action; /* Target Reset, Abort, etc. */
376 uint32_t tag_num; /* tag number */
377 ctl_tag_type tag_type; /* simple, ordered, etc. */
378 uint8_t task_status; /* Complete, Succeeded, etc. */
379 uint8_t task_resp[3];/* Response information */
380};
381
382/*
383 * HA link messages.
384 */
385#define CTL_HA_VERSION 3
386
387/*
388 * Used for CTL_MSG_LOGIN.
389 */
394 int ha_id;
398};
399
400typedef enum {
408
409/*
410 * The PR info is specifically for sending Persistent Reserve actions
411 * to the other SC which it must also act on.
412 *
413 * Note: Make sure the io_hdr is *always* the first element in this
414 * structure.
415 */
418 uint8_t sa_res_key[8];
419 uint8_t res_type;
420 uint32_t residx;
421};
422
425 uint32_t status; /* transaction status */
428 struct ctl_nexus nexus; /* Initiator, port, target, lun */
429};
430
431#define CTL_HA_MAX_SG_ENTRIES 16
432#define CTL_HA_DATAMOVE_SEGMENT 131072
433
434/*
435 * Used for CTL_MSG_PERS_ACTION.
436 */
440};
441
442/*
443 * Used for CTL_MSG_UA.
444 */
450 uint8_t ua_info[8];
451};
452
453/*
454 * The S/G handling here is a little different than the standard ctl_scsiio
455 * structure, because we can't pass data by reference in between controllers.
456 * The S/G list in the ctl_scsiio struct is normally passed in the
457 * kern_data_ptr field. So kern_sg_entries here will always be non-zero,
458 * even if there is only one entry.
459 *
460 * Used for CTL_MSG_DATAMOVE.
461 */
464 ctl_io_flags flags; /* Only I/O flags are used here */
465 uint32_t sg_sequence; /* S/G portion number */
466 uint8_t sg_last; /* last S/G batch = 1 */
467 uint32_t sent_sg_entries; /* previous S/G count */
468 uint32_t cur_sg_entries; /* current S/G entries */
469 uint32_t kern_sg_entries; /* total S/G entries */
470 uint32_t kern_data_len; /* Length of this S/G list */
471 uint32_t kern_total_len; /* Total length of this
472 transaction */
473 uint32_t kern_data_resid; /* Length left to transfer
474 after this*/
475 uint32_t kern_rel_offset; /* Byte Offset of this
476 transfer */
478};
479
480/*
481 * Used for CTL_MSG_SERIALIZE, CTL_MSG_FINISH_IO, CTL_MSG_BAD_JUJU,
482 * and CTL_MSG_DATAMOVE_DONE.
483 */
486 uint32_t tag_num; /* tag number */
487 ctl_tag_type tag_type; /* simple, ordered, etc. */
488 uint8_t cdb[CTL_MAX_CDBLEN]; /* CDB */
489 uint8_t cdb_len; /* CDB length */
490 uint8_t scsi_status; /* SCSI status byte */
491 uint8_t sense_len; /* Returned sense length */
492 uint8_t priority; /* Command priority */
493 uint32_t port_status; /* trans status, set by FETD,
494 0 = good*/
495 uint32_t kern_data_resid; /* for DATAMOVE_DONE */
496 struct scsi_sense_data sense_data; /* sense data */
497};
498
499/*
500 * Used for CTL_MSG_MANAGE_TASKS.
501 */
504 ctl_task_type task_action; /* Target Reset, Abort, etc. */
505 uint32_t tag_num; /* tag number */
506 ctl_tag_type tag_type; /* simple, ordered, etc. */
507};
508
509/*
510 * Used for CTL_MSG_PORT_SYNC.
511 */
523 uint8_t data[];
524};
525
526/*
527 * Used for CTL_MSG_LUN_SYNC.
528 */
531 int flags;
532 unsigned int pr_generation;
533 uint32_t pr_res_idx;
534 uint8_t pr_res_type;
537 uint8_t data[];
538};
539
541 uint32_t pr_iid;
542 uint64_t pr_key;
543};
544
545/*
546 * Used for CTL_MSG_IID_SYNC.
547 */
552 uint64_t wwpn;
553 uint8_t data[];
554};
555
556/*
557 * Used for CTL_MSG_MODE_SYNC.
558 */
561 uint8_t page_code;
562 uint8_t subpage;
563 uint16_t page_len;
564 uint8_t data[];
565};
566
579};
580
581struct ctl_prio {
584};
585
586union ctl_io {
587 struct ctl_io_hdr io_hdr; /* common to all I/O types */
588 struct ctl_scsiio scsiio; /* Normal SCSI commands */
589 struct ctl_taskio taskio; /* SCSI task management/reset */
590 struct ctl_prio presio; /* update per. res info on other SC */
591};
592
593#ifdef _KERNEL
594
595union ctl_io *ctl_alloc_io(void *pool_ref);
596union ctl_io *ctl_alloc_io_nowait(void *pool_ref);
597void ctl_free_io(union ctl_io *io);
598void ctl_zero_io(union ctl_io *io);
599
600#endif /* _KERNEL */
601
602#endif /* _CTL_IO_H_ */
603
604/*
605 * vim: ts=8
606 */
void ctl_free_io(union ctl_io *io)
Definition: ctl.c:3991
ctl_io_type
Definition: ctl_io.h:189
@ CTL_IO_SCSI
Definition: ctl_io.h:191
@ CTL_IO_TASK
Definition: ctl_io.h:192
@ CTL_IO_NONE
Definition: ctl_io.h:190
ctl_tag_type
Definition: ctl_io.h:253
@ CTL_TAG_HEAD_OF_QUEUE
Definition: ctl_io.h:257
@ CTL_TAG_UNTAGGED
Definition: ctl_io.h:254
@ CTL_TAG_SIMPLE
Definition: ctl_io.h:255
@ CTL_TAG_ORDERED
Definition: ctl_io.h:256
@ CTL_TAG_ACA
Definition: ctl_io.h:258
union ctl_io * ctl_alloc_io_nowait(void *pool_ref)
Definition: ctl.c:3976
ctl_pr_action
Definition: ctl_io.h:400
@ CTL_PR_UNREG_KEY
Definition: ctl_io.h:402
@ CTL_PR_RESERVE
Definition: ctl_io.h:405
@ CTL_PR_PREEMPT
Definition: ctl_io.h:403
@ CTL_PR_CLEAR
Definition: ctl_io.h:404
@ CTL_PR_RELEASE
Definition: ctl_io.h:406
@ CTL_PR_REG_KEY
Definition: ctl_io.h:401
ctl_task_type
Definition: ctl_io.h:342
@ CTL_TASK_LUN_RESET
Definition: ctl_io.h:348
@ CTL_TASK_QUERY_ASYNC_EVENT
Definition: ctl_io.h:355
@ CTL_TASK_BUS_RESET
Definition: ctl_io.h:350
@ CTL_TASK_QUERY_TASK_SET
Definition: ctl_io.h:354
@ CTL_TASK_PORT_LOGIN
Definition: ctl_io.h:351
@ CTL_TASK_PORT_LOGOUT
Definition: ctl_io.h:352
@ CTL_TASK_CLEAR_ACA
Definition: ctl_io.h:345
@ CTL_TASK_ABORT_TASK
Definition: ctl_io.h:343
@ CTL_TASK_CLEAR_TASK_SET
Definition: ctl_io.h:346
@ CTL_TASK_TARGET_RESET
Definition: ctl_io.h:349
@ CTL_TASK_ABORT_TASK_SET
Definition: ctl_io.h:344
@ CTL_TASK_QUERY_TASK
Definition: ctl_io.h:353
@ CTL_TASK_I_T_NEXUS_RESET
Definition: ctl_io.h:347
void(* ctl_ref)(void *arg, int diff)
Definition: ctl_io.h:263
ctl_io_status
Definition: ctl_io.h:68
@ CTL_SUCCESS
Definition: ctl_io.h:70
@ CTL_AUTOSENSE
Definition: ctl_io.h:77
@ CTL_SCSI_ERROR
Definition: ctl_io.h:74
@ CTL_CMD_ABORTED
Definition: ctl_io.h:75
@ CTL_ERROR
Definition: ctl_io.h:73
@ CTL_SEL_TIMEOUT
Definition: ctl_io.h:72
@ CTL_CMD_TIMEOUT
Definition: ctl_io.h:71
@ CTL_STATUS_NONE
Definition: ctl_io.h:69
@ CTL_STATUS_MASK
Definition: ctl_io.h:76
#define CTL_MAX_CDBLEN
Definition: ctl_io.h:49
ctl_msg_type
Definition: ctl_io.h:202
@ CTL_MSG_PERS_ACTION
Definition: ctl_io.h:208
@ CTL_MSG_FINISH_IO
Definition: ctl_io.h:205
@ CTL_MSG_MODE_SYNC
Definition: ctl_io.h:216
@ CTL_MSG_R2R
Definition: ctl_io.h:204
@ CTL_MSG_LUN_SYNC
Definition: ctl_io.h:213
@ CTL_MSG_UA
Definition: ctl_io.h:211
@ CTL_MSG_MANAGE_TASKS
Definition: ctl_io.h:207
@ CTL_MSG_FAILOVER
Definition: ctl_io.h:217
@ CTL_MSG_DATAMOVE
Definition: ctl_io.h:209
@ CTL_MSG_DATAMOVE_DONE
Definition: ctl_io.h:210
@ CTL_MSG_PORT_SYNC
Definition: ctl_io.h:212
@ CTL_MSG_LOGIN
Definition: ctl_io.h:215
@ CTL_MSG_IID_SYNC
Definition: ctl_io.h:214
@ CTL_MSG_BAD_JUJU
Definition: ctl_io.h:206
@ CTL_MSG_SERIALIZE
Definition: ctl_io.h:203
#define CTL_HA_MAX_SG_ENTRIES
Definition: ctl_io.h:431
#define CTL_NUM_PRIV
Definition: ctl_io.h:153
ctl_io_flags
Definition: ctl_io.h:85
@ CTL_FLAG_IS_WAS_ON_RTR
Definition: ctl_io.h:101
@ CTL_FLAG_IO_CONT
Definition: ctl_io.h:104
@ CTL_FLAG_NO_DATAMOVE
Definition: ctl_io.h:109
@ CTL_FLAG_DO_AUTOSENSE
Definition: ctl_io.h:91
@ CTL_FLAG_DATA_NONE
Definition: ctl_io.h:89
@ CTL_FLAG_IO_ACTIVE
Definition: ctl_io.h:114
@ CTL_FLAG_SENT_2OTHER_SC
Definition: ctl_io.h:99
@ CTL_FLAG_STATUS_QUEUED
Definition: ctl_io.h:111
@ CTL_FLAG_DMA_INPROG
Definition: ctl_io.h:96
@ CTL_FLAG_FROM_OTHER_SC
Definition: ctl_io.h:100
@ CTL_FLAG_ABORT
Definition: ctl_io.h:95
@ CTL_FLAG_DATA_MASK
Definition: ctl_io.h:90
@ CTL_FLAG_INT_COPY
Definition: ctl_io.h:98
@ CTL_FLAG_DMA_QUEUED
Definition: ctl_io.h:110
@ CTL_FLAG_ALLOCATED
Definition: ctl_io.h:93
@ CTL_FLAG_SERSEQ_DONE
Definition: ctl_io.h:116
@ CTL_FLAG_DELAY_DONE
Definition: ctl_io.h:97
@ CTL_FLAG_BUS_ADDR
Definition: ctl_io.h:102
@ CTL_FLAG_STATUS_SENT
Definition: ctl_io.h:115
@ CTL_FLAG_NONE
Definition: ctl_io.h:86
@ CTL_FLAG_FAILOVER
Definition: ctl_io.h:113
@ CTL_FLAG_DATA_IN
Definition: ctl_io.h:87
@ CTL_FLAG_ABORT_STATUS
Definition: ctl_io.h:94
@ CTL_FLAG_USER_REQ
Definition: ctl_io.h:92
@ CTL_FLAG_DATA_OUT
Definition: ctl_io.h:88
ctl_task_status
Definition: ctl_io.h:358
@ CTL_TASK_LUN_DOES_NOT_EXIST
Definition: ctl_io.h:362
@ CTL_TASK_FUNCTION_REJECTED
Definition: ctl_io.h:361
@ CTL_TASK_FUNCTION_SUCCEEDED
Definition: ctl_io.h:360
@ CTL_TASK_FUNCTION_NOT_SUPPORTED
Definition: ctl_io.h:363
@ CTL_TASK_FUNCTION_COMPLETE
Definition: ctl_io.h:359
void ctl_zero_io(union ctl_io *io)
Definition: ctl.c:4003
union ctl_io * ctl_alloc_io(void *pool_ref)
Definition: ctl.c:3961
uint32_t sg_sequence
Definition: ctl_io.h:465
uint32_t kern_data_resid
Definition: ctl_io.h:473
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:463
struct ctl_sg_entry sg_list[CTL_HA_MAX_SG_ENTRIES]
Definition: ctl_io.h:477
uint8_t sg_last
Definition: ctl_io.h:466
uint32_t kern_total_len
Definition: ctl_io.h:471
uint32_t sent_sg_entries
Definition: ctl_io.h:467
uint32_t kern_data_len
Definition: ctl_io.h:470
uint32_t cur_sg_entries
Definition: ctl_io.h:468
ctl_io_flags flags
Definition: ctl_io.h:464
uint32_t kern_sg_entries
Definition: ctl_io.h:469
uint32_t kern_rel_offset
Definition: ctl_io.h:475
union ctl_io * original_sc
Definition: ctl_io.h:426
struct ctl_nexus nexus
Definition: ctl_io.h:428
union ctl_io * serializing_sc
Definition: ctl_io.h:427
ctl_msg_type msg_type
Definition: ctl_io.h:424
uint32_t status
Definition: ctl_io.h:425
uint64_t wwpn
Definition: ctl_io.h:552
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:549
uint8_t data[]
Definition: ctl_io.h:553
int name_len
Definition: ctl_io.h:551
ctl_msg_type msg_type
Definition: ctl_io.h:391
int max_init_per_port
Definition: ctl_io.h:397
uint8_t pr_res_type
Definition: ctl_io.h:534
int lun_devid_len
Definition: ctl_io.h:535
uint32_t pr_res_idx
Definition: ctl_io.h:533
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:530
unsigned int pr_generation
Definition: ctl_io.h:532
int pr_key_count
Definition: ctl_io.h:536
uint8_t data[]
Definition: ctl_io.h:537
uint16_t page_len
Definition: ctl_io.h:563
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:560
uint8_t subpage
Definition: ctl_io.h:562
uint8_t data[]
Definition: ctl_io.h:564
uint8_t page_code
Definition: ctl_io.h:561
int target_devid_len
Definition: ctl_io.h:521
int lun_map_len
Definition: ctl_io.h:519
int virtual_port
Definition: ctl_io.h:516
int init_devid_len
Definition: ctl_io.h:522
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:513
int port_devid_len
Definition: ctl_io.h:520
uint8_t data[]
Definition: ctl_io.h:523
int physical_port
Definition: ctl_io.h:515
struct ctl_pr_info pr_info
Definition: ctl_io.h:439
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:438
uint32_t kern_data_resid
Definition: ctl_io.h:495
uint8_t scsi_status
Definition: ctl_io.h:490
uint8_t cdb_len
Definition: ctl_io.h:489
struct scsi_sense_data sense_data
Definition: ctl_io.h:496
uint32_t port_status
Definition: ctl_io.h:493
uint8_t sense_len
Definition: ctl_io.h:491
uint8_t priority
Definition: ctl_io.h:492
ctl_tag_type tag_type
Definition: ctl_io.h:487
uint32_t tag_num
Definition: ctl_io.h:486
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:485
uint8_t cdb[CTL_MAX_CDBLEN]
Definition: ctl_io.h:488
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:503
uint32_t tag_num
Definition: ctl_io.h:505
ctl_tag_type tag_type
Definition: ctl_io.h:506
ctl_task_type task_action
Definition: ctl_io.h:504
int ua_set
Definition: ctl_io.h:448
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:446
uint8_t ua_info[8]
Definition: ctl_io.h:450
int ua_type
Definition: ctl_io.h:449
int ua_all
Definition: ctl_io.h:447
LIST_ENTRY(ctl_io_hdr) ooa_links
ctl_msg_type msg_type
Definition: ctl_io.h:225
union ctl_io * remote_io
Definition: ctl_io.h:243
ctl_io_type io_type
Definition: ctl_io.h:224
uint32_t timeout
Definition: ctl_io.h:231
struct bintime dma_start_bt
Definition: ctl_io.h:239
struct bintime start_bt
Definition: ctl_io.h:238
struct ctl_nexus nexus
Definition: ctl_io.h:226
uint32_t retries
Definition: ctl_io.h:232
uint32_t status
Definition: ctl_io.h:229
uint32_t num_dmas
Definition: ctl_io.h:242
TAILQ_HEAD(, ctl_io_hdr) blocked_queue
struct bintime dma_bt
Definition: ctl_io.h:240
TAILQ_ENTRY(ctl_io_hdr) blocked_links
uint32_t version
Definition: ctl_io.h:223
union ctl_io * blocker
Definition: ctl_io.h:244
STAILQ_ENTRY(ctl_io_hdr) links
uint32_t iid_indx
Definition: ctl_io.h:227
uint32_t flags
Definition: ctl_io.h:228
time_t start_time
Definition: ctl_io.h:237
union ctl_priv ctl_private[CTL_NUM_PRIV]
Definition: ctl_io.h:246
void * pool
Definition: ctl_io.h:245
uint32_t port_status
Definition: ctl_io.h:230
uint32_t len
Definition: ctl_io.h:126
uint32_t flags
Definition: ctl_io.h:127
uint64_t lba
Definition: ctl_io.h:125
uint64_t lba
Definition: ctl_io.h:120
uint32_t len
Definition: ctl_io.h:121
uint32_t targ_mapped_lun
Definition: ctl_io.h:199
uint32_t targ_lun
Definition: ctl_io.h:198
uint32_t targ_port
Definition: ctl_io.h:197
uint32_t initid
Definition: ctl_io.h:196
uint8_t sa_res_key[8]
Definition: ctl_io.h:418
uint32_t residx
Definition: ctl_io.h:420
uint8_t res_type
Definition: ctl_io.h:419
ctl_pr_action action
Definition: ctl_io.h:417
struct ctl_io_hdr io_hdr
Definition: ctl_io.h:582
struct ctl_ha_msg_pr pr_msg
Definition: ctl_io.h:583
uint8_t * ptr
Definition: ctl_io.h:137
uint32_t flags
Definition: ctl_io.h:139
uint32_t len
Definition: ctl_io.h:138
uint32_t ext_data_len
Definition: ctl_io.h:283
int(* be_move_done)(union ctl_io *io, bool samethr)
Definition: ctl_io.h:336
uint32_t kern_total_len
Definition: ctl_io.h:312
uint32_t kern_sg_entries
Definition: ctl_io.h:290
uint8_t * ext_data_ptr
Definition: ctl_io.h:282
struct scsi_sense_data sense_data
Definition: ctl_io.h:326
uint32_t kern_data_len
Definition: ctl_io.h:306
uint8_t priority
Definition: ctl_io.h:330
struct ctl_io_hdr io_hdr
Definition: ctl_io.h:275
uint8_t scsi_status
Definition: ctl_io.h:328
uint8_t seridx
Definition: ctl_io.h:329
int(* io_cont)(union ctl_io *io)
Definition: ctl_io.h:337
uint32_t ext_data_filled
Definition: ctl_io.h:284
uint8_t cdb[CTL_MAX_CDBLEN]
Definition: ctl_io.h:335
uint8_t cdb_len
Definition: ctl_io.h:334
uint32_t rem_sg_entries
Definition: ctl_io.h:292
uint32_t tag_num
Definition: ctl_io.h:332
void * kern_data_arg
Definition: ctl_io.h:339
ctl_tag_type tag_type
Definition: ctl_io.h:333
uint32_t ext_sg_entries
Definition: ctl_io.h:281
uint32_t kern_data_resid
Definition: ctl_io.h:317
uint32_t kern_rel_offset
Definition: ctl_io.h:324
uint8_t * kern_data_ptr
Definition: ctl_io.h:297
ctl_ref kern_data_ref
Definition: ctl_io.h:338
uint8_t sense_len
Definition: ctl_io.h:327
uint32_t residual
Definition: ctl_io.h:331
Definition: ctl_io.h:184
void * addr
Definition: ctl_io.h:185
size_t len
Definition: ctl_io.h:186
ctl_task_type task_action
Definition: ctl_io.h:375
ctl_tag_type tag_type
Definition: ctl_io.h:377
struct ctl_io_hdr io_hdr
Definition: ctl_io.h:374
uint8_t task_status
Definition: ctl_io.h:378
uint32_t tag_num
Definition: ctl_io.h:376
uint8_t task_resp[3]
Definition: ctl_io.h:379
struct ctl_ha_msg_mode mode
Definition: ctl_io.h:578
struct ctl_ha_msg_dt dt
Definition: ctl_io.h:571
struct ctl_ha_msg_pr pr
Definition: ctl_io.h:572
struct ctl_ha_msg_scsi scsi
Definition: ctl_io.h:570
struct ctl_ha_msg_hdr hdr
Definition: ctl_io.h:568
struct ctl_ha_msg_login login
Definition: ctl_io.h:577
struct ctl_ha_msg_lun lun
Definition: ctl_io.h:575
struct ctl_ha_msg_ua ua
Definition: ctl_io.h:573
struct ctl_ha_msg_iid iid
Definition: ctl_io.h:576
struct ctl_ha_msg_task task
Definition: ctl_io.h:569
struct ctl_ha_msg_port port
Definition: ctl_io.h:574
Definition: ctl_io.h:586
struct ctl_taskio taskio
Definition: ctl_io.h:589
struct ctl_prio presio
Definition: ctl_io.h:590
struct ctl_scsiio scsiio
Definition: ctl_io.h:588
struct ctl_io_hdr io_hdr
Definition: ctl_io.h:587
uint8_t bytes[sizeof(uint64_t) *2]
Definition: ctl_io.h:143
void * ptr
Definition: ctl_io.h:146
void * ptrs[2]
Definition: ctl_io.h:147
uint64_t integers[2]
Definition: ctl_io.h:145
uint64_t integer
Definition: ctl_io.h:144