smp_frames.h revision 4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6
/*
* 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_SMP_FRAMES_H
#define _SYS_SCSI_GENERIC_SMP_FRAMES_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/sysmacros.h>
/*
* The definitions of smp frame types and functions conforming to SAS-1.1 and
* SAS-2. Consumers are expected to determine protocol support by examining
* the response to the REPORT GENERAL function.
*/
typedef enum smp_frame_type {
SMP_FRAME_TYPE_REQUEST = 0x40,
SMP_FRAME_TYPE_RESPONSE = 0x41
typedef enum smp_function {
SMP_FUNC_REPORT_GENERAL = 0x00,
SMP_FUNC_READ_GPIO_REGISTER = 0x02,
SMP_FUNC_REPORT_ZONE_PERM_TABLE = 0x04,
SMP_FUNC_REPORT_BROADCAST = 0x06,
SMP_FUNC_DISCOVER = 0x10,
SMP_FUNC_REPORT_PHY_ERROR_LOG = 0x11,
SMP_FUNC_REPORT_PHY_SATA = 0x12,
SMP_FUNC_REPORT_ROUTE_INFO = 0x13,
SMP_FUNC_REPORT_PHY_EVENT = 0x14,
SMP_FUNC_DISCOVER_LIST = 0x20,
SMP_FUNC_REPORT_PHY_EVENT_LIST = 0x21,
SMP_FUNC_CONFIG_GENERAL = 0x80,
SMP_FUNC_ENABLE_DISABLE_ZONING = 0x81,
SMP_FUNC_WRITE_GPIO_REGISTER = 0x82,
SMP_FUNC_ZONED_BROADCAST = 0x85,
SMP_FUNC_ZONE_LOCK = 0x86,
SMP_FUNC_ZONE_ACTIVATE = 0x87,
SMP_FUNC_ZONE_UNLOCK = 0x88,
SMP_FUNC_CONFIG_ZONE_PHY_INFO = 0x8A,
SMP_FUNC_CONFIG_ZONE_PERM_TABLE = 0x8B,
SMP_FUNC_CONFIG_ROUTE_INFO = 0x90,
SMP_FUNC_PHY_CONTROL = 0x91,
SMP_FUNC_PHY_TEST_FUNCTION = 0x92,
SMP_FUNC_CONFIG_PHY_EVENT = 0x93
typedef enum smp_result {
SMP_RES_FUNCTION_ACCEPTED = 0x00,
SMP_RES_UNKNOWN_FUNCTION = 0x01,
SMP_RES_FUNCTION_FAILED = 0x02,
SMP_RES_BUSY = 0x05,
SMP_RES_PHY_DOES_NOT_EXIST = 0x10,
SMP_RES_INDEX_DOES_NOT_EXIST = 0x11,
SMP_RES_UNKNOWN_PHY_OPERATION = 0x13,
SMP_RES_PHY_TEST_IN_PROGRESS = 0x15,
SMP_RES_PHY_VACANT = 0x16,
SMP_RES_UNKNOWN_PHY_EVENT_SOURCE = 0x17,
SMP_RES_UNKNOWN_DESCRIPTOR_TYPE = 0x18,
SMP_RES_UNKNOWN_PHY_FILTER = 0x19,
SMP_RES_AFFILIATION_VIOLATION = 0x1A,
SMP_RES_ZONE_VIOLATION = 0x20,
SMP_RES_ZONE_LOCK_VIOLATION = 0x23,
SMP_RES_NOT_ACTIVATED = 0x24,
SMP_RES_ZONE_GROUP_OUT_OF_RANGE = 0x25,
SMP_RES_NO_PHYSICAL_PRESENCE = 0x26,
SMP_RES_SAVING_NOT_SUPPORTED = 0x27,
SMP_RES_SOURCE_ZONE_GROUP_DNE = 0x28,
SMP_RES_NONE = -1
} smp_result_t;
#pragma pack(1)
/*
* SAS-2 10.4.3.2 request frame format
*/
typedef struct smp_request_frame {
/*
* SAS-2 10.4.3.3 response frame format
*/
typedef struct smp_response_frame {
#ifdef offsetof
#define SMP_REQ_MINLEN \
#define SMP_RESP_MINLEN \
#endif /* offsetof */
/*
* SAS-2 10.4.3.4 REPORT GENERAL (no additional request bytes)
*/
typedef struct smp_report_general_resp {
_reserved1 :7,
srgr_long_response :1);
srgr_configuring :1,
_reserved2 :2,
srgr_zone_locked :1,
_reserved6 :1,
srgr_saving :1,
_reserved7 :4);
_reserved11 :7,
typedef enum smp_n_zone_grps {
SMP_ZONE_GROUPS_128 = 0x0,
SMP_ZONE_GROUPS_256 = 0x1
/*
* SAS-2 10.4.3.5 REPORT MANUFACTURER INFORMATION (no additional request bytes)
*/
typedef struct smp_report_manufacturer_info_resp {
_reserved2 :7);
char srmir_vendor_identification[8];
char srmir_product_identification[16];
char srmir_product_revision_level[4];
/*
* SAS-2 10.4.3.6 REPORT SELF_CONFIGURATION STATUS
*/
typedef struct smp_report_self_config_status_req {
typedef struct smp_report_self_config_status_resp {
typedef struct smp_self_config_status_descr {
sscsd_final :1,
_reserved1 :7);
typedef enum smp_self_config_status_type {
SMP_SCST_NONSPECIFIC_ERROR = 0x01,
SMP_SCST_CONNECTION = 0x02,
SMP_SCST_ROUTE_TABLE_FULL = 0x03,
SMP_SCST_NOMEM = 0x04,
SMP_SCST_PHY_LAYER_ERROR = 0x20,
SMP_SCST_LOST_SYNC = 0x21,
SMP_SCST_LINK_LAYER_ERROR = 0x40,
SMP_SCST_OPEN_TIMEOUT = 0x41,
SMP_SCST_ABANDON_OPEN_REJECT = 0x42,
SMP_SCST_RETRY_OPEN_REJECTS = 0x43,
SMP_SCST_NEXUS_LOSS = 0x44,
SMP_SCST_BREAK = 0x45,
SMP_SCST_CRC_ERROR = 0x46,
SMP_SCST_PORT_LAYER_ERROR = 0x60,
SMP_SCST_RESPONSE_TIMEOUT = 0x61,
SMP_SCST_TRANSPORT_LAYER_ERROR = 0x80,
SMP_SCST_APP_LAYER_ERROR = 0xA0,
SMP_SCST_RESPONSE_TOO_SHORT = 0xA1,
SMP_SCST_UNSUPPORTED_VALUES = 0xA2,
SMP_SCST_INCONSISTENT = 0xA3,
SMP_SCST_CONFIGURING = 0xA4
/*
* SAS-2 10.4.3.7 REPORT ZONE PERMISSION TABLE
*/
typedef struct smp_report_zone_perm_table_req {
_reserved1 :6);
typedef enum smp_zone_perm_table_report_type {
SMP_ZPTRT_CURRENT = 0x0,
SMP_ZPTRT_SHADOW = 0x1,
SMP_ZPTRT_SAVED = 0x2,
SMP_ZPTRT_DEFAULT = 0x3
typedef struct smp_report_zone_perm_table_resp {
_reserved1 :5,
srzptr_zone_locked :1);
_reserved2 :6,
/*
* SAS-2 10.4.3.8 REPORT ZONE MANAGER PASSWORD (no additional request bytes)
*/
typedef struct smp_report_zone_mgr_password_resp {
/*
* SAS-2 10.4.3.9 REPORT BROADCAST
*/
typedef struct smp_report_broadcast_req {
_reserved1 :4);
typedef enum smp_broadcast_type {
SMP_BROADCAST_CHANGE = 0x0,
SMP_BROADCAST_SES = 0x3,
SMP_BROADCAST_EXPANDER = 0x4,
SMP_BROADCAST_ASYNC_EVENT = 0x5,
SMP_BROADCAST_RESERVED_3 = 0x6,
SMP_BROADCAST_RESERVED_4 = 0x7,
typedef struct smp_broadcast_descr {
_reserved1 :4);
_reserved2 :4);
typedef struct smp_report_broadcast_resp {
_reserved1 :4);
/*
* SAS-2 10.4.3.10 DISCOVER
*/
typedef struct smp_discover_req {
_reserved2 :7);
typedef struct smp_snw3_phy_cap {
_reserved1 :2,
sspc_tx_ssc_type :1,
sspc_start :1);
_reserved2 :2,
sspc_g3_ssc :1,
sspc_g3_no_ssc :1,
sspc_g2_ssc :1,
sspc_g2_no_ssc :1,
sspc_g1_ssc :1,
sspc_g1_no_ssc :1);
sspc_parity :1,
_reserved4 :7);
typedef struct smp_discover_resp {
_reserved3 :1);
_reserved4 :4);
_reserved5 :4);
_reserved6 :3,
_reserved7 :5);
_reserved9 :3,
sdr_virtual_phy :1);
_reserved10 :4);
_reserved11 :1);
sdr_inside_zpsds :1,
_reserved13 :1,
_reserved14 :1);
sdr_reason :4);
_reserved18 :6);
_reserved19 :1,
_reserved20 :1,
_reserved21 :2);
_reserved23 :1,
_reserved24 :1,
_reserved25 :2);
_reserved27 :2,
_reserved28 :1,
_reserved29 :2);
typedef enum smp_link_rate {
SMP_LINK_RATE_NO_CHANGE = 0x0,
SMP_LINK_RATE_DISABLED = 0x1,
SMP_LINK_RATE_RESET_PROBLEM = 0x2,
SMP_LINK_RATE_SPINUP_HOLD = 0x3,
SMP_LINK_RATE_PORT_SELECTOR = 0x4,
SMP_LINK_RATE_RESET = 0x5,
SMP_LINK_RATE_UNSUPPORTED = 0x6,
SMP_LINK_RATE_1_5 = 0x8,
SMP_LINK_RATE_3 = 0x9,
SMP_LINK_RATE_6 = 0xA
typedef enum smp_device_type {
SMP_DEV_NONE = 0x0,
SMP_DEV_SAS_SATA = 0x1,
SMP_DEV_EXPANDER = 0x2,
SMP_DEV_EXPANDER_OLD = 0x3
typedef enum smp_routing_attr {
SMP_ROUTING_DIRECT = 0x0,
SMP_ROUTING_SUBTRACTIVE = 0x1,
SMP_ROUTING_TABLE = 0x2
/*
* SAS-2 10.4.3.11 REPORT PHY ERROR LOG
*/
typedef struct smp_report_phy_error_log_req {
typedef struct smp_report_phy_error_log_resp {
/*
* SAS-2 10.4.3.12 REPORT PHY SATA
*/
typedef struct smp_report_phy_sata_req {
typedef struct smp_report_phy_sata_resp {
_reserved3 :5);
/*
* SAS-2 10.4.3.13 REPORT ROUTE INFORMATION
*/
typedef struct smp_report_route_info_req {
typedef struct smp_report_route_info_resp {
_reserved3 :7,
/*
* SAS-2 10.4.3.14 SAS-2 REPORT PHY EVENT
*/
typedef struct smp_report_phy_event_req {
typedef struct smp_phy_event_report_descr {
typedef struct smp_report_phy_event_resp {
/*
* SAS-2 10.4.3.15 SAS-2 DISCOVER LIST
*/
typedef struct smp_discover_list_req {
sdlr_phy_filter :4,
_reserved2 :3,
sdlr_descr_type :4,
_reserved3 :4);
typedef struct smp_discover_short_descr {
_restricted1 :1);
_restricted2 :4);
_restricted3 :4);
_restricted4 :3,
_reserved1 :3,
sdsd_virtual_phy :1);
_reserved2 :4,
sdsd_reason :4);
_reserved3 :1,
_reserved4 :1,
_restricted5 :2);
typedef struct smp_discover_long_descr {
#define SMP_DISCOVER_RESP(_ld) \
NULL)
typedef struct smp_discover_list_resp {
sdlr_phy_filter :4,
_reserved2 :4);
sdlr_descr_type :4,
_reserved3 :4);
sdlr_configuring :1,
_reserved5 :4,
/*
* SAS-2 10.4.3.16 REPORT PHY EVENT LIST
*/
typedef struct smp_report_phy_event_list_req {
typedef struct smp_phy_event_list_descr {
typedef struct smp_report_phy_event_list_resp {
/*
* SAS-2 10.4.3.17 REPORT EXPANDER ROUTE TABLE LIST
*/
typedef struct smp_report_exp_route_table_list_req {
typedef struct smp_route_table_descr {
_reserved1 :7,
typedef struct smp_report_exp_route_table_list_resp {
_reserved1 :1,
_reserved2 :6);
/*
* SAS-2 10.4.3.18 CONFIGURE GENERAL (no additional response)
*/
typedef struct smp_config_general_req {
_reserved2 :3);
/*
* SAS-2 10.4.3.19 ENABLE DISABLE ZONING (no additional response)
*/
typedef struct smp_enable_disable_zoning_req {
_reserved1 :6);
_reserved3 :6);
typedef enum smp_zoning_save {
SMP_ZONING_SAVE_CURRENT = 0x0,
SMP_ZONING_SAVE_SAVED = 0x1,
SMP_ZONING_SAVE_BOTH_IF_SUPP = 0x2,
SMP_ZONING_SAVE_BOTH = 0x3
typedef enum smp_zoning_enable_op {
SMP_ZONING_ENABLE_OP_NONE = 0x0,
SMP_ZONING_ENABLE_OP_ENABLE = 0x1,
/*
* SAS-2 10.4.3.20 ZONED BROADCAST (no additional response)
*/
typedef struct smp_zoned_broadcast_req {
_reserved :4);
/*
* SAS-2 10.4.3.21 ZONE LOCK
*/
typedef struct smp_zone_lock_req {
typedef struct smp_zone_lock_resp {
/*
* SAS-2 10.4.3.22 ZONE ACTIVATE (no additional response)
*/
typedef struct smp_zone_activate_req {
/*
* SAS-2 10.4.3.23 ZONE UNLOCK (no additional response)
*/
typedef struct smp_zone_unlock_req {
_reserved1 :7);
/*
* SAS-2 10.4.3.24 CONFIGURE ZONE MANAGER PASSWORD (no additional response)
*/
typedef struct smp_config_zone_manager_password_req {
_reserved1 :6);
/*
* SAS-2 10.4.3.25 CONFIGURE ZONE PHY INFORMATION (no additional response)
*/
typedef struct smp_zone_phy_config_descr {
_reserved1 :2,
_reserved2 :1,
_reserved3 :2);
typedef struct smp_config_zone_phy_info_req {
_reserved1 :6);
/*
* SAS-2 10.4.3.26 CONFIGURE ZONE PERMISSION TABLE (no additional response)
*/
typedef struct smp_config_zone_perm_table_req {
_reserved1 :4,
/*
* SAS-2 10.4.3.27 CONFIGURE ROUTE INFORMATION (no additional response)
*/
typedef struct smp_config_route_info_req {
_reserved3 :7,
/*
* SAS-2 10.4.3.28 PHY CONTROL (no additional response)
*/
typedef struct smp_phy_control_req {
_reserved2 :7);
_reserved4 :4,
_reserved5 :4,
_reserved7 :4);
typedef enum smp_phy_op {
SMP_PHY_OP_NOP = 0x00,
SMP_PHY_OP_LINK_RESET = 0x01,
SMP_PHY_OP_HARD_RESET = 0x02,
SMP_PHY_OP_DISABLE = 0x03,
SMP_PHY_OP_CLEAR_ERROR_LOG = 0x05,
SMP_PHY_OP_CLEAR_AFFILIATION = 0x06,
SMP_PHY_OP_CLEAR_STP_NEXUS_LOSS = 0x08,
} smp_phy_op_t;
/*
* SAS-2 10.4.3.29 PHY TEST FUNCTION (no additional response)
*/
typedef struct smp_phy_test_function_req {
_reserved3 :1);
typedef enum smp_phy_test_function {
SMP_PHY_TEST_FN_STOP = 0x00,
/*
* SAS-2 10.4.3.30 CONFIGURE PHY EVENT (no additional response)
*/
typedef struct smp_phy_event_config_descr {
typedef struct smp_config_phy_event_req {
_reserved1 :7);
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SCSI_GENERIC_SMP_FRAMES_H */