/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SPC3_TYPES_H
#define _SPC3_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/sysmacros.h>
typedef enum spc3_cmd {
/* Not defined by SPC-3 */
} spc3_cmd_t;
typedef enum spc3_dev_type {
/*
* SAM-4 5.3.1, Table 25
*/
typedef enum sam4_status {
#pragma pack(1)
typedef union spc3_control {
struct {
c_link :1,
c_flag :1,
c_naca :1,
_reserved1 :3,
c_vs_6 :2);
} c_bits;
/*
* SPC-3 6.2.1 CHANGE ALIASES
*/
typedef struct spc3_change_aliases_cdb {
_reserved1 :3);
typedef struct spc3_alias_entry {
typedef struct spc3_change_aliases_param_list {
/*
* SPC-3 6.4.1 INQUIRY
*/
typedef struct spc3_inquiry_cdb {
ic_evpd :1,
_reserved1 :7);
typedef struct spc3_inquiry_data {
_reserved1 :7,
id_rmb :1);
id_hisup :1,
id_naca :1,
_reserved2 :2);
id_protect :1,
_reserved3 :2,
id_3pc :1,
id_tpgs :2,
id_acc :1,
id_sccs :1);
id_addr16 :1,
_reserved4 :2,
id_mchanger :1,
id_multip :1,
id_vs_6_5 :1,
id_enc_serv :1,
id_b_que :1);
id_vs_7_0 :1,
id_cmd_que :1,
_reserved5 :1,
id_linked :1,
id_sync :1,
id_wbus16 :1,
_reserved6 :2);
id_ius :1,
id_qas :1,
id_clocking :2,
_reserved7 :4);
/*
* SPC-3 6.5 LOG SELECT
*/
typedef enum spc3_log_page_control {
typedef struct spc3_log_select_cdb {
lsc_sp :1,
lsc_pcr :1,
_reserved1 :6);
_reserved2 :6,
lsc_pc :2);
/*
* SPC-3 6.6 LOG SENSE
*/
typedef struct spc3_log_sense_cdb {
lsc_sp :1,
lsc_ppc :1,
_reserved1 :6);
lsc_page_code :6,
lsc_pc :2);
typedef enum spc3_mode_page_control {
SPC3_MODE_PC_CURRENT = 0,
typedef struct spc3_mode_param_header6 {
typedef struct spc3_mode_param_header10 {
mph_longlba :1,
_reserved1 :7);
typedef struct spc3_mode_param_block_descriptor {
typedef struct spc3_mode_page_0 {
mp0_page_code :6,
mp0_spf :1,
mp0_ps :1);
typedef struct spc3_mode_subpage {
ms_page_code :6,
ms_spf :1,
ms_ps :1);
/*
* SPC-3 7.4.6 Table 246 - TST field
*/
typedef enum spc3_mode_task_set {
SPC3_MODE_TST_ONE = 0,
/*
* SPC-3 7.4.6 Table 247 - Queue Algorithm Modifier field
*/
typedef enum spc3_mode_queue_alg_mod {
/*
* SPC-3 7.4.6 Table 245
*/
typedef struct spc3_mode_params_control {
mpc_rlec :1,
mpc_gltsd :1,
mpc_d_sense :1,
_reserved1 :1,
mpc_tmf_only :1,
mpc_tst :3);
_reserved2 :1,
mpc_q_err :1,
_reserved3 :1,
mpc_queue_alg_mod :4);
_reserved4 :3,
mpc_swp :1,
mpc_rac :1,
mpc_vs_4_7 :1);
_reserved5 :3,
mpc_tas :1,
mpc_ato :1);
/*
* SPC-3 7.4.7 Control Extension mode page
*/
typedef struct spc3_mode_params_control_ext {
mpce_ialuae :1,
mpce_scsip :1,
mpce_tcmos :1,
_reserved1 :5);
_reserved2 :4);
/*
* SPC-3 7.4.8 Disconnect-Reconnect mode page
*/
typedef struct spc3_mode_params_dc_rc {
mpdr_dtdc :3,
mpdr_di_mm :1,
mpdr_emdp :1);
typedef enum spc3_mode_mrie {
SPC3_MODE_MRIE_NONE = 0,
/*
* SPC-3 7.4.11 Informational Exceptions Control mode page
*/
typedef struct spc3_mode_params_iec {
mpi_log_err :1,
_reserved1 :1,
mpi_test :1,
mpi_d_excpt :1,
mpi_e_wasc :1,
mpi_ebf :1,
_reserved2 :1,
mpi_perf :1);
mpi_mrie :4,
_reserved3 :4);
/*
* SPC-3 7.4.12 Power Condition mode page
*/
typedef struct spc3_mode_params_pc {
mpp_standby :1,
mpp_idle :1,
_reserved2 :6);
/*
* SPC-3 6.7 MODE SELECT(6)
*/
typedef struct spc3_mode_select6_cdb {
msc_sp :1,
_reserved1 :3,
msc_pf :1,
_reserved2 :3);
/*
* SPC-3 6.8 MODE SELECT(10)
*/
typedef struct spc3_mode_select10_cdb {
msc_sp :1,
_reserved1 :3,
msc_pf :1,
_reserved2 :3);
/*
* SPC-3 6.9 MODE SENSE(6)
*/
typedef struct spc3_mode_sense6_cdb {
_reserved1 :3,
msc_dbd :1,
_reserved2 :4);
msc_page_code :6,
msc_pc :2);
/*
* SPC-3 6.10 MODE SENSE(10)
*/
typedef struct spc3_mode_sense10_cdb {
_reserved1 :3,
msc_dbd :1,
msc_llbaa :1,
_reserved2 :3);
msc_page_code :6,
msc_pc :2);
/*
* SPC-3 6.11 PERSISTENT RESERVE IN
*/
typedef enum spc3_persistent_reserve_in_sac {
typedef struct spc3_persistent_reserve_in_param_rk {
typedef enum spc3_persistent_reserve_type {
typedef struct spc3_persistent_reserve_in_param_rr {
pripr_type :4,
pripr_scope :4);
typedef struct spc3_persistent_reserve_in_param_rc {
pripr_ptpl_c :1,
_reserved1 :1,
pripr_atp_c :1,
pripr_sip_c :1,
pripr_crh :1,
_reserved2 :3);
pripr_ptpl_a :1,
_reserved3 :6,
pripr_tmv :1);
_reserved4 :1,
pripr_wr_ex :1,
_reserved5 :1,
pripr_ex_ac :1,
_reserved6 :1,
pripr_wr_ex_ro :1,
pripr_ex_ac_ro :1,
pripr_wr_ex_ar :1);
pripr_ex_ac_ar :1,
_reserved7 :7);
typedef struct spc3_persistent_reserve_full_status {
prfs_r_holder :1,
prfs_all_tg_pt :1,
_reserved2 :6);
prfs_type :4,
prfs_scope :4);
typedef struct spc3_persistent_reserve_in_param_rfs {
typedef struct spc3_persistent_reserve_in_cdb {
_reserved1 :3);
/*
* SPC-3 6.16 READ MEDIA SERIAL NUMBER
*/
typedef struct spc3_read_media_serial_number_cdb {
_reserved1 :3);
typedef struct spc3_read_media_serial_number_data {
/*
* SPC-3 6.18 RECEIVE DIAGNOSTIC RESULTS
*/
typedef struct spc3_receive_diagnostic_results_cdb {
rdrc_pcv :1,
_reserved1 :7);
/*
* SPC-3 Diagnostic page format (Table 194, 7.1.1)
*/
typedef struct spc3_diag_page_impl {
/*
* SPC-3 Supported diagnostic pages (Table 196, 7.1.2)
*/
typedef struct spc3_supported_diag_page_impl {
/*
* SPC-3 6.21 REPORT LUNS
*/
typedef enum spc3_report_luns_select_report {
typedef struct spc3_report_luns_cdb {
typedef struct spc3_report_luns_data {
/*
* SPC-3 6.27 REQUEST SENSE
*/
typedef struct spc3_request_sense_cdb {
rsc_desc :1,
_reserved1 :7);
/*
* SPC-3 6.28 SEND DIAGNOSTIC
*/
typedef struct spc3_send_diagnostic_cdb {
sdc_unit_off_l :1,
sdc_dev_off_l :1,
sdc_self_test :1,
_reserved1 :1,
sdc_pf :1,
sdc_selftest_code :3);
/*
* SPC-3 6.33 TEST UNIT READY
*/
typedef struct spc3_test_unit_ready_cdb {
/*
* SPC-3 6.36 WRITE BUFFER
*/
typedef struct spc3_write_buffer_cdb {
wbc_mode :5,
_reserved :3);
typedef enum spc3_write_buffer_mode {
typedef struct spc3_write_buffer_log {
_reserved3 :4,
wbl_codeset :4);
typedef enum sp3_write_buffer_error_type {
typedef enum spc3_write_buffer_codeset {
typedef enum spc_3_write_buffer_error_location {
/*
* SPC-4 7.5.1 Protocol values
*/
typedef enum spc4_protocol_id {
/*
* SPC-3 NAA identifier format (Table 305, 7.6.3.6.1)
*/
typedef struct spc3_naa_id_impl {
snii_priv_msn :4,
snii_naa :4);
/*
* SPC-3 NAA IEEE Extended Identifier field format (Table 307, 7.6.3.6.2)
*/
typedef struct spc3_naa_ieee_ext_id_impl {
snieii_naa :4);
/*
* Ibid, Table 308
*/
typedef struct spc3_naa_ieee_reg_id_impl {
snirii_naa :4);
/*
* Ibid, Table 309
*/
typedef struct spc3_naa_ieee_reg_ext_id_impl {
snireii_naa :4);
typedef union spc3_naa_id_8_impl {
struct {
_reserved1 :4,
sni8i_naa :4);
} sni8i_hdr;
typedef enum naa_id {
} naa_id_t;
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif /* _SPC3_TYPES_H */