xref: /freebsd/sys/cam/ctl/ctl_private.h (revision b1d324d98761a8640aef94c76cbccafc22c8dcc8)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2003, 2004, 2005, 2008 Silicon Graphics International Corp.
5  * Copyright (c) 2014-2017 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_private.h#7 $
34  */
35 /*
36  * CAM Target Layer driver private data structures/definitions.
37  *
38  * Author: Ken Merry <ken@FreeBSD.org>
39  */
40 
41 #ifndef	_CTL_PRIVATE_H_
42 #define	_CTL_PRIVATE_H_
43 
44 #include <sys/sysctl.h>
45 #include <cam/scsi/scsi_all.h>
46 #include <cam/scsi/scsi_cd.h>
47 #include <cam/scsi/scsi_da.h>
48 
49 /*
50  * SCSI vendor and product names.
51  */
52 #define	CTL_VENDOR		"FREEBSD "
53 #define	CTL_DIRECT_PRODUCT	"CTLDISK         "
54 #define	CTL_PROCESSOR_PRODUCT	"CTLPROCESSOR    "
55 #define	CTL_CDROM_PRODUCT	"CTLCDROM        "
56 #define	CTL_UNKNOWN_PRODUCT	"CTLDEVICE       "
57 
58 #define CTL_POOL_ENTRIES_OTHER_SC   200
59 
60 struct ctl_io_pool {
61 	char			name[64];
62 	uint32_t		id;
63 	struct ctl_softc	*ctl_softc;
64 	struct uma_zone		*zone;
65 };
66 
67 typedef enum {
68 	CTL_SER_SEQ,
69 	CTL_SER_PASS,
70 	CTL_SER_EXTENTOPT,
71 	CTL_SER_EXTENT,
72 	CTL_SER_BLOCKOPT,
73 	CTL_SER_BLOCK,
74 } ctl_serialize_action;
75 
76 typedef enum {
77 	CTL_ACTION_PASS,
78 	CTL_ACTION_SKIP,
79 	CTL_ACTION_BLOCK,
80 	CTL_ACTION_OVERLAP,
81 	CTL_ACTION_OVERLAP_TAG,
82 	CTL_ACTION_FUSED,
83 } ctl_action;
84 
85 /*
86  * WARNING:  Keep the bottom nibble here free, we OR in the data direction
87  * flags for each command.
88  *
89  * Note:  "OK_ON_NO_LUN"   == we don't have to have a lun configured
90  *        "OK_ON_BOTH"     == we have to have a lun configured
91  *        "SA5"            == command has 5-bit service action at byte 1
92  */
93 typedef enum {
94 	CTL_CMD_FLAG_NONE		= 0x0000,
95 	CTL_CMD_FLAG_NO_SENSE		= 0x0010,
96 	CTL_CMD_FLAG_ALLOW_ON_RESV	= 0x0020,
97 	CTL_CMD_FLAG_ALLOW_ON_PR_RESV	= 0x0040,
98 	CTL_CMD_FLAG_ALLOW_ON_PR_WRESV	= 0x0080,
99 	CTL_CMD_FLAG_OK_ON_PROC		= 0x0100,
100 	CTL_CMD_FLAG_OK_ON_DIRECT	= 0x0200,
101 	CTL_CMD_FLAG_OK_ON_CDROM	= 0x0400,
102 	CTL_CMD_FLAG_OK_ON_BOTH		= 0x0700,
103 	CTL_CMD_FLAG_OK_ON_NO_LUN	= 0x0800,
104 	CTL_CMD_FLAG_OK_ON_NO_MEDIA	= 0x1000,
105 	CTL_CMD_FLAG_OK_ON_STANDBY	= 0x2000,
106 	CTL_CMD_FLAG_OK_ON_UNAVAIL	= 0x4000,
107 	CTL_CMD_FLAG_SA5		= 0x8000,
108 	CTL_CMD_FLAG_RUN_HERE		= 0x10000
109 } ctl_cmd_flags;
110 
111 typedef enum {
112 	CTL_SERIDX_TUR	= 0,
113 	CTL_SERIDX_READ,
114 	CTL_SERIDX_WRITE,
115 	CTL_SERIDX_UNMAP,
116 	CTL_SERIDX_SYNC,
117 	CTL_SERIDX_MD_SNS,
118 	CTL_SERIDX_MD_SEL,
119 	CTL_SERIDX_RQ_SNS,
120 	CTL_SERIDX_INQ,
121 	CTL_SERIDX_RD_CAP,
122 	CTL_SERIDX_RES,
123 	CTL_SERIDX_LOG_SNS,
124 	CTL_SERIDX_FORMAT,
125 	CTL_SERIDX_START,
126 	/* TBD: others to be filled in as needed */
127 	CTL_SERIDX_COUNT, /* LAST, not a normal code, provides # codes */
128 	CTL_SERIDX_INVLD = CTL_SERIDX_COUNT
129 } ctl_seridx;
130 
131 typedef int	ctl_opfunc(struct ctl_scsiio *ctsio);
132 
133 struct ctl_cmd_entry {
134 	ctl_opfunc		*execute;
135 	ctl_seridx		seridx;
136 	ctl_cmd_flags		flags;
137 	ctl_lun_error_pattern	pattern;
138 	uint8_t			length;		/* CDB length */
139 	uint8_t			usage[15];	/* Mask of allowed CDB bits
140 						 * after the opcode byte. */
141 };
142 
143 /* Only data flags are currently used for NVMe commands. */
144 struct ctl_nvme_cmd_entry {
145 	int			(*execute)(struct ctl_nvmeio *);
146 	ctl_io_flags		flags;
147 };
148 
149 typedef enum {
150 	CTL_LUN_NONE		= 0x000,
151 	CTL_LUN_CONTROL		= 0x001,
152 	CTL_LUN_RESERVED	= 0x002,
153 	CTL_LUN_INVALID		= 0x004,
154 	CTL_LUN_DISABLED	= 0x008,
155 	CTL_LUN_STOPPED		= 0x020,
156 	CTL_LUN_NO_MEDIA	= 0x040,
157 	CTL_LUN_EJECTED		= 0x080,
158 	CTL_LUN_PR_RESERVED	= 0x100,
159 	CTL_LUN_PRIMARY_SC	= 0x200,
160 	CTL_LUN_READONLY	= 0x800,
161 	CTL_LUN_PEER_SC_PRIMARY	= 0x1000,
162 	CTL_LUN_REMOVABLE	= 0x2000
163 } ctl_lun_flags;
164 
165 typedef enum {
166 	CTLBLOCK_FLAG_NONE	= 0x00,
167 	CTLBLOCK_FLAG_INVALID	= 0x01
168 } ctlblock_flags;
169 
170 union ctl_softcs {
171 	struct ctl_softc	*ctl_softc;
172 	struct ctlblock_softc	*ctlblock_softc;
173 };
174 
175 /*
176  * Mode page defaults.
177  */
178 #define	CTL_DEFAULT_ROTATION_RATE	SVPD_NON_ROTATING
179 
180 struct ctl_page_index;
181 
182 typedef int	ctl_modesen_handler(struct ctl_scsiio *ctsio,
183 				    struct ctl_page_index *page_index,
184 				    int pc);
185 typedef int	ctl_modesel_handler(struct ctl_scsiio *ctsio,
186 				    struct ctl_page_index *page_index,
187 				    uint8_t *page_ptr);
188 
189 typedef enum {
190 	CTL_PAGE_FLAG_NONE	 = 0x00,
191 	CTL_PAGE_FLAG_DIRECT	 = 0x01,
192 	CTL_PAGE_FLAG_PROC	 = 0x02,
193 	CTL_PAGE_FLAG_CDROM	 = 0x04,
194 	CTL_PAGE_FLAG_ALL	 = 0x07
195 } ctl_page_flags;
196 
197 struct ctl_page_index {
198 	uint8_t			page_code;
199 	uint8_t			subpage;
200 	uint16_t		page_len;
201 	uint8_t			*page_data;
202 	ctl_page_flags		page_flags;
203 	ctl_modesen_handler	*sense_handler;
204 	ctl_modesel_handler	*select_handler;
205 };
206 
207 #define	CTL_PAGE_CURRENT	0x00
208 #define	CTL_PAGE_CHANGEABLE	0x01
209 #define	CTL_PAGE_DEFAULT	0x02
210 #define	CTL_PAGE_SAVED		0x03
211 
212 #define CTL_NUM_LBP_PARAMS	4
213 #define CTL_NUM_LBP_THRESH	4
214 #define CTL_LBP_EXPONENT	11	/* 2048 sectors */
215 #define CTL_LBP_PERIOD		10	/* 10 seconds */
216 #define CTL_LBP_UA_PERIOD	300	/* 5 minutes */
217 
218 struct ctl_logical_block_provisioning_page {
219 	struct scsi_logical_block_provisioning_page	main;
220 	struct scsi_logical_block_provisioning_page_descr descr[CTL_NUM_LBP_THRESH];
221 };
222 
223 static const struct ctl_page_index page_index_template[] = {
224 	{SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL,
225 	 CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM, NULL, ctl_default_page_handler},
226 	{SMS_VERIFY_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_verify_recovery_page), NULL,
227 	 CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM, NULL, ctl_default_page_handler},
228 	{SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL,
229 	 CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM,
230 	 NULL, ctl_default_page_handler},
231 	{SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL,
232 	 CTL_PAGE_FLAG_ALL, NULL, ctl_default_page_handler},
233 	{SMS_CONTROL_MODE_PAGE | SMPH_SPF, 0x01,
234 	 sizeof(struct scsi_control_ext_page), NULL,
235 	 CTL_PAGE_FLAG_ALL, NULL, ctl_default_page_handler},
236 	{SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL,
237 	 CTL_PAGE_FLAG_ALL, NULL, ctl_ie_page_handler},
238 	{SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02,
239 	 sizeof(struct ctl_logical_block_provisioning_page), NULL,
240 	 CTL_PAGE_FLAG_DIRECT, NULL, ctl_default_page_handler},
241 	{SMS_CDDVD_CAPS_PAGE, 0,
242 	 sizeof(struct scsi_cddvd_capabilities_page), NULL,
243 	 CTL_PAGE_FLAG_CDROM, NULL, NULL},
244 };
245 
246 #define	CTL_NUM_MODE_PAGES sizeof(page_index_template)/   \
247 			   sizeof(page_index_template[0])
248 
249 struct ctl_mode_pages {
250 	struct scsi_da_rw_recovery_page	rw_er_page[4];
251 	struct scsi_da_verify_recovery_page	verify_er_page[4];
252 	struct scsi_caching_page	caching_page[4];
253 	struct scsi_control_page	control_page[4];
254 	struct scsi_control_ext_page	control_ext_page[4];
255 	struct scsi_info_exceptions_page ie_page[4];
256 	struct ctl_logical_block_provisioning_page lbp_page[4];
257 	struct scsi_cddvd_capabilities_page cddvd_page[4];
258 	struct ctl_page_index		index[CTL_NUM_MODE_PAGES];
259 };
260 
261 #define	MODE_RWER	mode_pages.rw_er_page[CTL_PAGE_CURRENT]
262 #define	MODE_VER	mode_pages.verify_er_page[CTL_PAGE_CURRENT]
263 #define	MODE_CACHING	mode_pages.caching_page[CTL_PAGE_CURRENT]
264 #define	MODE_CTRL	mode_pages.control_page[CTL_PAGE_CURRENT]
265 #define	MODE_CTRLE	mode_pages.control_ext_page[CTL_PAGE_CURRENT]
266 #define	MODE_IE		mode_pages.ie_page[CTL_PAGE_CURRENT]
267 #define	MODE_LBP	mode_pages.lbp_page[CTL_PAGE_CURRENT]
268 #define	MODE_CDDVD	mode_pages.cddvd_page[CTL_PAGE_CURRENT]
269 
270 static const struct ctl_page_index log_page_index_template[] = {
271 	{SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL,
272 	 CTL_PAGE_FLAG_ALL, NULL, NULL},
273 	{SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL,
274 	 CTL_PAGE_FLAG_ALL, NULL, NULL},
275 	{SLS_TEMPERATURE, 0, 0, NULL,
276 	 CTL_PAGE_FLAG_DIRECT, ctl_temp_log_sense_handler, NULL},
277 	{SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL,
278 	 CTL_PAGE_FLAG_DIRECT, ctl_lbp_log_sense_handler, NULL},
279 	{SLS_STAT_AND_PERF, 0, 0, NULL,
280 	 CTL_PAGE_FLAG_ALL, ctl_sap_log_sense_handler, NULL},
281 	{SLS_IE_PAGE, 0, 0, NULL,
282 	 CTL_PAGE_FLAG_ALL, ctl_ie_log_sense_handler, NULL},
283 };
284 
285 #define	CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/   \
286 			  sizeof(log_page_index_template[0])
287 
288 struct ctl_log_pages {
289 	uint8_t				pages_page[CTL_NUM_LOG_PAGES];
290 	uint8_t				subpages_page[CTL_NUM_LOG_PAGES * 2];
291 	uint8_t				lbp_page[12*CTL_NUM_LBP_PARAMS];
292 	struct stat_page {
293 		struct scsi_log_stat_and_perf sap;
294 		struct scsi_log_idle_time it;
295 		struct scsi_log_time_interval ti;
296 	} stat_page;
297 	struct scsi_log_temperature	temp_page[2];
298 	struct scsi_log_informational_exceptions	ie_page;
299 	struct ctl_page_index		index[CTL_NUM_LOG_PAGES];
300 };
301 
302 struct ctl_lun_delay_info {
303 	ctl_delay_type		datamove_type;
304 	uint32_t		datamove_delay;
305 	ctl_delay_type		done_type;
306 	uint32_t		done_delay;
307 };
308 
309 #define CTL_PR_ALL_REGISTRANTS  0xFFFFFFFF
310 #define CTL_PR_NO_RESERVATION   0xFFFFFFF0
311 
312 struct ctl_devid {
313 	int		len;
314 	uint8_t		data[];
315 };
316 
317 #define NUM_HA_SHELVES		2
318 
319 #define CTL_WRITE_BUFFER_SIZE	262144
320 
321 struct tpc_list;
322 struct ctl_lun {
323 	struct mtx			lun_lock;
324 	uint64_t			lun;
325 	ctl_lun_flags			flags;
326 	STAILQ_HEAD(,ctl_error_desc)	error_list;
327 	uint64_t			error_serial;
328 	struct ctl_softc		*ctl_softc;
329 	struct ctl_be_lun		*be_lun;
330 	struct ctl_backend_driver	*backend;
331 	struct ctl_lun_delay_info	delay_info;
332 #ifdef CTL_TIME_IO
333 	sbintime_t			idle_time;
334 	sbintime_t			last_busy;
335 #endif
336 	LIST_HEAD(ctl_ooaq, ctl_io_hdr)	ooa_queue;
337 	STAILQ_ENTRY(ctl_lun)		links;
338 	struct scsi_sense_data		**pending_sense;
339 	ctl_ua_type			**pending_ua;
340 	uint8_t				ua_tpt_info[8];
341 	time_t				lasttpt;
342 	uint8_t				ie_asc;	/* Informational exceptions */
343 	uint8_t				ie_ascq;
344 	int				ie_reported;	/* Already reported */
345 	uint32_t			ie_reportcnt;	/* REPORT COUNT */
346 	struct callout			ie_callout;	/* INTERVAL TIMER */
347 	struct ctl_mode_pages		mode_pages;
348 	struct ctl_log_pages		log_pages;
349 	struct ctl_io_stats		stats;
350 	uint32_t			res_idx;
351 	uint32_t			pr_generation;
352 	uint64_t			**pr_keys;
353 	int				pr_key_count;
354 	uint32_t			pr_res_idx;
355 	uint8_t				pr_res_type;
356 	int				prevent_count;
357 	uint32_t			*prevent;
358 
359 	/*
360 	 * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical
361 	 * data buffer associated with a LUN.  Accesses to the data buffer do
362 	 * not affect data stored on the storage medium.  To support this,
363 	 * allocate a buffer on first use that persists until the LUN is
364 	 * destroyed.
365 	 */
366 	uint8_t				*write_buffer;
367 	struct ctl_devid		*lun_devid;
368 	TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists;
369 };
370 
371 typedef enum {
372 	CTL_FLAG_ACTIVE_SHELF	= 0x04
373 } ctl_gen_flags;
374 
375 #define CTL_MAX_THREADS		16
376 
377 struct ctl_thread {
378 	struct mtx_padalign queue_lock;
379 	struct ctl_softc	*ctl_softc;
380 	struct thread		*thread;
381 	STAILQ_HEAD(, ctl_io_hdr) incoming_queue;
382 	STAILQ_HEAD(, ctl_io_hdr) rtr_queue;
383 	STAILQ_HEAD(, ctl_io_hdr) done_queue;
384 	STAILQ_HEAD(, ctl_io_hdr) isc_queue;
385 };
386 
387 struct tpc_token;
388 struct ctl_softc {
389 	struct mtx		ctl_lock;
390 	struct cdev		*dev;
391 	int			num_luns;
392 	ctl_gen_flags		flags;
393 	ctl_ha_mode		ha_mode;
394 	int			ha_id;
395 	int			is_single;
396 	ctl_ha_link_state	ha_link;
397 	int			port_min;
398 	int			port_max;
399 	int			port_cnt;
400 	int			init_min;
401 	int			init_max;
402 	struct sysctl_ctx_list	sysctl_ctx;
403 	struct sysctl_oid	*sysctl_tree;
404 	void			*othersc_pool;
405 	struct proc		*ctl_proc;
406 	uint32_t		*ctl_lun_mask;
407 	struct ctl_lun		**ctl_luns;
408 	uint32_t		*ctl_port_mask;
409 	STAILQ_HEAD(, ctl_lun)	lun_list;
410 	uint32_t		num_frontends;
411 	STAILQ_HEAD(, ctl_frontend)	fe_list;
412 	uint32_t		num_ports;
413 	STAILQ_HEAD(, ctl_port)	port_list;
414 	struct ctl_port		**ctl_ports;
415 	uint32_t		num_backends;
416 	STAILQ_HEAD(, ctl_backend_driver)	be_list;
417 	struct uma_zone		*io_zone;
418 	uint32_t		cur_pool_id;
419 	int			shutdown;
420 	struct ctl_thread	threads[CTL_MAX_THREADS];
421 	struct thread		*thresh_thread;
422 	TAILQ_HEAD(tpc_tokens, tpc_token)	tpc_tokens;
423 	struct callout		tpc_timeout;
424 	struct mtx		tpc_lock;
425 };
426 
427 #ifdef _KERNEL
428 
429 extern struct ctl_softc *control_softc;
430 extern const struct ctl_cmd_entry ctl_cmd_table[256];
431 extern const struct ctl_nvme_cmd_entry nvme_admin_cmd_table[256];
432 extern const struct ctl_nvme_cmd_entry nvme_nvm_cmd_table[256];
433 
434 uint32_t ctl_get_initindex(struct ctl_nexus *nexus);
435 int ctl_lun_map_init(struct ctl_port *port);
436 int ctl_lun_map_deinit(struct ctl_port *port);
437 int ctl_lun_map_set(struct ctl_port *port, uint32_t plun, uint32_t glun);
438 int ctl_lun_map_unset(struct ctl_port *port, uint32_t plun);
439 uint32_t ctl_lun_map_from_port(struct ctl_port *port, uint32_t plun);
440 uint32_t ctl_lun_map_to_port(struct ctl_port *port, uint32_t glun);
441 int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name,
442 		    uint32_t total_ctl_io, void **npool);
443 void ctl_pool_free(struct ctl_io_pool *pool);
444 int ctl_scsi_release(struct ctl_scsiio *ctsio);
445 int ctl_scsi_reserve(struct ctl_scsiio *ctsio);
446 int ctl_start_stop(struct ctl_scsiio *ctsio);
447 int ctl_prevent_allow(struct ctl_scsiio *ctsio);
448 int ctl_sync_cache(struct ctl_scsiio *ctsio);
449 int ctl_format(struct ctl_scsiio *ctsio);
450 int ctl_read_buffer(struct ctl_scsiio *ctsio);
451 int ctl_write_buffer(struct ctl_scsiio *ctsio);
452 int ctl_write_same(struct ctl_scsiio *ctsio);
453 int ctl_unmap(struct ctl_scsiio *ctsio);
454 int ctl_mode_select(struct ctl_scsiio *ctsio);
455 int ctl_mode_sense(struct ctl_scsiio *ctsio);
456 int ctl_log_sense(struct ctl_scsiio *ctsio);
457 int ctl_read_capacity(struct ctl_scsiio *ctsio);
458 int ctl_read_capacity_16(struct ctl_scsiio *ctsio);
459 int ctl_read_defect(struct ctl_scsiio *ctsio);
460 int ctl_read_toc(struct ctl_scsiio *ctsio);
461 int ctl_read_write(struct ctl_scsiio *ctsio);
462 int ctl_cnw(struct ctl_scsiio *ctsio);
463 int ctl_report_luns(struct ctl_scsiio *ctsio);
464 int ctl_request_sense(struct ctl_scsiio *ctsio);
465 int ctl_tur(struct ctl_scsiio *ctsio);
466 int ctl_verify(struct ctl_scsiio *ctsio);
467 int ctl_inquiry(struct ctl_scsiio *ctsio);
468 int ctl_get_config(struct ctl_scsiio *ctsio);
469 int ctl_get_event_status(struct ctl_scsiio *ctsio);
470 int ctl_mechanism_status(struct ctl_scsiio *ctsio);
471 int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio);
472 int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio);
473 int ctl_report_ident_info(struct ctl_scsiio *ctsio);
474 int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio);
475 int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio);
476 int ctl_report_supported_tmf(struct ctl_scsiio *ctsio);
477 int ctl_report_timestamp(struct ctl_scsiio *ctsio);
478 int ctl_get_lba_status(struct ctl_scsiio *ctsio);
479 
480 int ctl_nvme_identify(struct ctl_nvmeio *ctnio);
481 int ctl_nvme_flush(struct ctl_nvmeio *ctnio);
482 int ctl_nvme_read_write(struct ctl_nvmeio *ctnio);
483 int ctl_nvme_write_uncorrectable(struct ctl_nvmeio *ctnio);
484 int ctl_nvme_compare(struct ctl_nvmeio *ctnio);
485 int ctl_nvme_write_zeroes(struct ctl_nvmeio *ctnio);
486 int ctl_nvme_dataset_management(struct ctl_nvmeio *ctnio);
487 int ctl_nvme_verify(struct ctl_nvmeio *ctnio);
488 
489 void ctl_tpc_init(struct ctl_softc *softc);
490 void ctl_tpc_shutdown(struct ctl_softc *softc);
491 void ctl_tpc_lun_init(struct ctl_lun *lun);
492 void ctl_tpc_lun_clear(struct ctl_lun *lun, uint32_t initidx);
493 void ctl_tpc_lun_shutdown(struct ctl_lun *lun);
494 int ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len);
495 int ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio);
496 int ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio);
497 int ctl_receive_copy_status_lid4(struct ctl_scsiio *ctsio);
498 int ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio);
499 int ctl_extended_copy_lid1(struct ctl_scsiio *ctsio);
500 int ctl_extended_copy_lid4(struct ctl_scsiio *ctsio);
501 int ctl_copy_operation_abort(struct ctl_scsiio *ctsio);
502 int ctl_populate_token(struct ctl_scsiio *ctsio);
503 int ctl_write_using_token(struct ctl_scsiio *ctsio);
504 int ctl_receive_rod_token_information(struct ctl_scsiio *ctsio);
505 int ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio);
506 
507 #endif	/* _KERNEL */
508 
509 #endif	/* _CTL_PRIVATE_H_ */
510 
511 /*
512  * vim: ts=8
513  */
514