ctl_private.h (273730) | ctl_private.h (274154) |
---|---|
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 273730 2014-10-27 09:26:24Z mav $ | 31 * $FreeBSD: head/sys/cam/ctl/ctl_private.h 274154 2014-11-06 00:48:36Z 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_ --- 257 unchanged lines hidden (view full) --- 297 ctl_modesel_handler *select_handler; 298}; 299 300#define CTL_PAGE_CURRENT 0x00 301#define CTL_PAGE_CHANGEABLE 0x01 302#define CTL_PAGE_DEFAULT 0x02 303#define CTL_PAGE_SAVED 0x03 304 | 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_ --- 257 unchanged lines hidden (view full) --- 297 ctl_modesel_handler *select_handler; 298}; 299 300#define CTL_PAGE_CURRENT 0x00 301#define CTL_PAGE_CHANGEABLE 0x01 302#define CTL_PAGE_DEFAULT 0x02 303#define CTL_PAGE_SAVED 0x03 304 |
305#define CTL_NUM_LBP_PARAMS 4 306#define CTL_NUM_LBP_THRESH 4 307#define CTL_LBP_EXPONENT 11 /* 2048 sectors */ 308#define CTL_LBP_PERIOD 10 /* 10 seconds */ 309#define CTL_LBP_UA_PERIOD 300 /* 5 minutes */ 310 311struct ctl_logical_block_provisioning_page { 312 struct scsi_logical_block_provisioning_page main; 313 struct scsi_logical_block_provisioning_page_descr descr[CTL_NUM_LBP_THRESH]; 314}; 315 |
|
305static const struct ctl_page_index page_index_template[] = { 306 {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL, 307 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 308 {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL, 309 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 310 {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL, 311 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 312 {SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL, 313 CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler}, 314 {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL, 315 CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler}, 316 {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL, 317 CTL_PAGE_FLAG_NONE, NULL, NULL}, 318 {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, | 316static const struct ctl_page_index page_index_template[] = { 317 {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL, 318 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 319 {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL, 320 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 321 {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL, 322 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 323 {SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL, 324 CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler}, 325 {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL, 326 CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler}, 327 {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL, 328 CTL_PAGE_FLAG_NONE, NULL, NULL}, 329 {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, |
319 sizeof(struct scsi_logical_block_provisioning_page), NULL, | 330 sizeof(struct ctl_logical_block_provisioning_page), NULL, |
320 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 321 {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE, 322 sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE, 323 ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler}, 324}; 325 326#define CTL_NUM_MODE_PAGES sizeof(page_index_template)/ \ 327 sizeof(page_index_template[0]) 328 329struct ctl_mode_pages { 330 struct scsi_da_rw_recovery_page rw_er_page[4]; 331 struct scsi_format_page format_page[4]; 332 struct scsi_rigid_disk_page rigid_disk_page[4]; 333 struct scsi_caching_page caching_page[4]; 334 struct scsi_control_page control_page[4]; 335 struct scsi_info_exceptions_page ie_page[4]; | 331 CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, 332 {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE, 333 sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE, 334 ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler}, 335}; 336 337#define CTL_NUM_MODE_PAGES sizeof(page_index_template)/ \ 338 sizeof(page_index_template[0]) 339 340struct ctl_mode_pages { 341 struct scsi_da_rw_recovery_page rw_er_page[4]; 342 struct scsi_format_page format_page[4]; 343 struct scsi_rigid_disk_page rigid_disk_page[4]; 344 struct scsi_caching_page caching_page[4]; 345 struct scsi_control_page control_page[4]; 346 struct scsi_info_exceptions_page ie_page[4]; |
336 struct scsi_logical_block_provisioning_page lbp_page[4]; | 347 struct ctl_logical_block_provisioning_page lbp_page[4]; |
337 struct copan_debugconf_subpage debugconf_subpage[4]; 338 struct ctl_page_index index[CTL_NUM_MODE_PAGES]; 339}; 340 341static const struct ctl_page_index log_page_index_template[] = { 342 {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL, 343 CTL_PAGE_FLAG_NONE, NULL, NULL}, 344 {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, 345 CTL_PAGE_FLAG_NONE, NULL, NULL}, | 348 struct copan_debugconf_subpage debugconf_subpage[4]; 349 struct ctl_page_index index[CTL_NUM_MODE_PAGES]; 350}; 351 352static const struct ctl_page_index log_page_index_template[] = { 353 {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL, 354 CTL_PAGE_FLAG_NONE, NULL, NULL}, 355 {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, 356 CTL_PAGE_FLAG_NONE, NULL, NULL}, |
357 {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL, 358 CTL_PAGE_FLAG_NONE, ctl_lbp_log_sense_handler, NULL}, |
|
346}; 347 348#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ 349 sizeof(log_page_index_template[0]) 350 351struct ctl_log_pages { 352 uint8_t pages_page[CTL_NUM_LOG_PAGES]; 353 uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2]; | 359}; 360 361#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ 362 sizeof(log_page_index_template[0]) 363 364struct ctl_log_pages { 365 uint8_t pages_page[CTL_NUM_LOG_PAGES]; 366 uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2]; |
367 uint8_t lbp_page[12*CTL_NUM_LBP_PARAMS]; |
|
354 struct ctl_page_index index[CTL_NUM_LOG_PAGES]; 355}; 356 357struct ctl_lun_delay_info { 358 ctl_delay_type datamove_type; 359 uint32_t datamove_delay; 360 ctl_delay_type done_type; 361 uint32_t done_delay; --- 44 unchanged lines hidden (view full) --- 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_INITIATORS]; | 368 struct ctl_page_index index[CTL_NUM_LOG_PAGES]; 369}; 370 371struct ctl_lun_delay_info { 372 ctl_delay_type datamove_type; 373 uint32_t datamove_delay; 374 ctl_delay_type done_type; 375 uint32_t done_delay; --- 44 unchanged lines hidden (view full) --- 420 TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue; 421 STAILQ_ENTRY(ctl_lun) links; 422 STAILQ_ENTRY(ctl_lun) run_links; 423#ifdef CTL_WITH_CA 424 uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; 425 struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; 426#endif 427 ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; |
428 time_t lasttpt; |
|
414 struct ctl_mode_pages mode_pages; 415 struct ctl_log_pages log_pages; 416 struct ctl_lun_io_stats stats; 417 uint32_t res_idx; 418 unsigned int PRGeneration; 419 uint64_t pr_keys[2*CTL_MAX_INITIATORS]; 420 int pr_key_count; 421 uint32_t pr_res_idx; --- 127 unchanged lines hidden --- | 429 struct ctl_mode_pages mode_pages; 430 struct ctl_log_pages log_pages; 431 struct ctl_lun_io_stats stats; 432 uint32_t res_idx; 433 unsigned int PRGeneration; 434 uint64_t pr_keys[2*CTL_MAX_INITIATORS]; 435 int pr_key_count; 436 uint32_t pr_res_idx; --- 127 unchanged lines hidden --- |