FreeBSD kernel CAM code
ctl_ioctl.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) 2011 Spectra Logic Corporation
6 * Copyright (c) 2014-2017 Alexander Motin <mav@FreeBSD.org>
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions, and the following disclaimer,
14 * without modification.
15 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
16 * substantially similar to the "NO WARRANTY" disclaimer below
17 * ("Disclaimer") and any redistribution must be conditioned upon
18 * including a substantially similar Disclaimer requirement for further
19 * binary redistribution.
20 *
21 * NO WARRANTY
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGES.
33 *
34 * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_ioctl.h#4 $
35 * $FreeBSD$
36 */
37/*
38 * CAM Target Layer ioctl interface.
39 *
40 * Author: Ken Merry <ken@FreeBSD.org>
41 */
42
43#ifndef _CTL_IOCTL_H_
44#define _CTL_IOCTL_H_
45
46#ifdef ICL_KERNEL_PROXY
47#include <sys/socket.h>
48#endif
49
50#include <sys/ioccom.h>
51#include <sys/nv.h>
52
53#define CTL_DEFAULT_DEV "/dev/cam/ctl"
54/*
55 * Maximum number of targets we support.
56 */
57#define CTL_MAX_TARGETS 1
58
59/*
60 * Maximum target ID we support.
61 */
62#define CTL_MAX_TARGID 15
63
64/*
65 * Maximum number of initiators per port.
66 */
67#define CTL_MAX_INIT_PER_PORT 2048
68
69/* Hopefully this won't conflict with new misc devices that pop up */
70#define CTL_MINOR 225
71
72typedef enum {
77
78typedef enum {
83
84typedef enum {
92
94 uint32_t lun_id;
97 uint32_t delay_secs;
99};
100
101typedef enum {
106#define CTL_STATS_NUM_TYPES 3
107
108typedef enum {
113
114typedef enum {
118
120 uint32_t item;
124 struct bintime time[CTL_STATS_NUM_TYPES];
126};
127
129 struct ctl_io_stats *stats; /* passed to/from kernel */
130 size_t alloc_len; /* passed to kernel */
131 size_t fill_len; /* passed to userland */
132 int first_item; /* passed to kernel */
133 int num_items; /* passed to userland */
134 ctl_stats_status status; /* passed to userland */
135 ctl_stats_flags flags; /* passed to userland */
136 struct timespec timestamp; /* passed to userland */
137};
138
139/*
140 * The types of errors that can be injected:
141 *
142 * NONE: No error specified.
143 * ABORTED: SSD_KEY_ABORTED_COMMAND, 0x45, 0x00
144 * MEDIUM_ERR: Medium error, different asc/ascq depending on read/write.
145 * UA: Unit attention.
146 * CUSTOM: User specifies the sense data.
147 * TYPE: Mask to use with error types.
148 *
149 * Flags that affect injection behavior:
150 * CONTINUOUS: This error will stay around until explicitly cleared.
151 * DESCRIPTOR: Use descriptor sense instead of fixed sense.
152 */
153typedef enum {
163
164/*
165 * Flags to specify what type of command the given error pattern will
166 * execute on. The first group of types can be ORed together.
167 *
168 * READ: Any read command.
169 * WRITE: Any write command.
170 * READWRITE: Any read or write command.
171 * READCAP: Any read capacity command.
172 * TUR: Test Unit Ready.
173 * ANY: Any command.
174 * MASK: Mask for basic command patterns.
175 *
176 * Special types:
177 *
178 * CMD: The CDB to act on is specified in struct ctl_error_desc_cmd.
179 * RANGE: For read/write commands, act when the LBA is in the
180 * specified range.
181 */
182typedef enum {
192 CTL_LUN_PAT_RANGE = 0x200
194
195/*
196 * This structure allows the user to specify a particular CDB pattern to
197 * look for.
198 *
199 * cdb_pattern: Fill in the relevant bytes to look for in the CDB.
200 * cdb_valid_bytes: Bitmask specifying valid bytes in the cdb_pattern.
201 * flags: Specify any command flags (see ctl_io_flags) that
202 * should be set.
203 */
207 uint32_t flags;
208};
209
210/*
211 * Error injection descriptor.
212 *
213 * lun_id LUN to act on.
214 * lun_error: The type of error to inject. See above for descriptions.
215 * error_pattern: What kind of command to act on. See above.
216 * cmd_desc: For CTL_LUN_PAT_CMD only.
217 * lba_range: For CTL_LUN_PAT_RANGE only.
218 * custom_sense: Specify sense. For CTL_LUN_INJ_CUSTOM only.
219 * serial: Serial number returned by the kernel. Use for deletion.
220 * links: Kernel use only.
221 */
223 uint32_t lun_id; /* To kernel */
224 ctl_lun_error lun_error; /* To kernel */
226 struct ctl_error_desc_cmd cmd_desc; /* To kernel */
227 struct ctl_lba_len lba_range; /* To kernel */
228 struct scsi_sense_data custom_sense; /* To kernel */
229 uint64_t serial; /* From kernel */
230 STAILQ_ENTRY(ctl_error_desc) links; /* Kernel use only */
231};
232
233typedef enum {
237
238typedef enum {
243
244typedef enum {
254
258 uint8_t cdb_len;
259 uint32_t tag_num;
260 uint32_t lun_num;
261 struct bintime start_bt;
262};
263
264struct ctl_ooa {
265 ctl_ooa_flags flags; /* passed to kernel */
266 uint64_t lun_num; /* passed to kernel */
267 uint32_t alloc_len; /* passed to kernel */
268 uint32_t alloc_num; /* passed to kernel */
269 struct ctl_ooa_entry *entries; /* filled in kernel */
270 uint32_t fill_len; /* passed to userland */
271 uint32_t fill_num; /* passed to userland */
272 uint32_t dropped_num; /* passed to userland */
273 struct bintime cur_bt; /* passed to userland */
274 ctl_get_ooa_status status; /* passed to userland */
275};
276
277typedef enum {
283
284#define CTL_ERROR_STR_LEN 160
285
286typedef enum {
291
292/*
293 * The ID_REQ flag is used to say that the caller has requested a
294 * particular LUN ID in the req_lun_id field. If we cannot allocate that
295 * LUN ID, the ctl_add_lun() call will fail.
296 *
297 * The STOPPED flag tells us that the LUN should default to the powered
298 * off state. It will return 0x04,0x02 until it is powered up. ("Logical
299 * unit not ready, initializing command required.")
300 *
301 * The NO_MEDIA flag tells us that the LUN has no media inserted.
302 *
303 * The PRIMARY flag tells us that this LUN is registered as a Primary LUN
304 * which is accessible via the Master shelf controller in an HA. This flag
305 * being set indicates a Primary LUN. This flag being reset represents a
306 * Secondary LUN controlled by the Secondary controller in an HA
307 * configuration. Flag is applicable at this time to T_DIRECT types.
308 *
309 * The SERIAL_NUM flag tells us that the serial_num field is filled in and
310 * valid for use in SCSI INQUIRY VPD page 0x80.
311 *
312 * The DEVID flag tells us that the device_id field is filled in and
313 * valid for use in SCSI INQUIRY VPD page 0x83.
314 *
315 * The DEV_TYPE flag tells us that the device_type field is filled in.
316 *
317 * The EJECTED flag tells us that the removable LUN has tray open.
318 *
319 * The UNMAP flag tells us that this LUN supports UNMAP.
320 *
321 * The OFFLINE flag tells us that this LUN can not access backing store.
322 */
323typedef enum {
335
336/*
337 * LUN creation parameters:
338 *
339 * flags: Various LUN flags, see above.
340 *
341 * device_type: The SCSI device type. e.g. 0 for Direct Access,
342 * 3 for Processor, etc. Only certain backends may
343 * support setting this field. The CTL_LUN_FLAG_DEV_TYPE
344 * flag should be set in the flags field if the device
345 * type is set.
346 *
347 * lun_size_bytes: The size of the LUN in bytes. For some backends
348 * this is relevant (e.g. ramdisk), for others, it may
349 * be ignored in favor of using the properties of the
350 * backing store. If specified, this should be a
351 * multiple of the blocksize.
352 *
353 * The actual size of the LUN is returned in this
354 * field.
355 *
356 * blocksize_bytes: The LUN blocksize in bytes. For some backends this
357 * is relevant, for others it may be ignored in
358 * favor of using the properties of the backing store.
359 *
360 * The actual blocksize of the LUN is returned in this
361 * field.
362 *
363 * req_lun_id: The requested LUN ID. The CTL_LUN_FLAG_ID_REQ flag
364 * should be set if this is set. The request will be
365 * granted if the LUN number is available, otherwise
366 * the LUN addition request will fail.
367 *
368 * The allocated LUN number is returned in this field.
369 *
370 * serial_num: This is the value returned in SCSI INQUIRY VPD page
371 * 0x80. If it is specified, the CTL_LUN_FLAG_SERIAL_NUM
372 * flag should be set.
373 *
374 * The serial number value used is returned in this
375 * field.
376 *
377 * device_id: This is the value returned in the T10 vendor ID
378 * based DESIGNATOR field in the SCSI INQUIRY VPD page
379 * 0x83 data. If it is specified, the CTL_LUN_FLAG_DEVID
380 * flag should be set.
381 *
382 * The device id value used is returned in this field.
383 */
386 uint8_t device_type;
389 uint32_t req_lun_id;
392};
393
394/*
395 * LUN removal parameters:
396 *
397 * lun_id: The number of the LUN to delete. This must be set.
398 * The LUN must be backed by the given backend.
399 */
401 uint32_t lun_id;
402};
403
404/*
405 * LUN modification parameters:
406 *
407 * lun_id: The number of the LUN to modify. This must be set.
408 * The LUN must be backed by the given backend.
409 *
410 * lun_size_bytes: The size of the LUN in bytes. If zero, update
411 * the size using the backing file size, if possible.
412 */
414 uint32_t lun_id;
416};
417
418/*
419 * Union of request type data. Fill in the appropriate union member for
420 * the request type.
421 */
426};
427
428/*
429 * LUN request interface:
430 *
431 * backend: This is required, and is NUL-terminated a string
432 * that is the name of the backend, like "ramdisk" or
433 * "block".
434 *
435 * reqtype: The type of request, CTL_LUNREQ_CREATE to create a
436 * LUN, CTL_LUNREQ_RM to delete a LUN.
437 *
438 * reqdata: Request type-specific information. See the
439 * description of individual the union members above
440 * for more information.
441 *
442 * num_be_args: This is the number of backend-specific arguments
443 * in the be_args array.
444 *
445 * be_args: This is an array of backend-specific arguments.
446 * See above for a description of the fields in this
447 * structure.
448 *
449 * status: Status of the LUN request.
450 *
451 * error_str: If the status is CTL_LUN_ERROR, this will
452 * contain a string describing the error.
453 *
454 * kern_be_args: For kernel use only.
455 */
457#define CTL_BE_NAME_LEN 32
461 void * args;
462 nvlist_t * args_nvl;
463 size_t args_len;
464 void * result;
465 nvlist_t * result_nvl;
469};
470
471/*
472 * LUN list status:
473 *
474 * NONE: No status.
475 *
476 * OK: Request completed successfully.
477 *
478 * NEED_MORE_SPACE: The allocated length of the entries field is too
479 * small for the available data.
480 *
481 * ERROR: An error occurred, look at the error string for a
482 * description of the error.
483 */
484typedef enum {
490
491/*
492 * LUN list interface
493 *
494 * backend_name: This is a NUL-terminated string. If the string
495 * length is 0, then all LUNs on all backends will
496 * be enumerated. Otherwise this is the name of the
497 * backend to be enumerated, like "ramdisk" or "block".
498 *
499 * alloc_len: The length of the data buffer allocated for entries.
500 * In order to properly size the buffer, make one call
501 * with alloc_len set to 0, and then use the returned
502 * dropped_len as the buffer length to allocate and
503 * pass in on a subsequent call.
504 *
505 * lun_xml: XML-formatted information on the requested LUNs.
506 *
507 * fill_len: The amount of data filled in the storage for entries.
508 *
509 * status: The status of the request. See above for the
510 * description of the values of this field.
511 *
512 * error_str: If the status indicates an error, this string will
513 * be filled in to describe the error.
514 */
516 char backend[CTL_BE_NAME_LEN]; /* passed to kernel*/
517 uint32_t alloc_len; /* passed to kernel */
518 char *lun_xml; /* filled in kernel */
519 uint32_t fill_len; /* passed to userland */
520 ctl_lun_list_status status; /* passed to userland */
522 /* passed to userland */
523};
524
525/*
526 * Port request interface:
527 *
528 * driver: This is required, and is NUL-terminated a string
529 * that is the name of the frontend, like "iscsi" .
530 *
531 * reqtype: The type of request, CTL_REQ_CREATE to create a
532 * port, CTL_REQ_REMOVE to delete a port.
533 *
534 * num_be_args: This is the number of frontend-specific arguments
535 * in the be_args array.
536 *
537 * be_args: This is an array of frontend-specific arguments.
538 * See above for a description of the fields in this
539 * structure.
540 *
541 * status: Status of the request.
542 *
543 * error_str: If the status is CTL_LUN_ERROR, this will
544 * contain a string describing the error.
545 *
546 * kern_be_args: For kernel use only.
547 */
548typedef enum {
553
554struct ctl_req {
557 void * args;
558 nvlist_t * args_nvl;
559 size_t args_len;
560 void * result;
561 nvlist_t * result_nvl;
565};
566
567/*
568 * iSCSI status
569 *
570 * OK: Request completed successfully.
571 *
572 * ERROR: An error occurred, look at the error string for a
573 * description of the error.
574 *
575 * CTL_ISCSI_LIST_NEED_MORE_SPACE:
576 * User has to pass larger buffer for CTL_ISCSI_LIST ioctl.
577 */
578typedef enum {
584
585typedef enum {
591#if defined(ICL_KERNEL_PROXY) || 1
592 /*
593 * We actually need those in all cases, but leave the ICL_KERNEL_PROXY,
594 * to remember to remove them along with rest of proxy code, eventually.
595 */
600#endif
602
603typedef enum {
607
608#define CTL_ISCSI_NAME_LEN 224 /* 223 bytes, by RFC 3720, + '\0' */
609#define CTL_ISCSI_ADDR_LEN 47 /* INET6_ADDRSTRLEN + '\0' */
610#define CTL_ISCSI_ALIAS_LEN 128 /* Arbitrary. */
611#define CTL_ISCSI_OFFLOAD_LEN 8 /* Arbitrary. */
612
617 uint8_t initiator_isid[6];
621
622 /*
623 * Connection parameters negotiated by ctld(8).
624 */
627 uint32_t cmdsn;
628 uint32_t statsn;
634#ifdef ICL_KERNEL_PROXY
635 int connection_id;
636#else
637 int spare;
638#endif
640};
641
643 uint32_t alloc_len; /* passed to kernel */
644 char *conn_xml; /* filled in kernel */
645 uint32_t fill_len; /* passed to userland */
646 int spare[4];
647};
648
650 int connection_id; /* passed to kernel */
652 /* passed to kernel */
654 /* passed to kernel */
655 int all; /* passed to kernel */
656 int spare[4];
657};
658
660 int connection_id; /* passed to kernel */
662 /* passed to kernel */
664 /* passed to kernel */
665 int all; /* passed to kernel */
666 int spare[4];
667};
668
670 /* passed to kernel */
672
673 /* passed to userland */
674 size_t spare;
679};
680
681#ifdef ICL_KERNEL_PROXY
682struct ctl_iscsi_listen_params {
683 int iser;
684 int domain;
685 int socktype;
686 int protocol;
687 struct sockaddr *addr;
688 socklen_t addrlen;
689 int portal_id;
690 int spare[4];
691};
692
693struct ctl_iscsi_accept_params {
694 int connection_id;
695 int portal_id;
696 struct sockaddr *initiator_addr;
697 socklen_t initiator_addrlen;
698 int spare[4];
699};
700
701struct ctl_iscsi_send_params {
702 int connection_id;
703 void *bhs;
704 size_t spare;
705 void *spare2;
706 size_t data_segment_len;
707 void *data_segment;
708 int spare3[4];
709};
710
711struct ctl_iscsi_receive_params {
712 int connection_id;
713 void *bhs;
714 size_t spare;
715 void *spare2;
716 size_t data_segment_len;
717 void *data_segment;
718 int spare3[4];
719};
720
721#endif /* ICL_KERNEL_PROXY */
722
729#ifdef ICL_KERNEL_PROXY
730 struct ctl_iscsi_listen_params listen;
731 struct ctl_iscsi_accept_params accept;
732 struct ctl_iscsi_send_params send;
733 struct ctl_iscsi_receive_params receive;
734#endif
735};
736
737/*
738 * iSCSI interface
739 *
740 * status: The status of the request. See above for the
741 * description of the values of this field.
742 *
743 * error_str: If the status indicates an error, this string will
744 * be filled in to describe the error.
745 */
746struct ctl_iscsi {
747 ctl_iscsi_type type; /* passed to kernel */
748 union ctl_iscsi_data data; /* passed to kernel */
749 ctl_iscsi_status status; /* passed to userland */
751 /* passed to userland */
752};
753
755 uint32_t port;
756 uint32_t plun;
757 uint32_t lun;
758};
759
760#define CTL_IO _IOWR(CTL_MINOR, 0x00, union ctl_io)
761#define CTL_ENABLE_PORT _IOW(CTL_MINOR, 0x04, struct ctl_port_entry)
762#define CTL_DISABLE_PORT _IOW(CTL_MINOR, 0x05, struct ctl_port_entry)
763#define CTL_DELAY_IO _IOWR(CTL_MINOR, 0x10, struct ctl_io_delay_info)
764#define CTL_ERROR_INJECT _IOWR(CTL_MINOR, 0x16, struct ctl_error_desc)
765#define CTL_GET_OOA _IOWR(CTL_MINOR, 0x18, struct ctl_ooa)
766#define CTL_DUMP_STRUCTS _IO(CTL_MINOR, 0x19)
767#define CTL_LUN_REQ _IOWR(CTL_MINOR, 0x21, struct ctl_lun_req)
768#define CTL_LUN_LIST _IOWR(CTL_MINOR, 0x22, struct ctl_lun_list)
769#define CTL_ERROR_INJECT_DELETE _IOW(CTL_MINOR, 0x23, struct ctl_error_desc)
770#define CTL_SET_PORT_WWNS _IOW(CTL_MINOR, 0x24, struct ctl_port_entry)
771#define CTL_ISCSI _IOWR(CTL_MINOR, 0x25, struct ctl_iscsi)
772#define CTL_PORT_REQ _IOWR(CTL_MINOR, 0x26, struct ctl_req)
773#define CTL_PORT_LIST _IOWR(CTL_MINOR, 0x27, struct ctl_lun_list)
774#define CTL_LUN_MAP _IOW(CTL_MINOR, 0x28, struct ctl_lun_map)
775#define CTL_GET_LUN_STATS _IOWR(CTL_MINOR, 0x29, struct ctl_get_io_stats)
776#define CTL_GET_PORT_STATS _IOWR(CTL_MINOR, 0x2a, struct ctl_get_io_stats)
777
778#endif /* _CTL_IOCTL_H_ */
779
780/*
781 * vim: ts=8
782 */
#define CTL_SN_LEN
Definition: ctl.h:91
#define CTL_DEVID_LEN
Definition: ctl.h:96
#define CTL_DRIVER_NAME_LEN
Definition: ctl.h:103
#define CTL_MAX_CDBLEN
Definition: ctl_io.h:49
ctl_iscsi_digest
Definition: ctl_ioctl.h:603
@ CTL_ISCSI_DIGEST_NONE
Definition: ctl_ioctl.h:604
@ CTL_ISCSI_DIGEST_CRC32C
Definition: ctl_ioctl.h:605
#define CTL_ISCSI_ALIAS_LEN
Definition: ctl_ioctl.h:610
ctl_get_ooa_status
Definition: ctl_ioctl.h:238
@ CTL_OOA_ERROR
Definition: ctl_ioctl.h:241
@ CTL_OOA_OK
Definition: ctl_ioctl.h:239
@ CTL_OOA_NEED_MORE_SPACE
Definition: ctl_ioctl.h:240
#define CTL_ISCSI_ADDR_LEN
Definition: ctl_ioctl.h:609
#define CTL_ERROR_STR_LEN
Definition: ctl_ioctl.h:284
ctl_iscsi_type
Definition: ctl_ioctl.h:585
@ CTL_ISCSI_LIMITS
Definition: ctl_ioctl.h:590
@ CTL_ISCSI_SEND
Definition: ctl_ioctl.h:598
@ CTL_ISCSI_HANDOFF
Definition: ctl_ioctl.h:586
@ CTL_ISCSI_ACCEPT
Definition: ctl_ioctl.h:597
@ CTL_ISCSI_RECEIVE
Definition: ctl_ioctl.h:599
@ CTL_ISCSI_LIST
Definition: ctl_ioctl.h:587
@ CTL_ISCSI_LOGOUT
Definition: ctl_ioctl.h:588
@ CTL_ISCSI_LISTEN
Definition: ctl_ioctl.h:596
@ CTL_ISCSI_TERMINATE
Definition: ctl_ioctl.h:589
ctl_ooa_flags
Definition: ctl_ioctl.h:233
@ CTL_OOA_FLAG_ALL_LUNS
Definition: ctl_ioctl.h:235
@ CTL_OOA_FLAG_NONE
Definition: ctl_ioctl.h:234
#define CTL_ISCSI_OFFLOAD_LEN
Definition: ctl_ioctl.h:611
ctl_ooa_cmd_flags
Definition: ctl_ioctl.h:244
@ CTL_OOACMD_FLAG_RTR
Definition: ctl_ioctl.h:249
@ CTL_OOACMD_FLAG_STATUS_QUEUED
Definition: ctl_ioctl.h:251
@ CTL_OOACMD_FLAG_ABORT
Definition: ctl_ioctl.h:248
@ CTL_OOACMD_FLAG_STATUS_SENT
Definition: ctl_ioctl.h:252
@ CTL_OOACMD_FLAG_DMA
Definition: ctl_ioctl.h:246
@ CTL_OOACMD_FLAG_DMA_QUEUED
Definition: ctl_ioctl.h:250
@ CTL_OOACMD_FLAG_BLOCKED
Definition: ctl_ioctl.h:247
@ CTL_OOACMD_FLAG_NONE
Definition: ctl_ioctl.h:245
#define CTL_STATS_NUM_TYPES
Definition: ctl_ioctl.h:106
ctl_lun_error_pattern
Definition: ctl_ioctl.h:182
@ CTL_LUN_PAT_NONE
Definition: ctl_ioctl.h:183
@ CTL_LUN_PAT_READWRITE
Definition: ctl_ioctl.h:186
@ CTL_LUN_PAT_TUR
Definition: ctl_ioctl.h:188
@ CTL_LUN_PAT_ANY
Definition: ctl_ioctl.h:189
@ CTL_LUN_PAT_CMD
Definition: ctl_ioctl.h:191
@ CTL_LUN_PAT_READCAP
Definition: ctl_ioctl.h:187
@ CTL_LUN_PAT_READ
Definition: ctl_ioctl.h:184
@ CTL_LUN_PAT_MASK
Definition: ctl_ioctl.h:190
@ CTL_LUN_PAT_RANGE
Definition: ctl_ioctl.h:192
@ CTL_LUN_PAT_WRITE
Definition: ctl_ioctl.h:185
#define CTL_BE_NAME_LEN
Definition: ctl_ioctl.h:457
#define CTL_ISCSI_NAME_LEN
Definition: ctl_ioctl.h:608
ctl_stat_types
Definition: ctl_ioctl.h:101
@ CTL_STATS_READ
Definition: ctl_ioctl.h:103
@ CTL_STATS_NO_IO
Definition: ctl_ioctl.h:102
@ CTL_STATS_WRITE
Definition: ctl_ioctl.h:104
ctl_delay_status
Definition: ctl_ioctl.h:84
@ CTL_DELAY_STATUS_INVALID_LUN
Definition: ctl_ioctl.h:87
@ CTL_DELAY_STATUS_NONE
Definition: ctl_ioctl.h:85
@ CTL_DELAY_STATUS_INVALID_LOC
Definition: ctl_ioctl.h:89
@ CTL_DELAY_STATUS_INVALID_TYPE
Definition: ctl_ioctl.h:88
@ CTL_DELAY_STATUS_NOT_IMPLEMENTED
Definition: ctl_ioctl.h:90
@ CTL_DELAY_STATUS_OK
Definition: ctl_ioctl.h:86
ctl_backend_lun_flags
Definition: ctl_ioctl.h:323
@ CTL_LUN_FLAG_DEV_TYPE
Definition: ctl_ioctl.h:330
@ CTL_LUN_FLAG_STOPPED
Definition: ctl_ioctl.h:325
@ CTL_LUN_FLAG_READONLY
Definition: ctl_ioctl.h:333
@ CTL_LUN_FLAG_PRIMARY
Definition: ctl_ioctl.h:327
@ CTL_LUN_FLAG_UNMAP
Definition: ctl_ioctl.h:331
@ CTL_LUN_FLAG_DEVID
Definition: ctl_ioctl.h:329
@ CTL_LUN_FLAG_EJECTED
Definition: ctl_ioctl.h:332
@ CTL_LUN_FLAG_SERIAL_NUM
Definition: ctl_ioctl.h:328
@ CTL_LUN_FLAG_ID_REQ
Definition: ctl_ioctl.h:324
@ CTL_LUN_FLAG_NO_MEDIA
Definition: ctl_ioctl.h:326
ctl_req_type
Definition: ctl_ioctl.h:548
@ CTL_REQ_MODIFY
Definition: ctl_ioctl.h:551
@ CTL_REQ_REMOVE
Definition: ctl_ioctl.h:550
@ CTL_REQ_CREATE
Definition: ctl_ioctl.h:549
ctl_stats_status
Definition: ctl_ioctl.h:108
@ CTL_SS_ERROR
Definition: ctl_ioctl.h:111
@ CTL_SS_NEED_MORE_SPACE
Definition: ctl_ioctl.h:110
@ CTL_SS_OK
Definition: ctl_ioctl.h:109
ctl_lun_error
Definition: ctl_ioctl.h:153
@ CTL_LUN_INJ_ABORTED
Definition: ctl_ioctl.h:155
@ CTL_LUN_INJ_CUSTOM
Definition: ctl_ioctl.h:158
@ CTL_LUN_INJ_UA
Definition: ctl_ioctl.h:157
@ CTL_LUN_INJ_DESCRIPTOR
Definition: ctl_ioctl.h:161
@ CTL_LUN_INJ_CONTINUOUS
Definition: ctl_ioctl.h:160
@ CTL_LUN_INJ_TYPE
Definition: ctl_ioctl.h:159
@ CTL_LUN_INJ_NONE
Definition: ctl_ioctl.h:154
@ CTL_LUN_INJ_MEDIUM_ERR
Definition: ctl_ioctl.h:156
ctl_delay_location
Definition: ctl_ioctl.h:78
@ CTL_DELAY_LOC_DONE
Definition: ctl_ioctl.h:81
@ CTL_DELAY_LOC_NONE
Definition: ctl_ioctl.h:79
@ CTL_DELAY_LOC_DATAMOVE
Definition: ctl_ioctl.h:80
ctl_lun_status
Definition: ctl_ioctl.h:277
@ CTL_LUN_WARNING
Definition: ctl_ioctl.h:281
@ CTL_LUN_ERROR
Definition: ctl_ioctl.h:280
@ CTL_LUN_NOSTATUS
Definition: ctl_ioctl.h:278
@ CTL_LUN_OK
Definition: ctl_ioctl.h:279
ctl_lunreq_type
Definition: ctl_ioctl.h:286
@ CTL_LUNREQ_MODIFY
Definition: ctl_ioctl.h:289
@ CTL_LUNREQ_CREATE
Definition: ctl_ioctl.h:287
@ CTL_LUNREQ_RM
Definition: ctl_ioctl.h:288
ctl_iscsi_status
Definition: ctl_ioctl.h:578
@ CTL_ISCSI_ERROR
Definition: ctl_ioctl.h:580
@ CTL_ISCSI_OK
Definition: ctl_ioctl.h:579
@ CTL_ISCSI_SESSION_NOT_FOUND
Definition: ctl_ioctl.h:582
@ CTL_ISCSI_LIST_NEED_MORE_SPACE
Definition: ctl_ioctl.h:581
ctl_stats_flags
Definition: ctl_ioctl.h:114
@ CTL_STATS_FLAG_TIME_VALID
Definition: ctl_ioctl.h:116
@ CTL_STATS_FLAG_NONE
Definition: ctl_ioctl.h:115
ctl_lun_list_status
Definition: ctl_ioctl.h:484
@ CTL_LUN_LIST_ERROR
Definition: ctl_ioctl.h:488
@ CTL_LUN_LIST_NEED_MORE_SPACE
Definition: ctl_ioctl.h:487
@ CTL_LUN_LIST_NONE
Definition: ctl_ioctl.h:485
@ CTL_LUN_LIST_OK
Definition: ctl_ioctl.h:486
ctl_delay_type
Definition: ctl_ioctl.h:72
@ CTL_DELAY_TYPE_CONT
Definition: ctl_ioctl.h:74
@ CTL_DELAY_TYPE_ONESHOT
Definition: ctl_ioctl.h:75
@ CTL_DELAY_TYPE_NONE
Definition: ctl_ioctl.h:73
uint8_t cdb_pattern[CTL_MAX_CDBLEN]
Definition: ctl_ioctl.h:205
uint32_t cdb_valid_bytes
Definition: ctl_ioctl.h:206
ctl_lun_error lun_error
Definition: ctl_ioctl.h:224
struct scsi_sense_data custom_sense
Definition: ctl_ioctl.h:228
ctl_lun_error_pattern error_pattern
Definition: ctl_ioctl.h:225
uint32_t lun_id
Definition: ctl_ioctl.h:223
struct ctl_error_desc_cmd cmd_desc
Definition: ctl_ioctl.h:226
uint64_t serial
Definition: ctl_ioctl.h:229
STAILQ_ENTRY(ctl_error_desc) links
struct ctl_lba_len lba_range
Definition: ctl_ioctl.h:227
struct timespec timestamp
Definition: ctl_ioctl.h:136
ctl_stats_flags flags
Definition: ctl_ioctl.h:135
ctl_stats_status status
Definition: ctl_ioctl.h:134
size_t alloc_len
Definition: ctl_ioctl.h:130
struct ctl_io_stats * stats
Definition: ctl_ioctl.h:129
ctl_delay_status status
Definition: ctl_ioctl.h:98
uint32_t lun_id
Definition: ctl_ioctl.h:94
ctl_delay_location delay_loc
Definition: ctl_ioctl.h:96
ctl_delay_type delay_type
Definition: ctl_ioctl.h:95
uint32_t delay_secs
Definition: ctl_ioctl.h:97
struct bintime dma_time[CTL_STATS_NUM_TYPES]
Definition: ctl_ioctl.h:125
uint64_t bytes[CTL_STATS_NUM_TYPES]
Definition: ctl_ioctl.h:121
uint64_t operations[CTL_STATS_NUM_TYPES]
Definition: ctl_ioctl.h:122
uint32_t item
Definition: ctl_ioctl.h:120
struct bintime time[CTL_STATS_NUM_TYPES]
Definition: ctl_ioctl.h:124
uint64_t dmas[CTL_STATS_NUM_TYPES]
Definition: ctl_ioctl.h:123
char initiator_alias[CTL_ISCSI_ALIAS_LEN]
Definition: ctl_ioctl.h:616
ctl_iscsi_digest data_digest
Definition: ctl_ioctl.h:626
char target_name[CTL_ISCSI_NAME_LEN]
Definition: ctl_ioctl.h:618
char initiator_addr[CTL_ISCSI_ADDR_LEN]
Definition: ctl_ioctl.h:615
ctl_iscsi_digest header_digest
Definition: ctl_ioctl.h:625
uint8_t initiator_isid[6]
Definition: ctl_ioctl.h:617
char initiator_name[CTL_ISCSI_NAME_LEN]
Definition: ctl_ioctl.h:614
char offload[CTL_ISCSI_OFFLOAD_LEN]
Definition: ctl_ioctl.h:633
char offload[CTL_ISCSI_OFFLOAD_LEN]
Definition: ctl_ioctl.h:671
char initiator_name[CTL_ISCSI_NAME_LEN]
Definition: ctl_ioctl.h:651
char initiator_addr[CTL_ISCSI_ADDR_LEN]
Definition: ctl_ioctl.h:653
char initiator_name[CTL_ISCSI_NAME_LEN]
Definition: ctl_ioctl.h:661
char initiator_addr[CTL_ISCSI_NAME_LEN]
Definition: ctl_ioctl.h:663
ctl_iscsi_type type
Definition: ctl_ioctl.h:747
ctl_iscsi_status status
Definition: ctl_ioctl.h:749
char error_str[CTL_ERROR_STR_LEN]
Definition: ctl_ioctl.h:750
union ctl_iscsi_data data
Definition: ctl_ioctl.h:748
ctl_backend_lun_flags flags
Definition: ctl_ioctl.h:385
uint32_t blocksize_bytes
Definition: ctl_ioctl.h:388
uint64_t lun_size_bytes
Definition: ctl_ioctl.h:387
uint8_t serial_num[CTL_SN_LEN]
Definition: ctl_ioctl.h:390
uint8_t device_id[CTL_DEVID_LEN]
Definition: ctl_ioctl.h:391
char error_str[CTL_ERROR_STR_LEN]
Definition: ctl_ioctl.h:521
ctl_lun_list_status status
Definition: ctl_ioctl.h:520
char backend[CTL_BE_NAME_LEN]
Definition: ctl_ioctl.h:516
uint32_t alloc_len
Definition: ctl_ioctl.h:517
uint32_t fill_len
Definition: ctl_ioctl.h:519
char * lun_xml
Definition: ctl_ioctl.h:518
uint32_t plun
Definition: ctl_ioctl.h:756
uint32_t port
Definition: ctl_ioctl.h:755
uint32_t lun
Definition: ctl_ioctl.h:757
uint64_t lun_size_bytes
Definition: ctl_ioctl.h:415
char backend[CTL_BE_NAME_LEN]
Definition: ctl_ioctl.h:458
nvlist_t * result_nvl
Definition: ctl_ioctl.h:465
ctl_lun_status status
Definition: ctl_ioctl.h:467
size_t args_len
Definition: ctl_ioctl.h:463
size_t result_len
Definition: ctl_ioctl.h:466
ctl_lunreq_type reqtype
Definition: ctl_ioctl.h:459
nvlist_t * args_nvl
Definition: ctl_ioctl.h:462
void * args
Definition: ctl_ioctl.h:461
char error_str[CTL_ERROR_STR_LEN]
Definition: ctl_ioctl.h:468
void * result
Definition: ctl_ioctl.h:464
union ctl_lunreq_data reqdata
Definition: ctl_ioctl.h:460
uint32_t lun_id
Definition: ctl_ioctl.h:401
Definition: ctl_ioctl.h:255
uint8_t cdb_len
Definition: ctl_ioctl.h:258
uint8_t cdb[CTL_MAX_CDBLEN]
Definition: ctl_ioctl.h:257
struct bintime start_bt
Definition: ctl_ioctl.h:261
ctl_ooa_cmd_flags cmd_flags
Definition: ctl_ioctl.h:256
uint32_t tag_num
Definition: ctl_ioctl.h:259
uint32_t lun_num
Definition: ctl_ioctl.h:260
uint32_t fill_len
Definition: ctl_ioctl.h:270
ctl_get_ooa_status status
Definition: ctl_ioctl.h:274
uint64_t lun_num
Definition: ctl_ioctl.h:266
uint32_t alloc_len
Definition: ctl_ioctl.h:267
uint32_t alloc_num
Definition: ctl_ioctl.h:268
struct ctl_ooa_entry * entries
Definition: ctl_ioctl.h:269
uint32_t fill_num
Definition: ctl_ioctl.h:271
struct bintime cur_bt
Definition: ctl_ioctl.h:273
ctl_ooa_flags flags
Definition: ctl_ioctl.h:265
uint32_t dropped_num
Definition: ctl_ioctl.h:272
void * args
Definition: ctl_ioctl.h:557
char driver[CTL_DRIVER_NAME_LEN]
Definition: ctl_ioctl.h:555
size_t result_len
Definition: ctl_ioctl.h:562
char error_str[CTL_ERROR_STR_LEN]
Definition: ctl_ioctl.h:564
void * result
Definition: ctl_ioctl.h:560
ctl_lun_status status
Definition: ctl_ioctl.h:563
ctl_req_type reqtype
Definition: ctl_ioctl.h:556
nvlist_t * result_nvl
Definition: ctl_ioctl.h:561
nvlist_t * args_nvl
Definition: ctl_ioctl.h:558
size_t args_len
Definition: ctl_ioctl.h:559
struct ctl_iscsi_list_params list
Definition: ctl_ioctl.h:725
struct ctl_iscsi_terminate_params terminate
Definition: ctl_ioctl.h:727
struct ctl_iscsi_limits_params limits
Definition: ctl_ioctl.h:728
struct ctl_iscsi_handoff_params handoff
Definition: ctl_ioctl.h:724
struct ctl_iscsi_logout_params logout
Definition: ctl_ioctl.h:726
struct ctl_lun_rm_params rm
Definition: ctl_ioctl.h:424
struct ctl_lun_modify_params modify
Definition: ctl_ioctl.h:425
struct ctl_lun_create_params create
Definition: ctl_ioctl.h:423