ctl_private.h revision 288727
1/*-
2 * Copyright (c) 2003, 2004, 2005, 2008 Silicon Graphics International Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions, and the following disclaimer,
10 *    without modification.
11 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12 *    substantially similar to the "NO WARRANTY" disclaimer below
13 *    ("Disclaimer") and any redistribution must be conditioned upon
14 *    including a substantially similar Disclaimer requirement for further
15 *    binary redistribution.
16 *
17 * NO WARRANTY
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGES.
29 *
30 * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_private.h#7 $
31 * $FreeBSD: stable/10/sys/cam/ctl/ctl_private.h 288727 2015-10-05 08:51:20Z mav $
32 */
33/*
34 * CAM Target Layer driver private data structures/definitions.
35 *
36 * Author: Ken Merry <ken@FreeBSD.org>
37 */
38
39#ifndef	_CTL_PRIVATE_H_
40#define	_CTL_PRIVATE_H_
41
42/*
43 * SCSI vendor and product names.
44 */
45#define	CTL_VENDOR		"FREEBSD "
46#define	CTL_DIRECT_PRODUCT	"CTLDISK         "
47#define	CTL_PROCESSOR_PRODUCT	"CTLPROCESSOR    "
48#define	CTL_UNKNOWN_PRODUCT	"CTLDEVICE       "
49
50typedef enum {
51	CTL_IOCTL_INPROG,
52	CTL_IOCTL_DATAMOVE,
53	CTL_IOCTL_DONE
54} ctl_fe_ioctl_state;
55
56struct ctl_fe_ioctl_params {
57	struct cv		sem;
58	struct mtx		ioctl_mtx;
59	ctl_fe_ioctl_state	state;
60};
61
62#define CTL_POOL_ENTRIES_OTHER_SC   200
63
64struct ctl_io_pool {
65	char				name[64];
66	uint32_t			id;
67	struct ctl_softc		*ctl_softc;
68	struct uma_zone			*zone;
69};
70
71typedef enum {
72	CTL_SER_BLOCK,
73	CTL_SER_BLOCKOPT,
74	CTL_SER_EXTENT,
75	CTL_SER_EXTENTOPT,
76	CTL_SER_EXTENTSEQ,
77	CTL_SER_PASS,
78	CTL_SER_SKIP
79} ctl_serialize_action;
80
81typedef enum {
82	CTL_ACTION_BLOCK,
83	CTL_ACTION_OVERLAP,
84	CTL_ACTION_OVERLAP_TAG,
85	CTL_ACTION_PASS,
86	CTL_ACTION_SKIP,
87	CTL_ACTION_ERROR
88} ctl_action;
89
90/*
91 * WARNING:  Keep the bottom nibble here free, we OR in the data direction
92 * flags for each command.
93 *
94 * Note:  "OK_ON_ALL_LUNS" == we don't have to have a lun configured
95 *        "OK_ON_BOTH"     == we have to have a lun configured
96 *        "SA5"            == command has 5-bit service action at byte 1
97 */
98typedef enum {
99	CTL_CMD_FLAG_NONE		= 0x0000,
100	CTL_CMD_FLAG_NO_SENSE		= 0x0010,
101	CTL_CMD_FLAG_OK_ON_ALL_LUNS	= 0x0020,
102	CTL_CMD_FLAG_ALLOW_ON_RESV	= 0x0040,
103	CTL_CMD_FLAG_ALLOW_ON_PR_WRESV	= 0x0080,
104	CTL_CMD_FLAG_OK_ON_PROC		= 0x0100,
105	CTL_CMD_FLAG_OK_ON_SLUN		= 0x0200,
106	CTL_CMD_FLAG_OK_ON_BOTH		= 0x0300,
107	CTL_CMD_FLAG_OK_ON_STOPPED	= 0x0400,
108	CTL_CMD_FLAG_OK_ON_INOPERABLE	= 0x0800,
109	CTL_CMD_FLAG_OK_ON_OFFLINE	= 0x1000,
110	CTL_CMD_FLAG_OK_ON_SECONDARY	= 0x2000,
111	CTL_CMD_FLAG_ALLOW_ON_PR_RESV	= 0x4000,
112	CTL_CMD_FLAG_SA5		= 0x8000
113} ctl_cmd_flags;
114
115typedef enum {
116	CTL_SERIDX_TUR	= 0,
117	CTL_SERIDX_READ,
118	CTL_SERIDX_WRITE,
119	CTL_SERIDX_UNMAP,
120	CTL_SERIDX_SYNC,
121	CTL_SERIDX_MD_SNS,
122	CTL_SERIDX_MD_SEL,
123	CTL_SERIDX_RQ_SNS,
124	CTL_SERIDX_INQ,
125	CTL_SERIDX_RD_CAP,
126	CTL_SERIDX_RES,
127	CTL_SERIDX_LOG_SNS,
128	CTL_SERIDX_FORMAT,
129	CTL_SERIDX_START,
130	/* TBD: others to be filled in as needed */
131	CTL_SERIDX_COUNT, /* LAST, not a normal code, provides # codes */
132	CTL_SERIDX_INVLD = CTL_SERIDX_COUNT
133} ctl_seridx;
134
135typedef int	ctl_opfunc(struct ctl_scsiio *ctsio);
136
137struct ctl_cmd_entry {
138	ctl_opfunc		*execute;
139	ctl_seridx		seridx;
140	ctl_cmd_flags		flags;
141	ctl_lun_error_pattern	pattern;
142	uint8_t			length;		/* CDB length */
143	uint8_t			usage[15];	/* Mask of allowed CDB bits
144						 * after the opcode byte. */
145};
146
147typedef enum {
148	CTL_LUN_NONE		= 0x000,
149	CTL_LUN_CONTROL		= 0x001,
150	CTL_LUN_RESERVED	= 0x002,
151	CTL_LUN_INVALID		= 0x004,
152	CTL_LUN_DISABLED	= 0x008,
153	CTL_LUN_MALLOCED	= 0x010,
154	CTL_LUN_STOPPED		= 0x020,
155	CTL_LUN_INOPERABLE	= 0x040,
156	CTL_LUN_OFFLINE		= 0x080,
157	CTL_LUN_PR_RESERVED	= 0x100,
158	CTL_LUN_PRIMARY_SC	= 0x200,
159	CTL_LUN_SENSE_DESC	= 0x400,
160	CTL_LUN_READONLY	= 0x800
161} ctl_lun_flags;
162
163typedef enum {
164	CTLBLOCK_FLAG_NONE	= 0x00,
165	CTLBLOCK_FLAG_INVALID	= 0x01
166} ctlblock_flags;
167
168union ctl_softcs {
169	struct ctl_softc	*ctl_softc;
170	struct ctlblock_softc	*ctlblock_softc;
171};
172
173/*
174 * Mode page defaults.
175 */
176#if 0
177/*
178 * These values make Solaris trim off some of the capacity.
179 */
180#define	CTL_DEFAULT_SECTORS_PER_TRACK	63
181#define	CTL_DEFAULT_HEADS		255
182/*
183 * These values seem to work okay.
184 */
185#define	CTL_DEFAULT_SECTORS_PER_TRACK	63
186#define	CTL_DEFAULT_HEADS		16
187/*
188 * These values work reasonably well.
189 */
190#define	CTL_DEFAULT_SECTORS_PER_TRACK	512
191#define	CTL_DEFAULT_HEADS		64
192#endif
193
194/*
195 * Solaris is somewhat picky about how many heads and sectors per track you
196 * have defined in mode pages 3 and 4.  These values seem to cause Solaris
197 * to get the capacity more or less right when you run the format tool.
198 * They still have problems when dealing with devices larger than 1TB,
199 * but there isn't anything we can do about that.
200 *
201 * For smaller LUN sizes, this ends up causing the number of cylinders to
202 * work out to 0.  Solaris actually recognizes that and comes up with its
203 * own bogus geometry to fit the actual capacity of the drive.  They really
204 * should just give up on geometry and stick to the read capacity
205 * information alone for modern disk drives.
206 *
207 * One thing worth mentioning about Solaris' mkfs command is that it
208 * doesn't like sectors per track values larger than 256.  512 seems to
209 * work okay for format, but causes problems when you try to make a
210 * filesystem.
211 *
212 * Another caveat about these values:  the product of these two values
213 * really should be a power of 2.  This is because of the simplistic
214 * shift-based calculation that we have to use on the i386 platform to
215 * calculate the number of cylinders here.  (If you use a divide, you end
216 * up calling __udivdi3(), which is a hardware FP call on the PC.  On the
217 * XScale, it is done in software, so you can do that from inside the
218 * kernel.)
219 *
220 * So for the current values (256 S/T, 128 H), we get 32768, which works
221 * very nicely for calculating cylinders.
222 *
223 * If you want to change these values so that their product is no longer a
224 * power of 2, re-visit the calculation in ctl_init_page_index().  You may
225 * need to make it a bit more complicated to get the number of cylinders
226 * right.
227 */
228#define	CTL_DEFAULT_SECTORS_PER_TRACK	256
229#define	CTL_DEFAULT_HEADS		128
230
231#define	CTL_DEFAULT_ROTATION_RATE	SVPD_NON_ROTATING
232
233struct ctl_page_index;
234
235typedef int	ctl_modesen_handler(struct ctl_scsiio *ctsio,
236				    struct ctl_page_index *page_index,
237				    int pc);
238typedef int	ctl_modesel_handler(struct ctl_scsiio *ctsio,
239				    struct ctl_page_index *page_index,
240				    uint8_t *page_ptr);
241
242typedef enum {
243	CTL_PAGE_FLAG_NONE	 = 0x00,
244	CTL_PAGE_FLAG_DISK_ONLY	 = 0x01
245} ctl_page_flags;
246
247struct ctl_page_index {
248	uint8_t			page_code;
249	uint8_t			subpage;
250	uint16_t		page_len;
251	uint8_t			*page_data;
252	ctl_page_flags		page_flags;
253	ctl_modesen_handler	*sense_handler;
254	ctl_modesel_handler	*select_handler;
255};
256
257#define	CTL_PAGE_CURRENT	0x00
258#define	CTL_PAGE_CHANGEABLE	0x01
259#define	CTL_PAGE_DEFAULT	0x02
260#define	CTL_PAGE_SAVED		0x03
261
262#define CTL_NUM_LBP_PARAMS	4
263#define CTL_NUM_LBP_THRESH	4
264#define CTL_LBP_EXPONENT	11	/* 2048 sectors */
265#define CTL_LBP_PERIOD		10	/* 10 seconds */
266#define CTL_LBP_UA_PERIOD	300	/* 5 minutes */
267
268struct ctl_logical_block_provisioning_page {
269	struct scsi_logical_block_provisioning_page	main;
270	struct scsi_logical_block_provisioning_page_descr descr[CTL_NUM_LBP_THRESH];
271};
272
273static const struct ctl_page_index page_index_template[] = {
274	{SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL,
275	 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
276	{SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL,
277	 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
278	{SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL,
279	 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
280	{SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL,
281	 CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler},
282	{SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL,
283	 CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler},
284	{SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL,
285	 CTL_PAGE_FLAG_NONE, NULL, NULL},
286	{SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02,
287	 sizeof(struct ctl_logical_block_provisioning_page), NULL,
288	 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
289	{SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE,
290	 sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE,
291	 ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler},
292};
293
294#define	CTL_NUM_MODE_PAGES sizeof(page_index_template)/   \
295			   sizeof(page_index_template[0])
296
297struct ctl_mode_pages {
298	struct scsi_da_rw_recovery_page	rw_er_page[4];
299	struct scsi_format_page		format_page[4];
300	struct scsi_rigid_disk_page	rigid_disk_page[4];
301	struct scsi_caching_page	caching_page[4];
302	struct scsi_control_page	control_page[4];
303	struct scsi_info_exceptions_page ie_page[4];
304	struct ctl_logical_block_provisioning_page lbp_page[4];
305	struct copan_debugconf_subpage	debugconf_subpage[4];
306	struct ctl_page_index		index[CTL_NUM_MODE_PAGES];
307};
308
309static const struct ctl_page_index log_page_index_template[] = {
310	{SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL,
311	 CTL_PAGE_FLAG_NONE, NULL, NULL},
312	{SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL,
313	 CTL_PAGE_FLAG_NONE, NULL, NULL},
314	{SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL,
315	 CTL_PAGE_FLAG_NONE, ctl_lbp_log_sense_handler, NULL},
316	{SLS_STAT_AND_PERF, 0, 0, NULL,
317	 CTL_PAGE_FLAG_NONE, ctl_sap_log_sense_handler, NULL},
318};
319
320#define	CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/   \
321			  sizeof(log_page_index_template[0])
322
323struct ctl_log_pages {
324	uint8_t				pages_page[CTL_NUM_LOG_PAGES];
325	uint8_t				subpages_page[CTL_NUM_LOG_PAGES * 2];
326	uint8_t				lbp_page[12*CTL_NUM_LBP_PARAMS];
327	struct stat_page {
328		struct scsi_log_stat_and_perf sap;
329		struct scsi_log_idle_time it;
330		struct scsi_log_time_interval ti;
331	} stat_page;
332	struct ctl_page_index		index[CTL_NUM_LOG_PAGES];
333};
334
335struct ctl_lun_delay_info {
336	ctl_delay_type		datamove_type;
337	uint32_t		datamove_delay;
338	ctl_delay_type		done_type;
339	uint32_t		done_delay;
340};
341
342typedef enum {
343	CTL_ERR_INJ_NONE	= 0x00,
344	CTL_ERR_INJ_ABORTED	= 0x01
345} ctl_err_inject_flags;
346
347typedef enum {
348	CTL_PR_FLAG_NONE	= 0x00,
349	CTL_PR_FLAG_REGISTERED	= 0x01,
350	CTL_PR_FLAG_ACTIVE_RES	= 0x02
351} ctl_per_res_flags;
352
353#define CTL_PR_ALL_REGISTRANTS  0xFFFFFFFF
354#define CTL_PR_NO_RESERVATION   0xFFFFFFF0
355
356struct ctl_devid {
357	int		len;
358	uint8_t		data[];
359};
360
361/*
362 * For report target port groups.
363 */
364#define NUM_TARGET_PORT_GROUPS	2
365
366#define CTL_WRITE_BUFFER_SIZE	262144
367
368struct tpc_list;
369struct ctl_lun {
370	struct mtx			lun_lock;
371	uint64_t			lun;
372	ctl_lun_flags			flags;
373	STAILQ_HEAD(,ctl_error_desc)	error_list;
374	uint64_t			error_serial;
375	struct ctl_softc		*ctl_softc;
376	struct ctl_be_lun		*be_lun;
377	struct ctl_backend_driver	*backend;
378	int				io_count;
379	struct ctl_lun_delay_info	delay_info;
380	int				sync_interval;
381	int				sync_count;
382#ifdef CTL_TIME_IO
383	sbintime_t			idle_time;
384	sbintime_t			last_busy;
385#endif
386	TAILQ_HEAD(ctl_ooaq, ctl_io_hdr)  ooa_queue;
387	TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue;
388	STAILQ_ENTRY(ctl_lun)		links;
389	STAILQ_ENTRY(ctl_lun)		run_links;
390#ifdef CTL_WITH_CA
391	uint32_t			have_ca[CTL_MAX_INITIATORS >> 5];
392	struct scsi_sense_data		pending_sense[CTL_MAX_INITIATORS];
393#endif
394	ctl_ua_type			*pending_ua[CTL_MAX_PORTS];
395	time_t				lasttpt;
396	struct ctl_mode_pages		mode_pages;
397	struct ctl_log_pages		log_pages;
398	struct ctl_lun_io_stats		stats;
399	uint32_t			res_idx;
400	unsigned int			PRGeneration;
401	uint64_t			*pr_keys[2 * CTL_MAX_PORTS];
402	int				pr_key_count;
403	uint32_t			pr_res_idx;
404	uint8_t				res_type;
405	uint8_t				*write_buffer;
406	struct ctl_devid		*lun_devid;
407	TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists;
408};
409
410typedef enum {
411	CTL_FLAG_REAL_SYNC	= 0x02,
412	CTL_FLAG_ACTIVE_SHELF	= 0x04
413} ctl_gen_flags;
414
415#define CTL_MAX_THREADS		16
416
417struct ctl_thread {
418	struct mtx_padalign queue_lock;
419	struct ctl_softc	*ctl_softc;
420	struct thread		*thread;
421	STAILQ_HEAD(, ctl_io_hdr) incoming_queue;
422	STAILQ_HEAD(, ctl_io_hdr) rtr_queue;
423	STAILQ_HEAD(, ctl_io_hdr) done_queue;
424	STAILQ_HEAD(, ctl_io_hdr) isc_queue;
425};
426
427struct tpc_token;
428struct ctl_softc {
429	struct mtx ctl_lock;
430	struct cdev *dev;
431	int open_count;
432	int num_disks;
433	int num_luns;
434	ctl_gen_flags flags;
435	ctl_ha_mode ha_mode;
436	int ha_id;
437	int ha_state;
438	int is_single;
439	int port_offset;
440	int persis_offset;
441	int inquiry_pq_no_lun;
442	struct sysctl_ctx_list sysctl_ctx;
443	struct sysctl_oid *sysctl_tree;
444	void *othersc_pool;
445	struct proc *ctl_proc;
446	int targ_online;
447	uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32];
448	struct ctl_lun *ctl_luns[CTL_MAX_LUNS];
449	uint32_t ctl_port_mask[(CTL_MAX_PORTS + 31) / 32];
450	STAILQ_HEAD(, ctl_lun) lun_list;
451	STAILQ_HEAD(, ctl_be_lun) pending_lun_queue;
452	uint32_t num_frontends;
453	STAILQ_HEAD(, ctl_frontend) fe_list;
454	uint32_t num_ports;
455	STAILQ_HEAD(, ctl_port) port_list;
456	struct ctl_port *ctl_ports[CTL_MAX_PORTS];
457	uint32_t num_backends;
458	STAILQ_HEAD(, ctl_backend_driver) be_list;
459	struct uma_zone *io_zone;
460	uint32_t cur_pool_id;
461	struct ctl_thread threads[CTL_MAX_THREADS];
462	TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens;
463	struct callout tpc_timeout;
464	struct mtx tpc_lock;
465};
466
467#ifdef _KERNEL
468
469extern const struct ctl_cmd_entry ctl_cmd_table[256];
470
471uint32_t ctl_get_initindex(struct ctl_nexus *nexus);
472uint32_t ctl_get_resindex(struct ctl_nexus *nexus);
473uint32_t ctl_port_idx(int port_num);
474int ctl_lun_map_init(struct ctl_port *port);
475int ctl_lun_map_deinit(struct ctl_port *port);
476int ctl_lun_map_set(struct ctl_port *port, uint32_t plun, uint32_t glun);
477int ctl_lun_map_unset(struct ctl_port *port, uint32_t plun);
478uint32_t ctl_lun_map_from_port(struct ctl_port *port, uint32_t plun);
479uint32_t ctl_lun_map_to_port(struct ctl_port *port, uint32_t glun);
480int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name,
481		    uint32_t total_ctl_io, void **npool);
482void ctl_pool_free(struct ctl_io_pool *pool);
483int ctl_scsi_release(struct ctl_scsiio *ctsio);
484int ctl_scsi_reserve(struct ctl_scsiio *ctsio);
485int ctl_start_stop(struct ctl_scsiio *ctsio);
486int ctl_sync_cache(struct ctl_scsiio *ctsio);
487int ctl_format(struct ctl_scsiio *ctsio);
488int ctl_read_buffer(struct ctl_scsiio *ctsio);
489int ctl_write_buffer(struct ctl_scsiio *ctsio);
490int ctl_write_same(struct ctl_scsiio *ctsio);
491int ctl_unmap(struct ctl_scsiio *ctsio);
492int ctl_mode_select(struct ctl_scsiio *ctsio);
493int ctl_mode_sense(struct ctl_scsiio *ctsio);
494int ctl_log_sense(struct ctl_scsiio *ctsio);
495int ctl_read_capacity(struct ctl_scsiio *ctsio);
496int ctl_read_capacity_16(struct ctl_scsiio *ctsio);
497int ctl_read_defect(struct ctl_scsiio *ctsio);
498int ctl_read_write(struct ctl_scsiio *ctsio);
499int ctl_cnw(struct ctl_scsiio *ctsio);
500int ctl_report_luns(struct ctl_scsiio *ctsio);
501int ctl_request_sense(struct ctl_scsiio *ctsio);
502int ctl_tur(struct ctl_scsiio *ctsio);
503int ctl_verify(struct ctl_scsiio *ctsio);
504int ctl_inquiry(struct ctl_scsiio *ctsio);
505int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio);
506int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio);
507int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio);
508int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio);
509int ctl_report_supported_tmf(struct ctl_scsiio *ctsio);
510int ctl_report_timestamp(struct ctl_scsiio *ctsio);
511int ctl_isc(struct ctl_scsiio *ctsio);
512int ctl_get_lba_status(struct ctl_scsiio *ctsio);
513
514void ctl_tpc_init(struct ctl_softc *softc);
515void ctl_tpc_shutdown(struct ctl_softc *softc);
516void ctl_tpc_lun_init(struct ctl_lun *lun);
517void ctl_tpc_lun_shutdown(struct ctl_lun *lun);
518int ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len);
519int ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio);
520int ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio);
521int ctl_receive_copy_status_lid4(struct ctl_scsiio *ctsio);
522int ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio);
523int ctl_extended_copy_lid1(struct ctl_scsiio *ctsio);
524int ctl_extended_copy_lid4(struct ctl_scsiio *ctsio);
525int ctl_copy_operation_abort(struct ctl_scsiio *ctsio);
526int ctl_populate_token(struct ctl_scsiio *ctsio);
527int ctl_write_using_token(struct ctl_scsiio *ctsio);
528int ctl_receive_rod_token_information(struct ctl_scsiio *ctsio);
529int ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio);
530
531#endif	/* _KERNEL */
532
533#endif	/* _CTL_PRIVATE_H_ */
534
535/*
536 * vim: ts=8
537 */
538