diff options
Diffstat (limited to 'sys/cam/ctl/ctl_private.h')
-rw-r--r-- | sys/cam/ctl/ctl_private.h | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 03b9787..ad5fbcd 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -45,6 +45,7 @@ #define CTL_VENDOR "FREEBSD " #define CTL_DIRECT_PRODUCT "CTLDISK " #define CTL_PROCESSOR_PRODUCT "CTLPROCESSOR " +#define CTL_CDROM_PRODUCT "CTLCDROM " #define CTL_UNKNOWN_PRODUCT "CTLDEVICE " #define CTL_POOL_ENTRIES_OTHER_SC 200 @@ -90,15 +91,16 @@ typedef enum { CTL_CMD_FLAG_ALLOW_ON_RESV = 0x0040, CTL_CMD_FLAG_ALLOW_ON_PR_WRESV = 0x0080, CTL_CMD_FLAG_OK_ON_PROC = 0x0100, - CTL_CMD_FLAG_OK_ON_SLUN = 0x0200, - CTL_CMD_FLAG_OK_ON_BOTH = 0x0300, - CTL_CMD_FLAG_OK_ON_STOPPED = 0x0400, + CTL_CMD_FLAG_OK_ON_DIRECT = 0x0200, + CTL_CMD_FLAG_OK_ON_CDROM = 0x0400, + CTL_CMD_FLAG_OK_ON_BOTH = 0x0700, CTL_CMD_FLAG_OK_ON_INOPERABLE = 0x0800, CTL_CMD_FLAG_OK_ON_STANDBY = 0x1000, CTL_CMD_FLAG_OK_ON_UNAVAIL = 0x2000, CTL_CMD_FLAG_ALLOW_ON_PR_RESV = 0x4000, CTL_CMD_FLAG_SA5 = 0x8000, - CTL_CMD_FLAG_RUN_HERE = 0x10000 + CTL_CMD_FLAG_RUN_HERE = 0x10000, + CTL_CMD_FLAG_OK_ON_STOPPED = 0x20000 } ctl_cmd_flags; typedef enum { @@ -147,7 +149,8 @@ typedef enum { CTL_LUN_PRIMARY_SC = 0x200, CTL_LUN_SENSE_DESC = 0x400, CTL_LUN_READONLY = 0x800, - CTL_LUN_PEER_SC_PRIMARY = 0x1000 + CTL_LUN_PEER_SC_PRIMARY = 0x1000, + CTL_LUN_REMOVABLE = 0x2000 } ctl_lun_flags; typedef enum { @@ -231,7 +234,10 @@ typedef int ctl_modesel_handler(struct ctl_scsiio *ctsio, typedef enum { CTL_PAGE_FLAG_NONE = 0x00, - CTL_PAGE_FLAG_DISK_ONLY = 0x01 + CTL_PAGE_FLAG_DIRECT = 0x01, + CTL_PAGE_FLAG_PROC = 0x02, + CTL_PAGE_FLAG_CDROM = 0x04, + CTL_PAGE_FLAG_ALL = 0x07 } ctl_page_flags; struct ctl_page_index { @@ -262,25 +268,26 @@ struct ctl_logical_block_provisioning_page { static const struct ctl_page_index page_index_template[] = { {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL, - CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, + CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM, NULL, NULL}, {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL, - CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, + CTL_PAGE_FLAG_DIRECT, NULL, NULL}, {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL, - CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, + CTL_PAGE_FLAG_DIRECT, NULL, NULL}, {SMS_CACHING_PAGE, 0, sizeof(struct scsi_caching_page), NULL, - CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler}, + CTL_PAGE_FLAG_DIRECT | CTL_PAGE_FLAG_CDROM, + NULL, ctl_caching_sp_handler}, {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL, - CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler}, + CTL_PAGE_FLAG_ALL, NULL, ctl_control_page_handler}, {SMS_CONTROL_MODE_PAGE | SMPH_SPF, 0x01, sizeof(struct scsi_control_ext_page), NULL, - CTL_PAGE_FLAG_NONE, NULL, NULL}, + CTL_PAGE_FLAG_ALL, NULL, NULL}, {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL, - CTL_PAGE_FLAG_NONE, NULL, NULL}, + CTL_PAGE_FLAG_ALL, NULL, NULL}, {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, sizeof(struct ctl_logical_block_provisioning_page), NULL, - CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, + CTL_PAGE_FLAG_DIRECT, NULL, NULL}, {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE, - sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE, + sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_ALL, ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler}, }; @@ -302,13 +309,13 @@ struct ctl_mode_pages { static const struct ctl_page_index log_page_index_template[] = { {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL, - CTL_PAGE_FLAG_NONE, NULL, NULL}, + CTL_PAGE_FLAG_ALL, NULL, NULL}, {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, - CTL_PAGE_FLAG_NONE, NULL, NULL}, + CTL_PAGE_FLAG_ALL, NULL, NULL}, {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL, - CTL_PAGE_FLAG_DISK_ONLY, ctl_lbp_log_sense_handler, NULL}, + CTL_PAGE_FLAG_DIRECT, ctl_lbp_log_sense_handler, NULL}, {SLS_STAT_AND_PERF, 0, 0, NULL, - CTL_PAGE_FLAG_NONE, ctl_sap_log_sense_handler, NULL}, + CTL_PAGE_FLAG_ALL, ctl_sap_log_sense_handler, NULL}, }; #define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ @@ -459,6 +466,7 @@ void ctl_pool_free(struct ctl_io_pool *pool); int ctl_scsi_release(struct ctl_scsiio *ctsio); int ctl_scsi_reserve(struct ctl_scsiio *ctsio); int ctl_start_stop(struct ctl_scsiio *ctsio); +int ctl_prevent_allow(struct ctl_scsiio *ctsio); int ctl_sync_cache(struct ctl_scsiio *ctsio); int ctl_format(struct ctl_scsiio *ctsio); int ctl_read_buffer(struct ctl_scsiio *ctsio); @@ -471,6 +479,7 @@ int ctl_log_sense(struct ctl_scsiio *ctsio); int ctl_read_capacity(struct ctl_scsiio *ctsio); int ctl_read_capacity_16(struct ctl_scsiio *ctsio); int ctl_read_defect(struct ctl_scsiio *ctsio); +int ctl_read_toc(struct ctl_scsiio *ctsio); int ctl_read_write(struct ctl_scsiio *ctsio); int ctl_cnw(struct ctl_scsiio *ctsio); int ctl_report_luns(struct ctl_scsiio *ctsio); @@ -478,6 +487,9 @@ int ctl_request_sense(struct ctl_scsiio *ctsio); int ctl_tur(struct ctl_scsiio *ctsio); int ctl_verify(struct ctl_scsiio *ctsio); int ctl_inquiry(struct ctl_scsiio *ctsio); +int ctl_get_config(struct ctl_scsiio *ctsio); +int ctl_get_event_status(struct ctl_scsiio *ctsio); +int ctl_mechanism_status(struct ctl_scsiio *ctsio); int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio); int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio); int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio); |