Deleted Added
full compact
ctl_private.h (288264) ctl_private.h (288310)
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

--- 14 unchanged lines hidden (view full) ---

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 $
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

--- 14 unchanged lines hidden (view full) ---

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: head/sys/cam/ctl/ctl_private.h 288264 2015-09-26 13:51:29Z mav $
31 * $FreeBSD: head/sys/cam/ctl/ctl_private.h 288310 2015-09-27 13:47:28Z 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 "
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_CDROM_PRODUCT "CTLCDROM "
48#define CTL_UNKNOWN_PRODUCT "CTLDEVICE "
49
50#define CTL_POOL_ENTRIES_OTHER_SC 200
51
52struct ctl_io_pool {
53 char name[64];
54 uint32_t id;
55 struct ctl_softc *ctl_softc;

--- 29 unchanged lines hidden (view full) ---

85 */
86typedef enum {
87 CTL_CMD_FLAG_NONE = 0x0000,
88 CTL_CMD_FLAG_NO_SENSE = 0x0010,
89 CTL_CMD_FLAG_OK_ON_NO_LUN = 0x0020,
90 CTL_CMD_FLAG_ALLOW_ON_RESV = 0x0040,
91 CTL_CMD_FLAG_ALLOW_ON_PR_WRESV = 0x0080,
92 CTL_CMD_FLAG_OK_ON_PROC = 0x0100,
49#define CTL_UNKNOWN_PRODUCT "CTLDEVICE "
50
51#define CTL_POOL_ENTRIES_OTHER_SC 200
52
53struct ctl_io_pool {
54 char name[64];
55 uint32_t id;
56 struct ctl_softc *ctl_softc;

--- 29 unchanged lines hidden (view full) ---

86 */
87typedef enum {
88 CTL_CMD_FLAG_NONE = 0x0000,
89 CTL_CMD_FLAG_NO_SENSE = 0x0010,
90 CTL_CMD_FLAG_OK_ON_NO_LUN = 0x0020,
91 CTL_CMD_FLAG_ALLOW_ON_RESV = 0x0040,
92 CTL_CMD_FLAG_ALLOW_ON_PR_WRESV = 0x0080,
93 CTL_CMD_FLAG_OK_ON_PROC = 0x0100,
93 CTL_CMD_FLAG_OK_ON_SLUN = 0x0200,
94 CTL_CMD_FLAG_OK_ON_BOTH = 0x0300,
95 CTL_CMD_FLAG_OK_ON_STOPPED = 0x0400,
94 CTL_CMD_FLAG_OK_ON_DIRECT = 0x0200,
95 CTL_CMD_FLAG_OK_ON_CDROM = 0x0400,
96 CTL_CMD_FLAG_OK_ON_BOTH = 0x0700,
96 CTL_CMD_FLAG_OK_ON_INOPERABLE = 0x0800,
97 CTL_CMD_FLAG_OK_ON_STANDBY = 0x1000,
98 CTL_CMD_FLAG_OK_ON_UNAVAIL = 0x2000,
99 CTL_CMD_FLAG_ALLOW_ON_PR_RESV = 0x4000,
100 CTL_CMD_FLAG_SA5 = 0x8000,
97 CTL_CMD_FLAG_OK_ON_INOPERABLE = 0x0800,
98 CTL_CMD_FLAG_OK_ON_STANDBY = 0x1000,
99 CTL_CMD_FLAG_OK_ON_UNAVAIL = 0x2000,
100 CTL_CMD_FLAG_ALLOW_ON_PR_RESV = 0x4000,
101 CTL_CMD_FLAG_SA5 = 0x8000,
101 CTL_CMD_FLAG_RUN_HERE = 0x10000
102 CTL_CMD_FLAG_RUN_HERE = 0x10000,
103 CTL_CMD_FLAG_OK_ON_STOPPED = 0x20000
102} ctl_cmd_flags;
103
104typedef enum {
105 CTL_SERIDX_TUR = 0,
106 CTL_SERIDX_READ,
107 CTL_SERIDX_WRITE,
108 CTL_SERIDX_UNMAP,
109 CTL_SERIDX_SYNC,

--- 32 unchanged lines hidden (view full) ---

142 CTL_LUN_MALLOCED = 0x010,
143 CTL_LUN_STOPPED = 0x020,
144 CTL_LUN_INOPERABLE = 0x040,
145 CTL_LUN_OFFLINE = 0x080,
146 CTL_LUN_PR_RESERVED = 0x100,
147 CTL_LUN_PRIMARY_SC = 0x200,
148 CTL_LUN_SENSE_DESC = 0x400,
149 CTL_LUN_READONLY = 0x800,
104} ctl_cmd_flags;
105
106typedef enum {
107 CTL_SERIDX_TUR = 0,
108 CTL_SERIDX_READ,
109 CTL_SERIDX_WRITE,
110 CTL_SERIDX_UNMAP,
111 CTL_SERIDX_SYNC,

--- 32 unchanged lines hidden (view full) ---

144 CTL_LUN_MALLOCED = 0x010,
145 CTL_LUN_STOPPED = 0x020,
146 CTL_LUN_INOPERABLE = 0x040,
147 CTL_LUN_OFFLINE = 0x080,
148 CTL_LUN_PR_RESERVED = 0x100,
149 CTL_LUN_PRIMARY_SC = 0x200,
150 CTL_LUN_SENSE_DESC = 0x400,
151 CTL_LUN_READONLY = 0x800,
150 CTL_LUN_PEER_SC_PRIMARY = 0x1000
152 CTL_LUN_PEER_SC_PRIMARY = 0x1000,
153 CTL_LUN_REMOVABLE = 0x2000
151} ctl_lun_flags;
152
153typedef enum {
154 CTLBLOCK_FLAG_NONE = 0x00,
155 CTLBLOCK_FLAG_INVALID = 0x01
156} ctlblock_flags;
157
158union ctl_softcs {

--- 67 unchanged lines hidden (view full) ---

226 struct ctl_page_index *page_index,
227 int pc);
228typedef int ctl_modesel_handler(struct ctl_scsiio *ctsio,
229 struct ctl_page_index *page_index,
230 uint8_t *page_ptr);
231
232typedef enum {
233 CTL_PAGE_FLAG_NONE = 0x00,
154} ctl_lun_flags;
155
156typedef enum {
157 CTLBLOCK_FLAG_NONE = 0x00,
158 CTLBLOCK_FLAG_INVALID = 0x01
159} ctlblock_flags;
160
161union ctl_softcs {

--- 67 unchanged lines hidden (view full) ---

229 struct ctl_page_index *page_index,
230 int pc);
231typedef int ctl_modesel_handler(struct ctl_scsiio *ctsio,
232 struct ctl_page_index *page_index,
233 uint8_t *page_ptr);
234
235typedef enum {
236 CTL_PAGE_FLAG_NONE = 0x00,
234 CTL_PAGE_FLAG_DISK_ONLY = 0x01
237 CTL_PAGE_FLAG_DIRECT = 0x01,
238 CTL_PAGE_FLAG_PROC = 0x02,
239 CTL_PAGE_FLAG_CDROM = 0x04,
240 CTL_PAGE_FLAG_ALL = 0x07
235} ctl_page_flags;
236
237struct ctl_page_index {
238 uint8_t page_code;
239 uint8_t subpage;
240 uint16_t page_len;
241 uint8_t *page_data;
242 ctl_page_flags page_flags;

--- 14 unchanged lines hidden (view full) ---

257
258struct ctl_logical_block_provisioning_page {
259 struct scsi_logical_block_provisioning_page main;
260 struct scsi_logical_block_provisioning_page_descr descr[CTL_NUM_LBP_THRESH];
261};
262
263static const struct ctl_page_index page_index_template[] = {
264 {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL,
241} ctl_page_flags;
242
243struct ctl_page_index {
244 uint8_t page_code;
245 uint8_t subpage;
246 uint16_t page_len;
247 uint8_t *page_data;
248 ctl_page_flags page_flags;

--- 14 unchanged lines hidden (view full) ---

263
264struct ctl_logical_block_provisioning_page {
265 struct scsi_logical_block_provisioning_page main;
266 struct scsi_logical_block_provisioning_page_descr descr[CTL_NUM_LBP_THRESH];
267};
268
269static const struct ctl_page_index page_index_template[] = {
270 {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL,
265 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
271 CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM, NULL, NULL},
266 {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL,
272 {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL,
267 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
273 CTL_PAGE_FLAG_DIRECT, NULL, NULL},
268 {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL,
274 {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL,
269 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
275 CTL_PAGE_FLAG_DIRECT, NULL, NULL},
270 {SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL,
276 {SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL,
271 CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler},
277 CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM,
278 NULL, ctl_caching_sp_handler},
272 {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL,
279 {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL,
273 CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler},
280 CTL_PAGE_FLAG_ALL, NULL, ctl_control_page_handler},
274 {SMS_CONTROL_MODE_PAGE | SMPH_SPF, 0x01,
275 sizeof(struct scsi_control_ext_page), NULL,
281 {SMS_CONTROL_MODE_PAGE | SMPH_SPF, 0x01,
282 sizeof(struct scsi_control_ext_page), NULL,
276 CTL_PAGE_FLAG_NONE, NULL, NULL},
283 CTL_PAGE_FLAG_ALL, NULL, NULL},
277 {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL,
284 {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL,
278 CTL_PAGE_FLAG_NONE, NULL, NULL},
285 CTL_PAGE_FLAG_ALL, NULL, NULL},
279 {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02,
280 sizeof(struct ctl_logical_block_provisioning_page), NULL,
286 {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02,
287 sizeof(struct ctl_logical_block_provisioning_page), NULL,
281 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
288 CTL_PAGE_FLAG_DIRECT, NULL, NULL},
282 {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE,
289 {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE,
283 sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE,
290 sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_ALL,
284 ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler},
285};
286
287#define CTL_NUM_MODE_PAGES sizeof(page_index_template)/ \
288 sizeof(page_index_template[0])
289
290struct ctl_mode_pages {
291 struct scsi_da_rw_recovery_page rw_er_page[4];

--- 5 unchanged lines hidden (view full) ---

297 struct scsi_info_exceptions_page ie_page[4];
298 struct ctl_logical_block_provisioning_page lbp_page[4];
299 struct copan_debugconf_subpage debugconf_subpage[4];
300 struct ctl_page_index index[CTL_NUM_MODE_PAGES];
301};
302
303static const struct ctl_page_index log_page_index_template[] = {
304 {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL,
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];

--- 5 unchanged lines hidden (view full) ---

304 struct scsi_info_exceptions_page ie_page[4];
305 struct ctl_logical_block_provisioning_page lbp_page[4];
306 struct copan_debugconf_subpage debugconf_subpage[4];
307 struct ctl_page_index index[CTL_NUM_MODE_PAGES];
308};
309
310static const struct ctl_page_index log_page_index_template[] = {
311 {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL,
305 CTL_PAGE_FLAG_NONE, NULL, NULL},
312 CTL_PAGE_FLAG_ALL, NULL, NULL},
306 {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL,
313 {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL,
307 CTL_PAGE_FLAG_NONE, NULL, NULL},
314 CTL_PAGE_FLAG_ALL, NULL, NULL},
308 {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL,
315 {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL,
309 CTL_PAGE_FLAG_DISK_ONLY, ctl_lbp_log_sense_handler, NULL},
316 CTL_PAGE_FLAG_DIRECT, ctl_lbp_log_sense_handler, NULL},
310 {SLS_STAT_AND_PERF, 0, 0, NULL,
317 {SLS_STAT_AND_PERF, 0, 0, NULL,
311 CTL_PAGE_FLAG_NONE, ctl_sap_log_sense_handler, NULL},
318 CTL_PAGE_FLAG_ALL, ctl_sap_log_sense_handler, NULL},
312};
313
314#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \
315 sizeof(log_page_index_template[0])
316
317struct ctl_log_pages {
318 uint8_t pages_page[CTL_NUM_LOG_PAGES];
319 uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2];

--- 134 unchanged lines hidden (view full) ---

454uint32_t ctl_lun_map_from_port(struct ctl_port *port, uint32_t plun);
455uint32_t ctl_lun_map_to_port(struct ctl_port *port, uint32_t glun);
456int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name,
457 uint32_t total_ctl_io, void **npool);
458void ctl_pool_free(struct ctl_io_pool *pool);
459int ctl_scsi_release(struct ctl_scsiio *ctsio);
460int ctl_scsi_reserve(struct ctl_scsiio *ctsio);
461int ctl_start_stop(struct ctl_scsiio *ctsio);
319};
320
321#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \
322 sizeof(log_page_index_template[0])
323
324struct ctl_log_pages {
325 uint8_t pages_page[CTL_NUM_LOG_PAGES];
326 uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2];

--- 134 unchanged lines hidden (view full) ---

461uint32_t ctl_lun_map_from_port(struct ctl_port *port, uint32_t plun);
462uint32_t ctl_lun_map_to_port(struct ctl_port *port, uint32_t glun);
463int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name,
464 uint32_t total_ctl_io, void **npool);
465void ctl_pool_free(struct ctl_io_pool *pool);
466int ctl_scsi_release(struct ctl_scsiio *ctsio);
467int ctl_scsi_reserve(struct ctl_scsiio *ctsio);
468int ctl_start_stop(struct ctl_scsiio *ctsio);
469int ctl_prevent_allow(struct ctl_scsiio *ctsio);
462int ctl_sync_cache(struct ctl_scsiio *ctsio);
463int ctl_format(struct ctl_scsiio *ctsio);
464int ctl_read_buffer(struct ctl_scsiio *ctsio);
465int ctl_write_buffer(struct ctl_scsiio *ctsio);
466int ctl_write_same(struct ctl_scsiio *ctsio);
467int ctl_unmap(struct ctl_scsiio *ctsio);
468int ctl_mode_select(struct ctl_scsiio *ctsio);
469int ctl_mode_sense(struct ctl_scsiio *ctsio);
470int ctl_log_sense(struct ctl_scsiio *ctsio);
471int ctl_read_capacity(struct ctl_scsiio *ctsio);
472int ctl_read_capacity_16(struct ctl_scsiio *ctsio);
473int ctl_read_defect(struct ctl_scsiio *ctsio);
470int ctl_sync_cache(struct ctl_scsiio *ctsio);
471int ctl_format(struct ctl_scsiio *ctsio);
472int ctl_read_buffer(struct ctl_scsiio *ctsio);
473int ctl_write_buffer(struct ctl_scsiio *ctsio);
474int ctl_write_same(struct ctl_scsiio *ctsio);
475int ctl_unmap(struct ctl_scsiio *ctsio);
476int ctl_mode_select(struct ctl_scsiio *ctsio);
477int ctl_mode_sense(struct ctl_scsiio *ctsio);
478int ctl_log_sense(struct ctl_scsiio *ctsio);
479int ctl_read_capacity(struct ctl_scsiio *ctsio);
480int ctl_read_capacity_16(struct ctl_scsiio *ctsio);
481int ctl_read_defect(struct ctl_scsiio *ctsio);
482int ctl_read_toc(struct ctl_scsiio *ctsio);
474int ctl_read_write(struct ctl_scsiio *ctsio);
475int ctl_cnw(struct ctl_scsiio *ctsio);
476int ctl_report_luns(struct ctl_scsiio *ctsio);
477int ctl_request_sense(struct ctl_scsiio *ctsio);
478int ctl_tur(struct ctl_scsiio *ctsio);
479int ctl_verify(struct ctl_scsiio *ctsio);
480int ctl_inquiry(struct ctl_scsiio *ctsio);
483int ctl_read_write(struct ctl_scsiio *ctsio);
484int ctl_cnw(struct ctl_scsiio *ctsio);
485int ctl_report_luns(struct ctl_scsiio *ctsio);
486int ctl_request_sense(struct ctl_scsiio *ctsio);
487int ctl_tur(struct ctl_scsiio *ctsio);
488int ctl_verify(struct ctl_scsiio *ctsio);
489int ctl_inquiry(struct ctl_scsiio *ctsio);
490int ctl_get_config(struct ctl_scsiio *ctsio);
491int ctl_get_event_status(struct ctl_scsiio *ctsio);
492int ctl_mechanism_status(struct ctl_scsiio *ctsio);
481int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio);
482int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio);
483int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio);
484int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio);
485int ctl_report_supported_tmf(struct ctl_scsiio *ctsio);
486int ctl_report_timestamp(struct ctl_scsiio *ctsio);
487int ctl_get_lba_status(struct ctl_scsiio *ctsio);
488

--- 24 unchanged lines hidden ---
493int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio);
494int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio);
495int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio);
496int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio);
497int ctl_report_supported_tmf(struct ctl_scsiio *ctsio);
498int ctl_report_timestamp(struct ctl_scsiio *ctsio);
499int ctl_get_lba_status(struct ctl_scsiio *ctsio);
500

--- 24 unchanged lines hidden ---