t10_ssc.h revision 36c5fee33fa8b822175d410202aebcf592c8d342
/*
* 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
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _T10_SSC_H
#define _T10_SSC_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Implementation specific headers for SCSI Streaming Commands (Tapes)
*/
#ifdef __cplusplus
extern "C" {
#endif
#define SSC_READ_POS_SHORT_FORM 0x00
#define SSC_READ_POS_LONG_FORM 0x06
#define SSC_OBJ_SIG 0x22005454
#define SSC_OBJ_TYPE_FM 1
#define SSC_OBJ_TYPE_RM 2
#define SSC_REWIND_IMMED 0x01
/*
* SSC-3, revision 01c, section 7.2
*/
#define SSC_LOAD_CMD_LOAD 0x01
#define SSC_LOAD_CMD_RETEN 0x02
#define SSC_LOAD_CMD_EOT 0x04
#define SSC_LOAD_CMD_HOLD 0x08
/* ---- bit 0 of byte 1 ---- */
#define SSC_LOAD_CMD_IMMED 0x01
/*
* On disk file and record mark object structure.
*/
typedef struct ssc_obj_mark {
union {
struct {
eom;
} _fm_;
struct {
/*
* SSC-3 Revision 1c, Section 3.1.40
* Object Identifier relative to beginning of
* partition.
*/
} _rm_;
} _u_;
/*
* In core structure which indicates current file-mark and record-mark
*/
typedef struct ssc_params {
s_cur_fm; /* starts at 0 */
} ssc_params_t;
/*
* During asynchronous I/O there are a few things needed to complete
* the operation.
*/
typedef struct ssc_io {
/*
* Look at SBC for the reason that this member must be first
*/
char *sio_data;
} ssc_io_t;
/*
* READ POSITION data format, short form
*/
typedef struct pos_short_form {
#if defined(_BIT_FIELDS_LTOH)
perr : 1,
lolu : 1,
rsvd1 : 1,
bycu : 1,
locu : 1,
eop : 1,
bop : 1;
#elif defined(_BIT_FIELDS_HTOL)
eop : 1,
locu : 1,
bycu : 1,
rsvd1 : 1,
lolu : 1,
perr : 1,
rsvd2 : 1;
#else
#endif
rsvd3[2],
first_obj[4],
last_obj[4],
objs_in_buf[3],
bytes_in_buf[4];
/*
* REPORT DENSITY SUPPORT header
*/
typedef struct ssc_density_header {
rsvd;
typedef struct ssc_density {
#if defined(_BIT_FIELDS_LTOH)
d_rsvd : 4,
d_deflt : 1,
d_dup : 1,
d_wrtok : 1;
#elif defined(_BIT_FIELDS_HTOL)
d_dup : 1,
d_deflt : 1,
d_rsvd : 4,
d_dlv : 1;
#else
#endif
d_bpm[3],
d_width[2],
d_tracks[2],
d_capacity[4],
d_organization[8],
d_name[8],
d_description[20];
typedef struct ssc_density_media {
d_len[2],
d_codes[9],
d_width[2],
d_medium_len[2],
d_rsvd2[2],
d_organization[8],
d_medium_name[8],
d_description[20];
/*
* MODE_SENSE/MODE_SELECT, Page Code 0xf
* Data Compression
*/
typedef struct ssc_data_compression {
#if defined(_BIT_FIELDS_LTOH)
c_dcc : 1,
c_dce : 1;
c_red : 2,
c_dde : 1;
#elif defined(_BIT_FIELDS_HTOL)
c_dcc : 1,
c_rsvd1 : 6;
c_red : 2,
c_rsvd2 : 5;
#else
#endif
c_rsvd3[4];
/*
* MODE_SENSE/MODE_SELECT, Page Code 0x10
* Device Configuration
*/
typedef struct ssc_device_config {
#if defined(_BIT_FIELDS_LTOH)
caf : 1,
obsolete1 : 1,
rsvd : 1;
wr_delay_time[2];
robo : 1,
socf : 2,
avc : 1,
obsolete2 : 1,
lois : 1,
obr : 1;
baml : 1,
swp : 1,
sew : 1,
eeg : 1,
eod_defined : 3;
perswp : 1,
asocwp : 1,
rewind_on_reset : 2,
oir : 1,
wtre : 2;
#elif defined(_BIT_FIELDS_HTOL)
obsolete1 : 1,
caf : 1,
active_format : 5;
wr_delay_time[2];
lois : 1,
obsolete2 : 1,
avc : 1,
socf : 2,
robo : 1,
rew : 1;
eeg : 1,
sew : 1,
swp : 1,
baml : 1,
bam : 1;
oir : 1,
rewind_on_reset : 2,
asocwp : 1,
perswp : 1,
prmwp : 1;
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _T10_SSC_H */