/*
* 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 2013 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SATA_DEFS_H
#define _SATA_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Common ATA commands (subset)
*/
/*
*/
/*
* Port Multiplier Commands
*/
/*
* Power Managment Commands (subset)
*/
/*
* SMART FEATURES Subcommands
*/
/*
* SET FEATURES Subcommands
*/
/*
* SET FEATURES transfer mode values
*/
/*
* Download microcode subcommands
*/
/* Generic ATA definitions */
/*
* Identify Device data
* Although both ATA and ATAPI devices' Identify Data have the same length,
* other type of device.
* Following is the ATA Device Identify data layout
*/
typedef struct sata_id {
/* WORD */
/* OFFSET COMMENT */
/* LBA range entries */
} sata_id_t;
/* Identify Device: general config bits - word 0 */
/* Identify Device: common capability bits - word 49 */
/* Identify Device: ai_validinfo (word 53) */
/* Identify Device: ai_addsupported (word 69) */
/* Identify Device: ai_majorversion (word 80) */
/* IDLE IMMEDIATE with UNLOAD FEATURE supported */
/* Identify Device: physical sector size - word 106 */
/* Identify (Packet) Device Word 88 */
/* All are SCT Command Transport support */
/* Identify Packet Device data definitions (ATAPI devices) */
/* Identify Packet Device: general config bits - word 0 */
/*
* Status bits from ATAPI Interrupt reason register (AT_COUNT) register
*/
/* ATAPI feature reg definitions */
/* ATAPI IDENTIFY_DRIVE capabilities word (49) */
/*
* ATAPI Identify Packet Device word 62
*/
/*
* ATAPI signature bits
*/
/* SATA Capabilites bits (word 76) */
/* SATA Features Supported (word 78) - not used */
/* SATA Features Enabled (word 79) - not used */
#define SATA_RM_NOTIFIC_SUPPORTED(x) \
((x).ai_cmdset83 & SATA_RM_STATUS_NOTIFIC)
#define SATA_RM_NOTIFIC_ENABLED(x) \
((x).ai_features86 & SATA_RM_STATUS_NOTIFIC)
/*
* Generic NCQ related defines
*/
/*
* Status bits from AT_STATUS register
*/
/*
* Status bits from AT_ERROR register
*/
/*
* Bits from the device control register
*/
/* device_reg */
/* ATAPI transport version-in Inquiry data */
/* Number of log entries per extended selftest log block */
/* Number of entries per SCSI LOG SENSE SELFTEST RESULTS page */
/* Length of a SCSI LOG SENSE SELFTEST RESULTS parameter */
#define READ_LOG_EXT_LOG_DIRECTORY 0
/*
* SATA NCQ error recovery page (0x10)
*/
struct sata_ncq_error_recovery_page {
};
/*
* SMART data structures
*/
struct smart_data {
};
struct smart_selftest_log_entry {
};
struct smart_selftest_log {
struct smart_selftest_log_entry
};
struct smart_ext_selftest_log_entry {
};
struct smart_ext_selftest_log {
};
struct read_log_ext_directory {
};
/*
* The definition of CONTROL byte field in SCSI command
* according to SAM 5
*/
/*
* The definition of mask in START STOP UNIT command
*/
/*
* SMART specific data
* These eventually need to go to a generic scsi header file
* for now they will reside here
*/
struct log_parameter {
};
/* param_ctrl_flag fields */
/*
* Acoustic management
*/
struct mode_acoustic_management {
};
#define P_CNTRL_CURRENT 0
#define ACOUSTIC_DISABLED 0
/*
* Port Multiplier registers' offsets
*/
/*
* Port Multiplier capabilities
* (Indicated by GSCR64, and enabled by GSCR96)
*/
/*
* sstatus field definitions
*/
#define SSTATUS_DET_SHIFT 0
/*
* sstatus DET values
*/
#define SSTATUS_GET_DET(x) \
(x & SSTATUS_DET)
/*
* sstatus IPM values
*/
#define SSTATUS_GET_IPM(x) \
((x & SSTATUS_IPM) >> SSTATUS_IPM_SHIFT)
(x = (x & ~SSTATUS_IPM) | \
/*
* serror register fields
*/
/*
* S-Control Bridge port x register fields
*/
#define SCONTROL_DET_SHIFT 0
#define SCONTROL_GET_DET(x) \
(x & SCONTROL_DET)
#define SCONTROL_GET_IPM(x) \
((x & SCONTROL_IPM) >> SCONTROL_IPM_SHIFT)
(x = (x & ~SCONTROL_IPM) | \
#ifdef __cplusplus
}
#endif
#endif /* _SATA_DEFS_H */