/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SCSI_GENERIC_MODE_H
#define _SYS_SCSI_GENERIC_MODE_H
#ifdef __cplusplus
extern "C" {
#endif
/*
*
*
*/
/*
* Structures and defines common for all device types
*/
/*
*
* block descriptors, followed by zero or more mode pages.
*
*/
struct mode_header {
};
/*
*/
struct mode_header_g1 {
};
/*
* Block Descriptor. Zero, one, or more may normally follow the mode header.
*
* The density code is device specific.
*
* The 24-bit value described by blks_{hi, mid, lo} describes the number of
* blocks which this block descriptor applies to. A value of zero means
* 'the rest of the blocks on the device'.
*
* The 24-bit value described by blksize_{hi, mid, lo} describes the blocksize
* (in bytes) applicable for this block descriptor. For Sequential Access
* devices, if this value is zero, the block size will be derived from
* the transfer length in I/O operations.
*
*/
struct block_descriptor {
};
/*
* Define a macro to take an address of a mode header to the address
* of the nth (0..n) block_descriptor, or NULL if there either aren't any
* block descriptors or the nth block descriptor doesn't exist.
*/
((bdnum) * sizeof (struct block_descriptor)))) : \
((struct block_descriptor *)0)
/*
* Mode page header. Zero or more Mode Pages follow either the block
* descriptors (if any), or the Mode Header.
*
* The 'ps' bit must be zero for mode select operations.
*
*/
struct mode_page {
#if defined(_BIT_FIELDS_LTOH)
:1, /* reserved */
#elif defined(_BIT_FIELDS_HTOL)
:1, /* reserved */
#else
#endif /* _BIT_FIELDS_LTOH */
/*
* Mode Page specific data follows right after this...
*/
};
/*
* Define a macro to retrieve the first mode page. Could be more
* general (for multiple mode pages).
*/
/*
* Page codes follow the following specification:
*
* Code Value(s) What
* ----------------------------------------------------------------------
* 0x00 Vendor Unique (does not require page format)
*
* 0x02, 0x09, 0x0A pages for all Device Types
* 0x1A, 0x1C
*
* 0x01, 0x03-0x08, pages for specific Device Type
* 0x0B-0x19, 0x1B,
* 0x1D-0x1F
*
* 0x20-0x3E Vendor Unique (requires page format)
*
* 0x3F Return all pages (valid for Mode Sense only)
*
*/
/*
* Page codes and page length values (all device types)
*/
/*
*/
/*
* Disconnect/Reconnect Page
*/
struct mode_disco_reco {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
/*
* Target may not disconnect once
* data transfer is started until
* all data successfully transferred.
*/
/*
* Target may not disconnect once
* data transfer is started until
* command completed.
*/
/*
* Caching Page
*/
struct mode_caching {
#if defined(_BIT_FIELDS_LTOH)
: 5; /* Reserved */
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
/*
* Peripheral Device Page
*/
struct mode_pdevice {
};
/*
* Control Mode Page
*
* Note: This structure is incompatible with previous SCSI
* alternative form of this structure. They can be
* distinguished by the length of data returned
* from a MODE SENSE command.
*/
struct mode_control_scsi3 {
#if defined(_BIT_FIELDS_LTOH)
: 5;
: 2,
: 1,
/* allegiance (only pre-SCSI-3) */
#elif defined(_BIT_FIELDS_HTOL)
: 2,
/* allegiance (only pre-SCSI-3) */
: 1,
#else
#endif /* _BIT_FIELDS_LTOH */
};
#ifdef __lock_lint
#endif
/*
* Informational Exceptions Control Mode Page
*/
struct mode_info_excpt_page {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif
};
struct mode_info_power_cond {
#if defined(_BIT_FIELDS_LTOH)
:6; /* reserved */
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif
};
struct parameter_control {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif
};
struct start_stop_cycle_counter_log {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif
};
#ifdef __cplusplus
}
#endif
/*
* Include known generic device specific mode definitions and structures
*/
/*
* Include implementation specific mode information
*/
#endif /* _SYS_SCSI_GENERIC_MODE_H */