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