1936b7af6Sjw /*
2936b7af6Sjw  * CDDL HEADER START
3936b7af6Sjw  *
4936b7af6Sjw  * The contents of this file are subject to the terms of the
5936b7af6Sjw  * Common Development and Distribution License (the "License").
6936b7af6Sjw  * You may not use this file except in compliance with the License.
7936b7af6Sjw  *
8936b7af6Sjw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9936b7af6Sjw  * or http://www.opensolaris.org/os/licensing.
10936b7af6Sjw  * See the License for the specific language governing permissions
11936b7af6Sjw  * and limitations under the License.
12936b7af6Sjw  *
13936b7af6Sjw  * When distributing Covered Code, include this CDDL HEADER in each
14936b7af6Sjw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15936b7af6Sjw  * If applicable, add the following below this CDDL HEADER, with the
16936b7af6Sjw  * fields enclosed by brackets "[]" replaced with your own identifying
17936b7af6Sjw  * information: Portions Copyright [yyyy] [name of copyright owner]
18936b7af6Sjw  *
19936b7af6Sjw  * CDDL HEADER END
20936b7af6Sjw  */
21936b7af6Sjw /*
22*d0698e0dSDavid Hollister  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23936b7af6Sjw  */
24936b7af6Sjw 
254c06356bSdh #ifndef _SYS_SCSI_GENERIC_SMP_FRAMES_H
264c06356bSdh #define	_SYS_SCSI_GENERIC_SMP_FRAMES_H
27936b7af6Sjw 
28936b7af6Sjw #ifdef	__cplusplus
29936b7af6Sjw extern "C" {
30936b7af6Sjw #endif
31936b7af6Sjw 
32936b7af6Sjw #include <sys/sysmacros.h>
33936b7af6Sjw 
34936b7af6Sjw /*
354c06356bSdh  * The definitions of smp frame types and functions conforming to SAS-1.1 and
364c06356bSdh  * SAS-2.  Consumers are expected to determine protocol support by examining
374c06356bSdh  * the response to the REPORT GENERAL function.
38936b7af6Sjw  */
39936b7af6Sjw 
404c06356bSdh typedef enum smp_frame_type {
41936b7af6Sjw 	SMP_FRAME_TYPE_REQUEST		= 0x40,
42936b7af6Sjw 	SMP_FRAME_TYPE_RESPONSE		= 0x41
434c06356bSdh } smp_frame_type_t;
444c06356bSdh 
454c06356bSdh typedef enum smp_function {
464c06356bSdh 	SMP_FUNC_REPORT_GENERAL			= 0x00,
474c06356bSdh 	SMP_FUNC_REPORT_MANUFACTURER_INFO	= 0x01,
484c06356bSdh 	SMP_FUNC_READ_GPIO_REGISTER		= 0x02,
494c06356bSdh 	SMP_FUNC_REPORT_SELF_CONFIG_STATUS	= 0x03,
504c06356bSdh 	SMP_FUNC_REPORT_ZONE_PERM_TABLE		= 0x04,
514c06356bSdh 	SMP_FUNC_REPORT_ZONE_MANAGER_PASSWORD	= 0x05,
524c06356bSdh 	SMP_FUNC_REPORT_BROADCAST		= 0x06,
534c06356bSdh 	SMP_FUNC_DISCOVER			= 0x10,
544c06356bSdh 	SMP_FUNC_REPORT_PHY_ERROR_LOG		= 0x11,
554c06356bSdh 	SMP_FUNC_REPORT_PHY_SATA		= 0x12,
564c06356bSdh 	SMP_FUNC_REPORT_ROUTE_INFO		= 0x13,
574c06356bSdh 	SMP_FUNC_REPORT_PHY_EVENT		= 0x14,
584c06356bSdh 	SMP_FUNC_DISCOVER_LIST			= 0x20,
594c06356bSdh 	SMP_FUNC_REPORT_PHY_EVENT_LIST		= 0x21,
604c06356bSdh 	SMP_FUNC_REPORT_EXP_ROUTE_TABLE_LIST	= 0x22,
614c06356bSdh 	SMP_FUNC_CONFIG_GENERAL			= 0x80,
624c06356bSdh 	SMP_FUNC_ENABLE_DISABLE_ZONING		= 0x81,
634c06356bSdh 	SMP_FUNC_WRITE_GPIO_REGISTER		= 0x82,
644c06356bSdh 	SMP_FUNC_ZONED_BROADCAST		= 0x85,
654c06356bSdh 	SMP_FUNC_ZONE_LOCK			= 0x86,
664c06356bSdh 	SMP_FUNC_ZONE_ACTIVATE			= 0x87,
674c06356bSdh 	SMP_FUNC_ZONE_UNLOCK			= 0x88,
684c06356bSdh 	SMP_FUNC_CONFIG_ZONE_MANAGER_PASSWORD	= 0x89,
694c06356bSdh 	SMP_FUNC_CONFIG_ZONE_PHY_INFO		= 0x8A,
704c06356bSdh 	SMP_FUNC_CONFIG_ZONE_PERM_TABLE		= 0x8B,
714c06356bSdh 	SMP_FUNC_CONFIG_ROUTE_INFO		= 0x90,
724c06356bSdh 	SMP_FUNC_PHY_CONTROL			= 0x91,
734c06356bSdh 	SMP_FUNC_PHY_TEST_FUNCTION		= 0x92,
744c06356bSdh 	SMP_FUNC_CONFIG_PHY_EVENT		= 0x93
754c06356bSdh } smp_function_t;
76936b7af6Sjw 
774c06356bSdh typedef enum smp_result {
784c06356bSdh 	SMP_RES_FUNCTION_ACCEPTED		= 0x00,
794c06356bSdh 	SMP_RES_UNKNOWN_FUNCTION		= 0x01,
804c06356bSdh 	SMP_RES_FUNCTION_FAILED			= 0x02,
814c06356bSdh 	SMP_RES_INVALID_REQUEST_FRAME_LENGTH	= 0x03,
824c06356bSdh 	SMP_RES_INVALID_EXPANDER_CHANGE_COUNT	= 0x04,
834c06356bSdh 	SMP_RES_BUSY				= 0x05,
844c06356bSdh 	SMP_RES_INCOMPLETE_DESCRIPTOR_LIST	= 0x06,
854c06356bSdh 	SMP_RES_PHY_DOES_NOT_EXIST		= 0x10,
864c06356bSdh 	SMP_RES_INDEX_DOES_NOT_EXIST		= 0x11,
874c06356bSdh 	SMP_RES_PHY_DOES_NOT_SUPPORT_SATA	= 0x12,
884c06356bSdh 	SMP_RES_UNKNOWN_PHY_OPERATION		= 0x13,
894c06356bSdh 	SMP_RES_UNKNOWN_PHY_TEST_FUNCTION	= 0x14,
904c06356bSdh 	SMP_RES_PHY_TEST_IN_PROGRESS		= 0x15,
914c06356bSdh 	SMP_RES_PHY_VACANT			= 0x16,
924c06356bSdh 	SMP_RES_UNKNOWN_PHY_EVENT_SOURCE	= 0x17,
934c06356bSdh 	SMP_RES_UNKNOWN_DESCRIPTOR_TYPE		= 0x18,
944c06356bSdh 	SMP_RES_UNKNOWN_PHY_FILTER		= 0x19,
954c06356bSdh 	SMP_RES_AFFILIATION_VIOLATION		= 0x1A,
964c06356bSdh 	SMP_RES_ZONE_VIOLATION			= 0x20,
974c06356bSdh 	SMP_RES_NO_MANAGEMENT_ACCESS_RIGHTS	= 0x21,
984c06356bSdh 	SMP_RES_UNKNOWN_ENABLE_DISABLE_ZONING	= 0x22,
994c06356bSdh 	SMP_RES_ZONE_LOCK_VIOLATION		= 0x23,
1004c06356bSdh 	SMP_RES_NOT_ACTIVATED			= 0x24,
1014c06356bSdh 	SMP_RES_ZONE_GROUP_OUT_OF_RANGE		= 0x25,
1024c06356bSdh 	SMP_RES_NO_PHYSICAL_PRESENCE		= 0x26,
1034c06356bSdh 	SMP_RES_SAVING_NOT_SUPPORTED		= 0x27,
1044c06356bSdh 	SMP_RES_SOURCE_ZONE_GROUP_DNE		= 0x28,
105*d0698e0dSDavid Hollister 	SMP_RES_DISABLED_PW_NOT_SUPPORTED	= 0x29,
1064c06356bSdh 	SMP_RES_NONE				= -1
1074c06356bSdh } smp_result_t;
1084c06356bSdh 
1094c06356bSdh #pragma	pack(1)
110936b7af6Sjw 
111936b7af6Sjw /*
1124c06356bSdh  * SAS-2 10.4.3.2 request frame format
113936b7af6Sjw  */
1144c06356bSdh typedef struct smp_request_frame {
1154c06356bSdh 	uint8_t srf_frame_type;
1164c06356bSdh 	uint8_t srf_function;
1174c06356bSdh 	uint8_t srf_allocated_response_len;	/* reserved in SAS-1 */
1184c06356bSdh 	uint8_t srf_request_len;
1194c06356bSdh 	uint8_t srf_data[1];
1204c06356bSdh } smp_request_frame_t;
121936b7af6Sjw 
1224c06356bSdh /*
1234c06356bSdh  * SAS-2 10.4.3.3 response frame format
1244c06356bSdh  */
1254c06356bSdh typedef struct smp_response_frame {
1264c06356bSdh 	uint8_t srf_frame_type;
1274c06356bSdh 	uint8_t srf_function;
1284c06356bSdh 	uint8_t srf_result;
1294c06356bSdh 	uint8_t srf_response_len;	/* reserved in SAS-1 */
1304c06356bSdh 	uint8_t srf_data[1];
1314c06356bSdh } smp_response_frame_t;
1324c06356bSdh 
1334c06356bSdh typedef uint8_t smp_crc_t[4];
1344c06356bSdh 
1354c06356bSdh #ifdef offsetof
1364c06356bSdh #define	SMP_REQ_MINLEN	\
1374c06356bSdh 	(offsetof(smp_request_frame_t, srf_data[0]) + sizeof (smp_crc_t))
1384c06356bSdh #define	SMP_RESP_MINLEN	\
1394c06356bSdh 	(offsetof(smp_response_frame_t, srf_data[0]) + sizeof (smp_crc_t))
1404c06356bSdh #endif	/* offsetof */
1414c06356bSdh 
1424c06356bSdh /*
1434c06356bSdh  * SAS-2 10.4.3.4 REPORT GENERAL (no additional request bytes)
1444c06356bSdh  */
1454c06356bSdh typedef struct smp_report_general_resp {
1464c06356bSdh 	uint16_t srgr_exp_change_count;
1474c06356bSdh 	uint16_t srgr_exp_route_indexes;
1484c06356bSdh 	DECL_BITFIELD2(
1494c06356bSdh 	    _reserved1		:7,
1504c06356bSdh 	    srgr_long_response	:1);
1514c06356bSdh 	uint8_t srgr_number_of_phys;
1524c06356bSdh 	DECL_BITFIELD7(
1534c06356bSdh 	    srgr_externally_configurable_route_table	:1,
1544c06356bSdh 	    srgr_configuring				:1,
1554c06356bSdh 	    srgr_configures_others			:1,
1564c06356bSdh 	    srgr_open_reject_retry_supported		:1,
1574c06356bSdh 	    srgr_stp_continue_awt			:1,
1584c06356bSdh 	    _reserved2					:2,
1594c06356bSdh 	    srgr_table_to_table_supported		:1);
1604c06356bSdh 	uint8_t _reserved3;
1614c06356bSdh 	uint64_t srgr_enclosure_logical_identifier;
1624c06356bSdh 	uint8_t _reserved4[8];
1634c06356bSdh 	uint8_t _reserved5[2];
1644c06356bSdh 	uint16_t srgr_stp_bus_inactivity_time_limit;
1654c06356bSdh 	uint16_t srgr_stp_maximum_connect_time_limit;
1664c06356bSdh 	uint16_t srgr_stp_smp_nexus_loss_time;
1674c06356bSdh 	DECL_BITFIELD7(
1684c06356bSdh 	    srgr_zoning_enabled				:1,
1694c06356bSdh 	    srgr_zoning_supported			:1,
1704c06356bSdh 	    srgr_physical_presence_asserted		:1,
1714c06356bSdh 	    srgr_physical_presence_supported		:1,
1724c06356bSdh 	    srgr_zone_locked				:1,
1734c06356bSdh 	    _reserved6					:1,
1744c06356bSdh 	    srgr_number_of_zone_grps			:2);
1754c06356bSdh 	DECL_BITFIELD6(
1764c06356bSdh 	    srgr_saving_zoning_enabled_supported	:1,
1774c06356bSdh 	    srgr_saving_zone_perm_table_supported	:1,
1784c06356bSdh 	    srgr_saving_zone_phy_info_supported		:1,
1794c06356bSdh 	    srgr_saving_zone_mgr_password_supported	:1,
1804c06356bSdh 	    srgr_saving					:1,
181*d0698e0dSDavid Hollister 	    _reserved7					:3);
1824c06356bSdh 	uint16_t srgr_max_routed_sas_addrs;
1834c06356bSdh 	uint64_t srgr_active_zm_sas_addr;
1844c06356bSdh 	uint16_t srgr_zone_lock_inactivity_limit;
1854c06356bSdh 	uint8_t _reserved8[2];
1864c06356bSdh 	uint8_t _reserved9;
1874c06356bSdh 	uint8_t srgr_first_encl_conn_elem_idx;
1884c06356bSdh 	uint8_t srgr_number_encl_conn_elem_idxs;
1894c06356bSdh 	uint8_t _reserved10;
1904c06356bSdh 	DECL_BITFIELD2(
1914c06356bSdh 	    _reserved11					:7,
1924c06356bSdh 	    srgr_reduced_functionality			:1);
1934c06356bSdh 	uint8_t srgr_time_to_reduced_functionality;
1944c06356bSdh 	uint8_t srgr_initial_time_to_reduced_functionality;
1954c06356bSdh 	uint8_t srgr_max_reduced_functionality_time;
1964c06356bSdh 	uint16_t srgr_last_self_conf_status_descr_idx;
1974c06356bSdh 	uint16_t srgr_max_stored_self_config_status_descrs;
1984c06356bSdh 	uint16_t srgr_last_phy_event_list_descr_idx;
1994c06356bSdh 	uint16_t srgr_max_stored_phy_event_list_descrs;
2004c06356bSdh 	uint16_t srgr_stp_reject_to_open_limit;
2014c06356bSdh 	uint8_t _reserved12[2];
2024c06356bSdh } smp_report_general_resp_t;
2034c06356bSdh 
2044c06356bSdh typedef enum smp_n_zone_grps {
2054c06356bSdh 	SMP_ZONE_GROUPS_128	= 0x0,
2064c06356bSdh 	SMP_ZONE_GROUPS_256	= 0x1
2074c06356bSdh } smp_n_zone_grps_t;
2084c06356bSdh 
2094c06356bSdh /*
2104c06356bSdh  * SAS-2 10.4.3.5 REPORT MANUFACTURER INFORMATION (no additional request bytes)
2114c06356bSdh  */
2124c06356bSdh typedef struct smp_report_manufacturer_info_resp {
2134c06356bSdh 	uint16_t srmir_exp_change_count;
2144c06356bSdh 	uint8_t _reserved1[2];
2154c06356bSdh 	DECL_BITFIELD2(
2164c06356bSdh 	    srmir_sas_1_1_format	:1,
2174c06356bSdh 	    _reserved2			:7);
2184c06356bSdh 	uint8_t _reserved3[3];
2194c06356bSdh 	char srmir_vendor_identification[8];
2204c06356bSdh 	char srmir_product_identification[16];
2214c06356bSdh 	char srmir_product_revision_level[4];
2224c06356bSdh 	char srmir_component_vendor_identification[8];
2234c06356bSdh 	uint16_t srmir_component_id;
2244c06356bSdh 	uint8_t srmir_component_revision_level;
2254c06356bSdh 	uint8_t _reserved4;
2264c06356bSdh 	uint8_t srmir_vs_52[8];
2274c06356bSdh } smp_report_manufacturer_info_resp_t;
2284c06356bSdh 
2294c06356bSdh /*
2304c06356bSdh  * SAS-2 10.4.3.6 REPORT SELF_CONFIGURATION STATUS
2314c06356bSdh  */
2324c06356bSdh typedef struct smp_report_self_config_status_req {
2334c06356bSdh 	uint8_t _reserved1[2];
2344c06356bSdh 	uint16_t srscsr_starting_self_config_status_descr_idx;
2354c06356bSdh } smp_report_self_config_status_req_t;
2364c06356bSdh 
2374c06356bSdh typedef struct smp_report_self_config_status_resp {
2384c06356bSdh 	uint16_t srscsr_exp_change_count;
2394c06356bSdh 	uint16_t srscsr_starting_self_config_status_descr_idx;
2404c06356bSdh 	uint16_t srscsr_number_self_config_status_descrs;
2414c06356bSdh 	uint16_t srscsr_last_self_config_status_descr_idx;
2424c06356bSdh 	uint8_t srscsr_self_config_status_descr_len;
2434c06356bSdh 	uint8_t _reserved1[3];
2444c06356bSdh 	uint8_t srscsr_descrs[1];
2454c06356bSdh } smp_report_self_config_status_resp_t;
2464c06356bSdh 
2474c06356bSdh typedef struct smp_self_config_status_descr {
2484c06356bSdh 	uint8_t sscsd_status_type;
2494c06356bSdh 	DECL_BITFIELD2(
2504c06356bSdh 	    sscsd_final		:1,
2514c06356bSdh 	    _reserved1		:7);
2524c06356bSdh 	uint8_t _reserved2;
2534c06356bSdh 	uint8_t sscsd_phy_identifier;
2544c06356bSdh 	uint8_t _reserved3[4];
2554c06356bSdh 	uint64_t sscsd_sas_addr;
2564c06356bSdh } smp_self_config_status_descr_t;
2574c06356bSdh 
2584c06356bSdh typedef enum smp_self_config_status_type {
2594c06356bSdh 	SMP_SCST_NONSPECIFIC_ERROR	= 0x01,
2604c06356bSdh 	SMP_SCST_CONNECTION		= 0x02,
2614c06356bSdh 	SMP_SCST_ROUTE_TABLE_FULL	= 0x03,
2624c06356bSdh 	SMP_SCST_NOMEM			= 0x04,
2634c06356bSdh 	SMP_SCST_PHY_LAYER_ERROR	= 0x20,
2644c06356bSdh 	SMP_SCST_LOST_SYNC		= 0x21,
2654c06356bSdh 	SMP_SCST_LINK_LAYER_ERROR	= 0x40,
2664c06356bSdh 	SMP_SCST_OPEN_TIMEOUT		= 0x41,
2674c06356bSdh 	SMP_SCST_ABANDON_OPEN_REJECT	= 0x42,
2684c06356bSdh 	SMP_SCST_RETRY_OPEN_REJECTS	= 0x43,
2694c06356bSdh 	SMP_SCST_NEXUS_LOSS		= 0x44,
2704c06356bSdh 	SMP_SCST_BREAK			= 0x45,
2714c06356bSdh 	SMP_SCST_CRC_ERROR		= 0x46,
2724c06356bSdh 	SMP_SCST_PORT_LAYER_ERROR	= 0x60,
2734c06356bSdh 	SMP_SCST_RESPONSE_TIMEOUT	= 0x61,
2744c06356bSdh 	SMP_SCST_TRANSPORT_LAYER_ERROR	= 0x80,
2754c06356bSdh 	SMP_SCST_APP_LAYER_ERROR	= 0xA0,
2764c06356bSdh 	SMP_SCST_RESPONSE_TOO_SHORT	= 0xA1,
2774c06356bSdh 	SMP_SCST_UNSUPPORTED_VALUES	= 0xA2,
2784c06356bSdh 	SMP_SCST_INCONSISTENT		= 0xA3,
2794c06356bSdh 	SMP_SCST_CONFIGURING		= 0xA4
2804c06356bSdh } smp_self_config_status_type_t;
2814c06356bSdh 
2824c06356bSdh /*
2834c06356bSdh  * SAS-2 10.4.3.7 REPORT ZONE PERMISSION TABLE
2844c06356bSdh  */
2854c06356bSdh typedef struct smp_report_zone_perm_table_req {
2864c06356bSdh 	DECL_BITFIELD2(
2874c06356bSdh 	    srzptr_report_type		:2,
2884c06356bSdh 	    _reserved1			:6);
2894c06356bSdh 	uint8_t _reserved2;
2904c06356bSdh 	uint8_t srzptr_starting_src_zone_grp;
2914c06356bSdh 	uint8_t srzptr_max_zone_perm_descrs;
2924c06356bSdh } smp_report_zone_perm_table_req_t;
2934c06356bSdh 
2944c06356bSdh typedef enum smp_zone_perm_table_report_type {
2954c06356bSdh 	SMP_ZPTRT_CURRENT		= 0x0,
2964c06356bSdh 	SMP_ZPTRT_SHADOW		= 0x1,
2974c06356bSdh 	SMP_ZPTRT_SAVED			= 0x2,
2984c06356bSdh 	SMP_ZPTRT_DEFAULT		= 0x3
2994c06356bSdh } smp_zone_perm_table_report_type_t;
3004c06356bSdh 
3014c06356bSdh typedef struct smp_report_zone_perm_table_resp {
3024c06356bSdh 	uint16_t srzptr_exp_change_count;
303936b7af6Sjw 	DECL_BITFIELD3(
3044c06356bSdh 	    srzptr_report_type		:2,
3054c06356bSdh 	    _reserved1			:5,
3064c06356bSdh 	    srzptr_zone_locked		:1);
3074c06356bSdh 	DECL_BITFIELD2(
3084c06356bSdh 	    _reserved2			:6,
3094c06356bSdh 	    srzptr_number_zone_grps	:2);
3104c06356bSdh 	uint8_t _reserved3[6];
3114c06356bSdh 	uint8_t srzptr_starting_src_zone_grp;
3124c06356bSdh 	uint8_t srzptr_number_zone_perm_descrs;
3134c06356bSdh 	uint8_t srzptr_descrs[1];
3144c06356bSdh } smp_report_zone_perm_table_resp_t;
3154c06356bSdh 
3164c06356bSdh typedef uint8_t smp_zone_perm_descr128_t[16];
3174c06356bSdh typedef uint8_t smp_zone_perm_descr256_t[32];
3184c06356bSdh 
3194c06356bSdh #define	SMP_ZONE_PERM_BIT128(__d, __z)	\
3204c06356bSdh 	((__d)[15 - ((__z) >> 3)] & (1 << ((__z) & 7)))
3214c06356bSdh 
3224c06356bSdh #define	SMP_ZONE_PERM_SET128(__d, __z)	\
3234c06356bSdh 	((__d)[15 - ((__z) >> 3)] |= (1 << ((__z) & 7)))
3244c06356bSdh 
3254c06356bSdh #define	SMP_ZONE_PERM_CLR128(__d, __z)	\
3264c06356bSdh 	((__d)[15 - ((__z) >> 3)] &= ~(1 << ((__z) & 7)))
3274c06356bSdh 
3284c06356bSdh #define	SMP_ZONE_PERM_BIT256(__d, __z)	\
3294c06356bSdh 	((__d)[31 - ((__z) >> 3)] & (1 << ((__z) & 7)))
3304c06356bSdh 
3314c06356bSdh #define	SMP_ZONE_PERM_SET256(__d, __z)	\
3324c06356bSdh 	((__d)[31 - ((__z) >> 3)] |= (1 << ((__z) & 7)))
3334c06356bSdh 
3344c06356bSdh #define	SMP_ZONE_PERM_CLR256(__d, __z)	\
3354c06356bSdh 	((__d)[31 - ((__z) >> 3)] &= ~(1 << ((__z) & 7)))
3364c06356bSdh 
3374c06356bSdh /*
338*d0698e0dSDavid Hollister  * SAS-2 10.4.3.8 REPORT ZONE MANAGER PASSWORD
3394c06356bSdh  */
340*d0698e0dSDavid Hollister typedef enum smp_report_zmp_report_type {
341*d0698e0dSDavid Hollister 	SMP_ZMP_TYPE_CURRENT		= 0x0,
342*d0698e0dSDavid Hollister 	SMP_ZMP_TYPE_SAVED		= 0x2,
343*d0698e0dSDavid Hollister 	SMP_ZMP_TYPE_DEFAULT		= 0x3
344*d0698e0dSDavid Hollister } smp_report_zmp_report_type_t;
345*d0698e0dSDavid Hollister 
346*d0698e0dSDavid Hollister typedef struct smp_report_zone_mgr_password_req {
347*d0698e0dSDavid Hollister 	DECL_BITFIELD2(
348*d0698e0dSDavid Hollister 	    srzmpr_rpt_type		:2,
349*d0698e0dSDavid Hollister 	    _reserved1			:6);
350*d0698e0dSDavid Hollister 	uint8_t _reserved2[2];
351*d0698e0dSDavid Hollister } smp_report_zone_mgr_password_req_t;
352*d0698e0dSDavid Hollister 
3534c06356bSdh typedef struct smp_report_zone_mgr_password_resp {
3544c06356bSdh 	uint16_t srzmpr_exp_change_count;
355*d0698e0dSDavid Hollister 	DECL_BITFIELD2(
356*d0698e0dSDavid Hollister 	    srzmpr_rpt_type		:2,
357*d0698e0dSDavid Hollister 	    _reserved1			:6);
358*d0698e0dSDavid Hollister 	uint8_t _reserved2;
3594c06356bSdh 	uint8_t srzmpr_zone_mgr_password[32];
3604c06356bSdh } smp_report_zone_mgr_password_resp_t;
3614c06356bSdh 
3624c06356bSdh /*
3634c06356bSdh  * SAS-2 10.4.3.9 REPORT BROADCAST
3644c06356bSdh  */
3654c06356bSdh typedef struct smp_report_broadcast_req {
3664c06356bSdh 	DECL_BITFIELD2(
3674c06356bSdh 	    srbr_broadcast_type		:4,
3684c06356bSdh 	    _reserved1			:4);
3694c06356bSdh 	uint8_t _reserved2[3];
3704c06356bSdh } smp_report_broadcast_req_t;
3714c06356bSdh 
3724c06356bSdh typedef enum smp_broadcast_type {
3734c06356bSdh 	SMP_BROADCAST_CHANGE		= 0x0,
3744c06356bSdh 	SMP_BROADCAST_RESERVED_CHANGE_0	= 0x1,
3754c06356bSdh 	SMP_BROADCAST_RESERVED_CHANGE_1	= 0x2,
3764c06356bSdh 	SMP_BROADCAST_SES		= 0x3,
3774c06356bSdh 	SMP_BROADCAST_EXPANDER		= 0x4,
3784c06356bSdh 	SMP_BROADCAST_ASYNC_EVENT	= 0x5,
3794c06356bSdh 	SMP_BROADCAST_RESERVED_3	= 0x6,
3804c06356bSdh 	SMP_BROADCAST_RESERVED_4	= 0x7,
3814c06356bSdh 	SMP_BROADCAST_ZONE_ACTIVATE	= 0x8
3824c06356bSdh } smp_broadcast_type_t;
3834c06356bSdh 
3844c06356bSdh typedef struct smp_broadcast_descr {
3854c06356bSdh 	DECL_BITFIELD2(
3864c06356bSdh 	    sbd_broadcast_type		:4,
3874c06356bSdh 	    _reserved1			:4);
3884c06356bSdh 	uint8_t sbd_phy_identifier;
3894c06356bSdh 	DECL_BITFIELD2(
3904c06356bSdh 	    sbd_broadcast_reason	:4,
3914c06356bSdh 	    _reserved2			:4);
3924c06356bSdh 	uint16_t sbd_broadcast_count;
3934c06356bSdh 	uint8_t _reserved3[10];
3944c06356bSdh } smp_broadcast_descr_t;
3954c06356bSdh 
3964c06356bSdh typedef struct smp_report_broadcast_resp {
3974c06356bSdh 	uint16_t srbr_exp_change_count;
3984c06356bSdh 	DECL_BITFIELD2(
3994c06356bSdh 	    srbr_broadcast_type		:4,
4004c06356bSdh 	    _reserved1			:4);
4014c06356bSdh 	uint8_t srbr_number_broadcast_descrs;
4024c06356bSdh 	smp_broadcast_descr_t srbr_descrs[1];
4034c06356bSdh } smp_report_broadcast_resp_t;
4044c06356bSdh 
4054c06356bSdh /*
4064c06356bSdh  * SAS-2 10.4.3.10 DISCOVER
4074c06356bSdh  */
4084c06356bSdh typedef struct smp_discover_req {
4094c06356bSdh 	uint8_t _reserved1[4];
4104c06356bSdh 	DECL_BITFIELD2(
4114c06356bSdh 	    sdr_ignore_zone_grp		:1,
4124c06356bSdh 	    _reserved2			:7);
4134c06356bSdh 	uint8_t sdr_phy_identifier;
4144c06356bSdh 	uint8_t _reserved3[2];
4154c06356bSdh } smp_discover_req_t;
4164c06356bSdh 
4174c06356bSdh typedef struct smp_snw3_phy_cap {
4184c06356bSdh 	DECL_BITFIELD4(
4194c06356bSdh 	    sspc_requested_logical_link_rate	:4,	/* smp_link_rate_t */
4204c06356bSdh 	    _reserved1				:2,
4214c06356bSdh 	    sspc_tx_ssc_type			:1,
4224c06356bSdh 	    sspc_start				:1);
4234c06356bSdh 	DECL_BITFIELD7(
4244c06356bSdh 	    _reserved2				:2,
4254c06356bSdh 	    sspc_g3_ssc				:1,
4264c06356bSdh 	    sspc_g3_no_ssc			:1,
4274c06356bSdh 	    sspc_g2_ssc				:1,
4284c06356bSdh 	    sspc_g2_no_ssc			:1,
4294c06356bSdh 	    sspc_g1_ssc				:1,
4304c06356bSdh 	    sspc_g1_no_ssc			:1);
4314c06356bSdh 	uint8_t _reserved3;
4324c06356bSdh 	DECL_BITFIELD2(
4334c06356bSdh 	    sspc_parity		:1,
4344c06356bSdh 	    _reserved4		:7);
4354c06356bSdh } smp_snw3_phy_cap_t;
4364c06356bSdh 
4374c06356bSdh typedef struct smp_discover_resp {
4384c06356bSdh 	uint16_t sdr_exp_change_count;
4394c06356bSdh 	uint8_t _reserved1[3];
4404c06356bSdh 	uint8_t sdr_phy_identifier;
4414c06356bSdh 	uint8_t _reserved2[2];
4424c06356bSdh 	DECL_BITFIELD3(
4434c06356bSdh 	    sdr_attached_reason		:4,
4444c06356bSdh 	    sdr_attached_device_type	:3,
4454c06356bSdh 	    _reserved3			:1);
4464c06356bSdh 	DECL_BITFIELD2(
4474c06356bSdh 	    sdr_negotiated_logical_link_rate	:4,	/* smp_link_rate_t */
4484c06356bSdh 	    _reserved4				:4);
4494c06356bSdh 	DECL_BITFIELD5(
4504c06356bSdh 	    sdr_attached_sata_host	:1,
4514c06356bSdh 	    sdr_attached_smp_initiator	:1,
4524c06356bSdh 	    sdr_attached_stp_initiator	:1,
4534c06356bSdh 	    sdr_attached_ssp_initiator	:1,
4544c06356bSdh 	    _reserved5			:4);
4554c06356bSdh 	DECL_BITFIELD6(
4564c06356bSdh 	    sdr_attached_sata_device		:1,
4574c06356bSdh 	    sdr_attached_smp_target		:1,
4584c06356bSdh 	    sdr_attached_stp_target		:1,
4594c06356bSdh 	    sdr_attached_ssp_target		:1,
4604c06356bSdh 	    _reserved6				:3,
4614c06356bSdh 	    sdr_attached_sata_port_selector	:1);
4624c06356bSdh 	uint64_t sdr_sas_addr;
4634c06356bSdh 	uint64_t sdr_attached_sas_addr;
4644c06356bSdh 	uint8_t sdr_attached_phy_identifier;
4654c06356bSdh 	DECL_BITFIELD4(
4664c06356bSdh 	    sdr_attached_break_reply_capable		:1,
4674c06356bSdh 	    sdr_attached_requested_inside_zpsds		:1,
4684c06356bSdh 	    sdr_attached_inside_zpsds_persistent	:1,
4694c06356bSdh 	    _reserved7					:5);
4704c06356bSdh 	uint8_t _reserved8[6];
4714c06356bSdh 	DECL_BITFIELD2(
4724c06356bSdh 	    sdr_hw_min_phys_link_rate	:4,	/* smp_link_rate_t */
4734c06356bSdh 	    sdr_prog_min_phys_link_rate	:4);	/* smp_link_rate_t */
4744c06356bSdh 	DECL_BITFIELD2(
4754c06356bSdh 	    sdr_hw_max_phys_link_rate	:4,	/* smp_link_rate_t */
4764c06356bSdh 	    sdr_prog_max_phys_link_rate	:4);	/* smp_link_rate_t */
4774c06356bSdh 	uint8_t sdr_phy_change_count;
4784c06356bSdh 	DECL_BITFIELD3(
4794c06356bSdh 	    sdr_partial_pwy_timeout	:4,
4804c06356bSdh 	    _reserved9			:3,
4814c06356bSdh 	    sdr_virtual_phy		:1);
4824c06356bSdh 	DECL_BITFIELD2(
4834c06356bSdh 	    sdr_routing_attr		:4,	/* smp_routing_attr_t */
4844c06356bSdh 	    _reserved10			:4);
4854c06356bSdh 	DECL_BITFIELD2(
4864c06356bSdh 	    sdr_connector_type		:7,
4874c06356bSdh 	    _reserved11			:1);
4884c06356bSdh 	uint8_t sdr_connector_element_index;
4894c06356bSdh 	uint8_t sdr_connector_physical_link;
4904c06356bSdh 	uint8_t _reserved12[2];
4914c06356bSdh 	uint8_t sdr_vendor[2];
4924c06356bSdh 	uint64_t sdr_attached_device_name;
4934c06356bSdh 	DECL_BITFIELD8(
4944c06356bSdh 	    sdr_zoning_enabled				:1,
4954c06356bSdh 	    sdr_inside_zpsds				:1,
4964c06356bSdh 	    sdr_zone_group_persistent			:1,
4974c06356bSdh 	    _reserved13					:1,
4984c06356bSdh 	    sdr_requested_inside_zpsds			:1,
4994c06356bSdh 	    sdr_inside_zpsds_persistent			:1,
5004c06356bSdh 	    sdr_requested_inside_zpsds_changed_by_exp	:1,
5014c06356bSdh 	    _reserved14					:1);
5024c06356bSdh 	uint8_t _reserved15[2];
5034c06356bSdh 	uint8_t sdr_zone_group;
5044c06356bSdh 	uint8_t sdr_self_config_status;
5054c06356bSdh 	uint8_t sdr_self_config_levels_completed;
5064c06356bSdh 	uint8_t _reserved16[2];
5074c06356bSdh 	uint64_t sdr_self_config_sas_addr;
5084c06356bSdh 	smp_snw3_phy_cap_t sdr_prog_phy_cap;
5094c06356bSdh 	smp_snw3_phy_cap_t sdr_current_phy_cap;
5104c06356bSdh 	smp_snw3_phy_cap_t sdr_attached_phy_cap;
5114c06356bSdh 	uint8_t _reserved17[6];
5124c06356bSdh 	DECL_BITFIELD2(
5134c06356bSdh 	    sdr_negotiated_phys_link_rate	:4,	/* smp_link_rate_t */
5144c06356bSdh 	    sdr_reason				:4);
5154c06356bSdh 	DECL_BITFIELD3(
5164c06356bSdh 	    sdr_hw_muxing_supported	:1,
5174c06356bSdh 	    sdr_negotiated_ssc		:1,
5184c06356bSdh 	    _reserved18			:6);
5194c06356bSdh 	DECL_BITFIELD7(
5204c06356bSdh 	    sdr_default_zoning_enabled		:1,
5214c06356bSdh 	    _reserved19				:1,
5224c06356bSdh 	    sdr_default_zone_group_persistent	:1,
5234c06356bSdh 	    _reserved20				:1,
5244c06356bSdh 	    sdr_default_requested_inside_zpsds	:1,
5254c06356bSdh 	    sdr_default_inside_zpsds_persistent	:1,
5264c06356bSdh 	    _reserved21				:2);
5274c06356bSdh 	uint8_t _reserved22[2];
5284c06356bSdh 	uint8_t sdr_default_zone_group;
5294c06356bSdh 	DECL_BITFIELD7(
5304c06356bSdh 	    sdr_saved_zoning_enabled		:1,
5314c06356bSdh 	    _reserved23				:1,
5324c06356bSdh 	    sdr_saved_zone_group_persistent	:1,
5334c06356bSdh 	    _reserved24				:1,
5344c06356bSdh 	    sdr_saved_requested_inside_zpsds	:1,
5354c06356bSdh 	    sdr_saved_inside_zpsds_persistent	:1,
5364c06356bSdh 	    _reserved25				:2);
5374c06356bSdh 	uint8_t _reserved26[2];
5384c06356bSdh 	uint8_t saved_zone_group;
5394c06356bSdh 	DECL_BITFIELD6(
5404c06356bSdh 	    _reserved27				:2,
5414c06356bSdh 	    sdr_shadow_zone_group_persistent	:1,
5424c06356bSdh 	    _reserved28				:1,
5434c06356bSdh 	    sdr_shadow_requested_inside_zpsds	:1,
5444c06356bSdh 	    sdr_shadow_inside_zpsds_persistent	:1,
5454c06356bSdh 	    _reserved29				:2);
5464c06356bSdh 	uint8_t _reserved30[2];
5474c06356bSdh 	uint8_t sdr_shadow_zone_group;
5484c06356bSdh } smp_discover_resp_t;
5494c06356bSdh 
5504c06356bSdh typedef enum smp_link_rate {
5514c06356bSdh 	SMP_LINK_RATE_NO_CHANGE = 0x0,
5524c06356bSdh 	SMP_LINK_RATE_DISABLED = 0x1,
5534c06356bSdh 	SMP_LINK_RATE_RESET_PROBLEM = 0x2,
5544c06356bSdh 	SMP_LINK_RATE_SPINUP_HOLD = 0x3,
5554c06356bSdh 	SMP_LINK_RATE_PORT_SELECTOR = 0x4,
5564c06356bSdh 	SMP_LINK_RATE_RESET = 0x5,
5574c06356bSdh 	SMP_LINK_RATE_UNSUPPORTED = 0x6,
5584c06356bSdh 	SMP_LINK_RATE_1_5 = 0x8,
5594c06356bSdh 	SMP_LINK_RATE_3 = 0x9,
5604c06356bSdh 	SMP_LINK_RATE_6 = 0xA
5614c06356bSdh } smp_link_rate_t;
5624c06356bSdh 
5634c06356bSdh typedef enum smp_device_type {
5644c06356bSdh 	SMP_DEV_NONE = 0x0,
5654c06356bSdh 	SMP_DEV_SAS_SATA = 0x1,
5664c06356bSdh 	SMP_DEV_EXPANDER = 0x2,
5674c06356bSdh 	SMP_DEV_EXPANDER_OLD = 0x3
5684c06356bSdh } smp_device_type_t;
5694c06356bSdh 
5704c06356bSdh typedef enum smp_routing_attr {
5714c06356bSdh 	SMP_ROUTING_DIRECT = 0x0,
5724c06356bSdh 	SMP_ROUTING_SUBTRACTIVE = 0x1,
5734c06356bSdh 	SMP_ROUTING_TABLE = 0x2
5744c06356bSdh } smp_routing_attr_t;
5754c06356bSdh 
5764c06356bSdh /*
5774c06356bSdh  * SAS-2 10.4.3.11 REPORT PHY ERROR LOG
5784c06356bSdh  */
5794c06356bSdh typedef struct smp_report_phy_error_log_req {
5804c06356bSdh 	uint8_t _reserved1[5];
5814c06356bSdh 	uint8_t srpelr_phy_identifier;
5824c06356bSdh 	uint8_t _reserved2[2];
5834c06356bSdh } smp_report_phy_error_log_req_t;
5844c06356bSdh 
5854c06356bSdh typedef struct smp_report_phy_error_log_resp {
5864c06356bSdh 	uint16_t srpelr_exp_change_count;
5874c06356bSdh 	uint8_t _reserved1[3];
5884c06356bSdh 	uint8_t srpelr_phy_identifier;
5894c06356bSdh 	uint8_t _reserved2[2];
5904c06356bSdh 	uint32_t srpelr_invalid_dword_count;
5914c06356bSdh 	uint32_t srpelr_running_disparity_error_count;
5924c06356bSdh 	uint32_t srpelr_loss_dword_sync_count;
5934c06356bSdh 	uint32_t srpelr_phy_reset_problem_count;
5944c06356bSdh } smp_report_phy_error_log_resp_t;
5954c06356bSdh 
5964c06356bSdh /*
5974c06356bSdh  * SAS-2 10.4.3.12 REPORT PHY SATA
5984c06356bSdh  */
5994c06356bSdh typedef struct smp_report_phy_sata_req {
6004c06356bSdh 	uint8_t _reserved1[5];
6014c06356bSdh 	uint8_t srpsr_phy_identifier;
6024c06356bSdh 	uint8_t srpsr_affiliation_context;
6034c06356bSdh 	uint8_t _reserved2;
6044c06356bSdh } smp_report_phy_sata_req_t;
6054c06356bSdh 
6064c06356bSdh typedef struct smp_report_phy_sata_resp {
6074c06356bSdh 	uint16_t srpsr_exp_change_count;
6084c06356bSdh 	uint8_t _reserved1[3];
6094c06356bSdh 	uint8_t srpsr_phy_identifier;
6104c06356bSdh 	uint8_t _reserved2;
6114c06356bSdh 	DECL_BITFIELD4(
6124c06356bSdh 	    srpsr_affiliation_valid		:1,
6134c06356bSdh 	    srpsr_affiliations_supported	:1,
6144c06356bSdh 	    srpsr_stp_nexus_loss		:1,
6154c06356bSdh 	    _reserved3				:5);
6164c06356bSdh 	uint8_t _reserved4[4];
6174c06356bSdh 	uint64_t srpsr_stp_sas_addr;
6184c06356bSdh 	uint8_t srpsr_register_device_host_fis[20];
6194c06356bSdh 	uint8_t _reserved5[4];
6204c06356bSdh 	uint64_t srpsr_affiliated_stp_init_sas_addr;
6214c06356bSdh 	uint64_t srpsr_stp_nexus_loss_sas_addr;
6224c06356bSdh 	uint8_t _reserved6;
6234c06356bSdh 	uint8_t srpsr_affiliation_context;
6244c06356bSdh 	uint8_t srpsr_current_affiliation_contexts;
6254c06356bSdh 	uint8_t srpsr_max_affiliation_contexts;
6264c06356bSdh } smp_report_phy_sata_resp_t;
6274c06356bSdh 
6284c06356bSdh /*
6294c06356bSdh  * SAS-2 10.4.3.13 REPORT ROUTE INFORMATION
6304c06356bSdh  */
6314c06356bSdh typedef struct smp_report_route_info_req {
6324c06356bSdh 	uint8_t _reserved1[2];
6334c06356bSdh 	uint16_t srrir_exp_route_index;
6344c06356bSdh 	uint8_t _reserved2;
6354c06356bSdh 	uint8_t srrir_phy_identifier;
6364c06356bSdh 	uint8_t _reserved3[2];
6374c06356bSdh } smp_report_route_info_req_t;
6384c06356bSdh 
6394c06356bSdh typedef struct smp_report_route_info_resp {
6404c06356bSdh 	uint16_t srrir_exp_change_count;
6414c06356bSdh 	uint16_t srrir_exp_route_index;
6424c06356bSdh 	uint8_t _reserved1;
6434c06356bSdh 	uint8_t srrir_phy_identifier;
6444c06356bSdh 	uint8_t _reserved2[2];
6454c06356bSdh 	DECL_BITFIELD2(
6464c06356bSdh 	    _reserved3				:7,
6474c06356bSdh 	    srrir_exp_route_entry_disabled	:1);
6484c06356bSdh 	uint8_t _reserved4[3];
6494c06356bSdh 	uint64_t srrir_routed_sas_addr;
6504c06356bSdh 	uint8_t _reserved5[16];
6514c06356bSdh } smp_report_route_info_resp_t;
6524c06356bSdh 
6534c06356bSdh /*
6544c06356bSdh  * SAS-2 10.4.3.14 SAS-2 REPORT PHY EVENT
6554c06356bSdh  */
656*d0698e0dSDavid Hollister typedef enum smp_phy_event_source {
657*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_NO_EVENT				= 0x00,
658*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_INVALID_DWORD_COUNT		= 0x01,
659*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RUNNING_DISPARITY_ERROR_COUNT	= 0x02,
660*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_LOSS_OF_DWORD_SYNC_COUNT		= 0x03,
661*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_PHY_RESET_PROBLEM_COUNT		= 0x04,
662*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_ELASTICITY_BUFFER_OVERFLOW_COUNT	= 0x05,
663*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_ERROR_COUNT			= 0x06,
664*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_ADDR_FRAME_ERROR_COUNT		= 0x20,
665*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_ABANDON_CLASS_OPEN_REJ_COUNT	= 0x21,
666*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_ABANDON_CLASS_OPEN_REJ_COUNT	= 0x22,
667*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_RETRY_CLASS_OPEN_REJ_COUNT	= 0x23,
668*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_RETRY_CLASS_OPEN_REJ_COUNT	= 0x24,
669*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_AIP_W_O_PARTIAL_COUNT		= 0x25,
670*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_AIP_W_O_CONN_COUNT		= 0x26,
671*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_BREAK_COUNT			= 0x27,
672*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_BREAK_COUNT			= 0x28,
673*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_BREAK_TIMEOUT_COUNT		= 0x29,
674*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_CONNECTION_COUNT			= 0x2A,
675*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_PEAK_TX_PATHWAY_BLOCKED_COUNT	= 0x2B,
676*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_PEAK_TX_ARB_WAIT_TIME		= 0x2C,
677*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_PEAK_ARB_TIME			= 0x2D,
678*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_PEAK_CONNECTION_TIME		= 0x2E,
679*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_SSP_FRAME_COUNT		= 0x40,
680*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_SSP_FRAME_COUNT		= 0x41,
681*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_SSP_FRAME_ERROR_COUNT		= 0x42,
682*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_SSP_FRAME_ERROR_COUNT		= 0x43,
683*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_CREDIT_BLOCKED_COUNT		= 0x44,
684*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_CREDIT_BLOCKED_COUNT		= 0x45,
685*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_SATA_FRAME_COUNT		= 0x50,
686*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_SATA_FRAME_COUNT		= 0x51,
687*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_SATA_FLOW_CTRL_BUF_OVERFLOW_COUNT	= 0x52,
688*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_TX_SMP_FRAME_COUNT		= 0x60,
689*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_SMP_FRAME_COUNT		= 0x61,
690*d0698e0dSDavid Hollister 	SMP_PHY_EVENT_RX_SMP_FRAME_ERROR_COUNT		= 0x63
691*d0698e0dSDavid Hollister } smp_phy_event_source_t;
692*d0698e0dSDavid Hollister 
6934c06356bSdh typedef struct smp_report_phy_event_req {
6944c06356bSdh 	uint8_t _reserved1;
6954c06356bSdh 	uint8_t _reserved2[4];
6964c06356bSdh 	uint8_t srper_phy_identifier;
6974c06356bSdh 	uint8_t _reserved3[2];
6984c06356bSdh } smp_report_phy_event_req_t;
6994c06356bSdh 
7004c06356bSdh typedef struct smp_phy_event_report_descr {
7014c06356bSdh 	uint8_t _reserved1[3];
7024c06356bSdh 	uint8_t sped_phy_event_source;
7034c06356bSdh 	uint32_t sped_phy_event;
7044c06356bSdh 	uint32_t sped_peak_detector_threshold;
7054c06356bSdh } smp_phy_event_report_descr_t;
7064c06356bSdh 
7074c06356bSdh typedef struct smp_report_phy_event_resp {
7084c06356bSdh 	uint16_t srper_exp_change_count;
7094c06356bSdh 	uint8_t _reserved1[3];
7104c06356bSdh 	uint8_t srper_phy_identifier;
7114c06356bSdh 	uint8_t _reserved2[5];
7124c06356bSdh 	uint8_t srper_n_phy_event_descrs;
7134c06356bSdh 	smp_phy_event_report_descr_t srper_phy_event_descrs[1];
7144c06356bSdh } smp_report_phy_event_resp_t;
7154c06356bSdh 
7164c06356bSdh /*
7174c06356bSdh  * SAS-2 10.4.3.15 SAS-2 DISCOVER LIST
7184c06356bSdh  */
7194c06356bSdh typedef struct smp_discover_list_req {
7204c06356bSdh 	uint8_t _reserved1[4];
7214c06356bSdh 	uint8_t sdlr_starting_phy_identifier;
7224c06356bSdh 	uint8_t sdlr_max_descrs;
7234c06356bSdh 	DECL_BITFIELD3(
7244c06356bSdh 	    sdlr_phy_filter		:4,
7254c06356bSdh 	    _reserved2			:3,
7264c06356bSdh 	    sdlr_ignore_zone_group	:1);
7274c06356bSdh 	DECL_BITFIELD2(
7284c06356bSdh 	    sdlr_descr_type		:4,
7294c06356bSdh 	    _reserved3			:4);
7304c06356bSdh 	uint8_t _reserved4[4];
7314c06356bSdh 	uint8_t sdlr_vendor[12];
7324c06356bSdh } smp_discover_list_req_t;
7334c06356bSdh 
7344c06356bSdh typedef struct smp_discover_short_descr {
7354c06356bSdh 	uint8_t sdsd_phy_identifier;
7364c06356bSdh 	uint8_t sdsd_function_result;
7374c06356bSdh 	DECL_BITFIELD3(
7384c06356bSdh 	    sdsd_attached_reason	:4,
7394c06356bSdh 	    sdsd_attached_device_type	:3,
7404c06356bSdh 	    _restricted1		:1);
7414c06356bSdh 	DECL_BITFIELD2(
7424c06356bSdh 	    sdsd_negotiated_logical_link_rate	:4,	/* smp_link_rate_t */
7434c06356bSdh 	    _restricted2			:4);
7444c06356bSdh 	DECL_BITFIELD5(
7454c06356bSdh 	    sdsd_attached_sata_host	:1,
7464c06356bSdh 	    sdsd_attached_smp_initiator	:1,
7474c06356bSdh 	    sdsd_attached_stp_initiator	:1,
7484c06356bSdh 	    sdsd_attached_ssp_initiator	:1,
7494c06356bSdh 	    _restricted3		:4);
750