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); 7504c06356bSdh DECL_BITFIELD6( 7514c06356bSdh sdsd_attached_sata_device :1, 7524c06356bSdh sdsd_attached_smp_target :1, 7534c06356bSdh sdsd_attached_stp_target :1, 7544c06356bSdh sdsd_attached_ssp_target :1, 7554c06356bSdh _restricted4 :3, 7564c06356bSdh sdsd_attached_sata_port_selector :1); 7574c06356bSdh DECL_BITFIELD3( 7584c06356bSdh sdsd_routing_attribute :4, /* smp_routing_attr_t */ 7594c06356bSdh _reserved1 :3, 7604c06356bSdh sdsd_virtual_phy :1); 7614c06356bSdh DECL_BITFIELD2( 7624c06356bSdh _reserved2 :4, 7634c06356bSdh sdsd_reason :4); 7644c06356bSdh uint8_t sdsd_zone_group; 7654c06356bSdh DECL_BITFIELD7( 7664c06356bSdh _reserved3 :1, 7674c06356bSdh sdsd_inside_zpsds :1, 7684c06356bSdh sdsd_zone_group_persistent :1, 7694c06356bSdh _reserved4 :1, 7704c06356bSdh sdsd_requested_insize_zpsds :1, 7714c06356bSdh sdsd_inside_zpsds_persistent :1, 7724c06356bSdh _restricted5 :2); 7734c06356bSdh uint8_t sdsd_attached_phy_identifier; 7744c06356bSdh uint8_t sdsd_phy_change_count; 7754c06356bSdh uint64_t sdsd_attached_sas_addr; 7764c06356bSdh uint8_t _reserved5[4]; 7774c06356bSdh } smp_discover_short_descr_t; 7784c06356bSdh 7794c06356bSdh typedef struct smp_discover_long_descr { 7804c06356bSdh uint8_t _reserved1[2]; 7814c06356bSdh uint8_t sdld_function_result; 7824c06356bSdh uint8_t _reserved2[1]; 7834c06356bSdh smp_discover_resp_t sdld_response; 7844c06356bSdh } smp_discover_long_descr_t; 7854c06356bSdh 7864c06356bSdh #define SMP_DISCOVER_RESP(_ld) \ 7874c06356bSdh (((smp_discover_long_descr_t *)(_ld))->sdld_function_result == \ 7884c06356bSdh SMP_FUNCTION_ACCEPTED ? \ 7894c06356bSdh &((smp_discover_long_descr_t *)(_ld))->sdld_response : \ 7904c06356bSdh NULL) 7914c06356bSdh 7924c06356bSdh typedef struct smp_discover_list_resp { 7934c06356bSdh uint16_t sdlr_exp_change_count; 7944c06356bSdh uint8_t _reserved1[2]; 7954c06356bSdh uint8_t sdlr_starting_phy_identifier; 7964c06356bSdh uint8_t sdlr_n_descrs; 7974c06356bSdh DECL_BITFIELD2( 7984c06356bSdh sdlr_phy_filter :4, 7994c06356bSdh _reserved2 :4); 8004c06356bSdh DECL_BITFIELD2( 8014c06356bSdh sdlr_descr_type :4, 8024c06356bSdh _reserved3 :4); 8034c06356bSdh uint8_t sdlr_descr_length; 8044c06356bSdh uint8_t _reserved4[3]; 8054c06356bSdh DECL_BITFIELD5( 8064c06356bSdh sdlr_externally_configurable_route_table :1, 8074c06356bSdh sdlr_configuring :1, 8084c06356bSdh _reserved5 :4, 8094c06356bSdh sdlr_zoning_enabled :1, 8104c06356bSdh sdlr_zoning_supported :1); 8114c06356bSdh uint8_t _reserved6; 8124c06356bSdh uint16_t sdlr_last_sc_status_descr_index; 8134c06356bSdh uint16_t sdlr_last_phy_event_list_descr_index; 8144c06356bSdh uint8_t _reserved7[10]; 8154c06356bSdh uint8_t sdlr_vendor[16]; 8164c06356bSdh uint8_t sdlr_descrs[1]; /* short or long format */ 8174c06356bSdh } smp_discover_list_resp_t; 8184c06356bSdh 8194c06356bSdh /* 8204c06356bSdh * SAS-2 10.4.3.16 REPORT PHY EVENT LIST 8214c06356bSdh */ 8224c06356bSdh typedef struct smp_report_phy_event_list_req { 8234c06356bSdh uint8_t _reserved1[2]; 8244c06356bSdh uint16_t srpelr_starting_descr_index; 8254c06356bSdh } smp_report_phy_event_list_req_t; 8264c06356bSdh 8274c06356bSdh typedef struct smp_phy_event_list_descr { 8284c06356bSdh uint8_t _reserved1[2]; 8294c06356bSdh uint8_t speld_phy_identifier; 8304c06356bSdh uint8_t speld_phy_event_source; 8314c06356bSdh uint32_t speld_phy_event; 8324c06356bSdh uint32_t speld_peak_detector_threshold; 8334c06356bSdh } smp_phy_event_list_descr_t; 8344c06356bSdh 8354c06356bSdh typedef struct smp_report_phy_event_list_resp { 8364c06356bSdh uint16_t srpelr_exp_change_count; 8374c06356bSdh uint16_t srpelr_starting_descr_index; 8384c06356bSdh uint16_t srpelr_last_descr_index; 8394c06356bSdh uint8_t srpelr_phy_event_list_descr_length; 8404c06356bSdh uint8_t _reserved1[3]; 8414c06356bSdh uint8_t srpelr_n_descrs; 8424c06356bSdh smp_phy_event_list_descr_t srpelr_descrs[1]; 8434c06356bSdh } smp_report_phy_event_list_resp_t; 8444c06356bSdh 8454c06356bSdh /* 8464c06356bSdh * SAS-2 10.4.3.17 REPORT EXPANDER ROUTE TABLE LIST 8474c06356bSdh */ 8484c06356bSdh typedef struct smp_report_exp_route_table_list_req { 8494c06356bSdh uint8_t _reserved1[4]; 8504c06356bSdh uint16_t srertlr_max_descrs; 8514c06356bSdh uint16_t srertlr_starting_routed_sas_addr_index; 8524c06356bSdh uint8_t _reserved2[7]; 8534c06356bSdh uint8_t srertlr_starting_phy_identifier; 8544c06356bSdh uint8_t _reserved3[8]; 8554c06356bSdh } smp_report_exp_route_table_list_req_t; 8564c06356bSdh 8574c06356bSdh typedef struct smp_route_table_descr { 8584c06356bSdh uint64_t srtd_routed_sas_addr; 8594c06356bSdh uint8_t srtd_phy_bitmap[6]; 8604c06356bSdh DECL_BITFIELD2( 8614c06356bSdh _reserved1 :7, 8624c06356bSdh srtd_zone_group_valid :1); 8634c06356bSdh uint8_t srtd_zone_group; 8644c06356bSdh } smp_route_table_descr_t; 8654c06356bSdh 8664c06356bSdh #define SMP_ROUTE_PHY(_d, _s, _i) \ 8674c06356bSdh ((_d)->srtd_phy_bitmap[(48 - (_i) + (_s)) >> 3] & \ 8684c06356bSdh (1 << ((48 - (_i) + (_s)) & 7))) 8694c06356bSdh 8704c06356bSdh typedef struct smp_report_exp_route_table_list_resp { 8714c06356bSdh uint16_t srertlr_exp_change_count; 8724c06356bSdh uint16_t srertlr_route_table_change_count; 873*d0698e0dSDavid Hollister DECL_BITFIELD5( 874*d0698e0dSDavid Hollister srertlr_zoning_enabled :1, 875*d0698e0dSDavid Hollister srertlr_configuring :1, 876*d0698e0dSDavid Hollister srertlr_zone_configuring :1, 877*d0698e0dSDavid Hollister srertlr_self_configuring :1, 878*d0698e0dSDavid Hollister _reserved2 :4); 8794c06356bSdh uint8_t _reserved3; 880*d0698e0dSDavid Hollister uint8_t srertlr_descr_length; 881*d0698e0dSDavid Hollister uint8_t srertlr_n_descrs; 8824c06356bSdh uint16_t srertlr_first_routed_sas_addr_index; 8834c06356bSdh uint16_t srertlr_last_routed_sas_addr_index; 8844c06356bSdh uint8_t _reserved4[3]; 8854c06356bSdh uint8_t srertlr_starting_phy_identifier; 8864c06356bSdh uint8_t _reserved5[12]; 8874c06356bSdh smp_route_table_descr_t srertlr_descrs[1]; 8884c06356bSdh } smp_report_exp_route_table_list_resp_t; 8894c06356bSdh 8904c06356bSdh /* 8914c06356bSdh * SAS-2 10.4.3.18 CONFIGURE GENERAL (no additional response) 8924c06356bSdh */ 8934c06356bSdh typedef struct smp_config_general_req { 8944c06356bSdh uint16_t scgr_expected_exp_change_count; 8954c06356bSdh uint8_t _reserved1[2]; 8964c06356bSdh DECL_BITFIELD6( 8974c06356bSdh scgr_update_stp_bus_inactivity :1, 8984c06356bSdh scgr_update_stp_max_conn :1, 8994c06356bSdh scgr_update_stp_smp_nexus_loss :1, 9004c06356bSdh scgr_update_initial_time_to_reduced_functionality :1, 9014c06356bSdh scgr_update_stp_reject_to_open :1, 9024c06356bSdh _reserved2 :3); 9034c06356bSdh uint8_t _reserved3; 9044c06356bSdh uint16_t scgr_stp_bus_inactivity; 9054c06356bSdh uint16_t scgr_stp_max_conn; 9064c06356bSdh uint16_t scgr_stp_smp_nexus_loss; 9074c06356bSdh uint8_t scgr_initial_time_to_reduced_functionality; 9084c06356bSdh uint8_t _reserved4; 9094c06356bSdh uint16_t scgr_stp_reject_to_open; 9104c06356bSdh } smp_config_general_req_t; 9114c06356bSdh 9124c06356bSdh /* 9134c06356bSdh * SAS-2 10.4.3.19 ENABLE DISABLE ZONING (no additional response) 9144c06356bSdh */ 9154c06356bSdh typedef struct smp_enable_disable_zoning_req { 9164c06356bSdh uint16_t sedzr_expected_exp_change_count; 9174c06356bSdh DECL_BITFIELD2( 9184c06356bSdh sedzr_save :2, /* smp_zoning_save_t */ 9194c06356bSdh _reserved1 :6); 9204c06356bSdh uint8_t _reserved2; 9214c06356bSdh DECL_BITFIELD2( 9224c06356bSdh sedzr_enable_disable_zoning :2, 9234c06356bSdh _reserved3 :6); 9244c06356bSdh uint8_t _reserved4[3]; 9254c06356bSdh } smp_enable_disable_zoning_req_t; 9264c06356bSdh 9274c06356bSdh typedef enum smp_zoning_save { 9284c06356bSdh SMP_ZONING_SAVE_CURRENT = 0x0, 9294c06356bSdh SMP_ZONING_SAVE_SAVED = 0x1, 9304c06356bSdh SMP_ZONING_SAVE_BOTH_IF_SUPP = 0x2, 9314c06356bSdh SMP_ZONING_SAVE_BOTH = 0x3 9324c06356bSdh } smp_zoning_save_t; 9334c06356bSdh 9344c06356bSdh typedef enum smp_zoning_enable_op { 9354c06356bSdh SMP_ZONING_ENABLE_OP_NONE = 0x0, 9364c06356bSdh SMP_ZONING_ENABLE_OP_ENABLE = 0x1, 9374c06356bSdh SMP_ZONING_ENABLE_OP_DISABLE = 0x2 9384c06356bSdh } smp_zoning_enable_op_t; 9394c06356bSdh 9404c06356bSdh /* 9414c06356bSdh * SAS-2 10.4.3.20 ZONED BROADCAST (no additional response) 9424c06356bSdh */ 9434c06356bSdh typedef struct smp_zoned_broadcast_req { 9444c06356bSdh uint8_t _restricted1[2]; 9454c06356bSdh DECL_BITFIELD2( 9464c06356bSdh szbr_broadcast_type :4, 9474c06356bSdh _reserved :4); 9484c06356bSdh uint8_t szbr_n_broadcast_source_zone_groups; 9494c06356bSdh uint8_t szbr_broadcast_source_zone_groups[1]; 9504c06356bSdh } smp_zoned_broadcast_req_t; 9514c06356bSdh 9524c06356bSdh /* 9534c06356bSdh * SAS-2 10.4.3.21 ZONE LOCK 9544c06356bSdh */ 9554c06356bSdh typedef struct smp_zone_lock_req { 9564c06356bSdh uint16_t szlr_expected_exp_change_count; 9574c06356bSdh uint16_t szlr_zone_lock_inactivity_timeout; 9584c06356bSdh uint8_t szlr_zone_manager_password[32]; 9594c06356bSdh } smp_zone_lock_req_t; 9604c06356bSdh 9614c06356bSdh typedef struct smp_zone_lock_resp { 9624c06356bSdh uint8_t _reserved1[4]; 9634c06356bSdh uint64_t szlr_active_zone_manager_sas_addr; 9644c06356bSdh } smp_zone_lock_resp_t; 9654c06356bSdh 9664c06356bSdh /* 9674c06356bSdh * SAS-2 10.4.3.22 ZONE ACTIVATE (no additional response) 9684c06356bSdh */ 9694c06356bSdh typedef struct smp_zone_activate_req { 9704c06356bSdh uint16_t szar_expected_exp_change_count; 9714c06356bSdh uint8_t _reserved1[2]; 9724c06356bSdh } smp_zone_activate_req_t; 9734c06356bSdh 9744c06356bSdh /* 9754c06356bSdh * SAS-2 10.4.3.23 ZONE UNLOCK (no additional response) 9764c06356bSdh */ 9774c06356bSdh typedef struct smp_zone_unlock_req { 9784c06356bSdh uint8_t _restricted1[2]; 9794c06356bSdh DECL_BITFIELD2( 9804c06356bSdh szur_activate_required :1, 9814c06356bSdh _reserved1 :7); 9824c06356bSdh uint8_t _reserved2; 9834c06356bSdh } smp_zone_unlock_req_t; 9844c06356bSdh 9854c06356bSdh /* 9864c06356bSdh * SAS-2 10.4.3.24 CONFIGURE ZONE MANAGER PASSWORD (no additional response) 9874c06356bSdh */ 9884c06356bSdh typedef struct smp_config_zone_manager_password_req { 9894c06356bSdh uint16_t sczmpr_expected_exp_change_count; 9904c06356bSdh DECL_BITFIELD2( 9914c06356bSdh sczmpr_save :2, /* smp_zoning_save_t */ 9924c06356bSdh _reserved1 :6); 9934c06356bSdh uint8_t _reserved2; 9944c06356bSdh uint8_t sczmpr_zone_manager_password[32]; 9954c06356bSdh uint8_t sczmpr_new_zone_manager_password[32]; 9964c06356bSdh } smp_config_zone_manager_password_req_t; 9974c06356bSdh 9984c06356bSdh /* 9994c06356bSdh * SAS-2 10.4.3.25 CONFIGURE ZONE PHY INFORMATION (no additional response) 10004c06356bSdh */ 10014c06356bSdh typedef struct smp_zone_phy_config_descr { 10024c06356bSdh uint8_t szpcd_phy_identifier; 10034c06356bSdh DECL_BITFIELD6( 10044c06356bSdh _reserved1 :2, 10054c06356bSdh szpcd_zone_group_persistent :1, 10064c06356bSdh _reserved2 :1, 10074c06356bSdh szpcd_requested_inside_zpsds :1, 10084c06356bSdh szpcd_inside_zpsds_persistent :1, 10094c06356bSdh _reserved3 :2); 10104c06356bSdh uint8_t _reserved4; 10114c06356bSdh uint8_t szpcd_zone_group; 10124c06356bSdh } smp_zone_phy_config_descr_t; 10134c06356bSdh 10144c06356bSdh typedef struct smp_config_zone_phy_info_req { 10154c06356bSdh uint16_t sczpir_expected_exp_change_count; 10164c06356bSdh DECL_BITFIELD2( 10174c06356bSdh sczpir_save :2, /* smp_zoning_save_t */ 10184c06356bSdh _reserved1 :6); 10194c06356bSdh uint8_t sczpir_n_descrs; 10204c06356bSdh smp_zone_phy_config_descr_t sczpir_descrs[1]; 10214c06356bSdh } smp_config_zone_phy_info_req_t; 10224c06356bSdh 10234c06356bSdh /* 10244c06356bSdh * SAS-2 10.4.3.26 CONFIGURE ZONE PERMISSION TABLE (no additional response) 10254c06356bSdh */ 10264c06356bSdh typedef struct smp_config_zone_perm_table_req { 10274c06356bSdh uint16_t sczptr_expected_exp_change_count; 10284c06356bSdh uint8_t sczptr_starting_source_zone_group; 10294c06356bSdh uint8_t sczptr_n_descrs; 10304c06356bSdh DECL_BITFIELD3( 10314c06356bSdh sczptr_save :2, /* smp_zoning_save_t */ 10324c06356bSdh _reserved1 :4, 10334c06356bSdh sczptr_n_zone_groups :2); /* smp_n_zone_grps_t */ 10344c06356bSdh uint8_t _reserved2[7]; 10354c06356bSdh uint8_t sczptr_descrs[1]; /* smp_zone_perm_descrXXX_t */ 10364c06356bSdh } smp_config_zone_perm_table_req_t; 10374c06356bSdh 10384c06356bSdh /* 10394c06356bSdh * SAS-2 10.4.3.27 CONFIGURE ROUTE INFORMATION (no additional response) 10404c06356bSdh */ 10414c06356bSdh typedef struct smp_config_route_info_req { 10424c06356bSdh uint16_t scrir_expected_exp_change_count; 10434c06356bSdh uint16_t scrir_exp_route_index; 10444c06356bSdh uint8_t _reserved1; 10454c06356bSdh uint8_t scrir_phy_identifier; 10464c06356bSdh uint8_t _reserved2[2]; 10474c06356bSdh DECL_BITFIELD2( 10484c06356bSdh _reserved3 :7, 10494c06356bSdh scrir_disable_exp_route_entry :1); 10504c06356bSdh uint8_t _reserved4[3]; 10514c06356bSdh uint64_t scrir_routed_sas_addr; 10524c06356bSdh uint8_t _reserved5[16]; 10534c06356bSdh } smp_config_route_info_req_t; 10544c06356bSdh 10554c06356bSdh /* 10564c06356bSdh * SAS-2 10.4.3.28 PHY CONTROL (no additional response) 10574c06356bSdh */ 10584c06356bSdh typedef struct smp_phy_control_req { 10594c06356bSdh uint16_t spcr_expected_exp_change_count; 10604c06356bSdh uint8_t _reserved1[3]; 10614c06356bSdh uint8_t spcr_phy_identifier; 10624c06356bSdh uint8_t spcr_phy_operation; 10634c06356bSdh DECL_BITFIELD2( 10644c06356bSdh spcr_update_partial_pwy_timeout :1, 10654c06356bSdh _reserved2 :7); 10664c06356bSdh uint8_t _reserved3[12]; 10674c06356bSdh uint64_t spcr_attached_device_name; 10684c06356bSdh DECL_BITFIELD2( 10694c06356bSdh _reserved4 :4, 10704c06356bSdh spcr_prog_min_phys_link_rate :4); /* smp_link_rate_t */ 10714c06356bSdh DECL_BITFIELD2( 10724c06356bSdh _reserved5 :4, 10734c06356bSdh spcr_prog_max_phys_link_rate :4); /* smp_link_rate_t */ 10744c06356bSdh uint8_t _reserved6[2]; 10754c06356bSdh DECL_BITFIELD2( 10764c06356bSdh spcr_partial_pwy_timeout :4, 10774c06356bSdh _reserved7 :4); 10784c06356bSdh uint8_t _reserved8[3]; 10794c06356bSdh } smp_phy_control_req_t; 10804c06356bSdh 10814c06356bSdh typedef enum smp_phy_op { 10824c06356bSdh SMP_PHY_OP_NOP = 0x00, 10834c06356bSdh SMP_PHY_OP_LINK_RESET = 0x01, 10844c06356bSdh SMP_PHY_OP_HARD_RESET = 0x02, 10854c06356bSdh SMP_PHY_OP_DISABLE = 0x03, 10864c06356bSdh SMP_PHY_OP_CLEAR_ERROR_LOG = 0x05, 10874c06356bSdh SMP_PHY_OP_CLEAR_AFFILIATION = 0x06, 10884c06356bSdh SMP_PHY_OP_TRANSMIT_SATA_PORT_SELECTION_SIGNAL = 0x07, 10894c06356bSdh SMP_PHY_OP_CLEAR_STP_NEXUS_LOSS = 0x08, 10904c06356bSdh SMP_PHY_OP_SET_ATTACHED_DEVICE_NAME = 0x09 10914c06356bSdh } smp_phy_op_t; 10924c06356bSdh 10934c06356bSdh /* 10944c06356bSdh * SAS-2 10.4.3.29 PHY TEST FUNCTION (no additional response) 10954c06356bSdh */ 10964c06356bSdh typedef struct smp_phy_test_function_req { 10974c06356bSdh uint16_t sptfr_expected_exp_change_count; 10984c06356bSdh uint8_t _reserved1[3]; 10994c06356bSdh uint8_t sptfr_phy_identifier; 11004c06356bSdh uint8_t sptfr_phy_test_function; 11014c06356bSdh uint8_t sptfr_phy_test_pattern; /* smp_phy_test_function_t */ 11024c06356bSdh uint8_t _reserved2[3]; 11034c06356bSdh DECL_BITFIELD4( 11044c06356bSdh sptfr_test_pattern_phys_link_rate :4, /* smp_link_rate_t */ 11054c06356bSdh sptfr_test_pattern_ssc :2, 11064c06356bSdh sptfr_test_pattern_sata :1, 11074c06356bSdh _reserved3 :1); 11084c06356bSdh uint8_t _reserved4[3]; 11094c06356bSdh uint8_t sptfr_phy_test_pattern_dwords_ctl; 11104c06356bSdh uint8_t sptfr_phy_test_pattern_dwords[8]; 11114c06356bSdh uint8_t _reserved5[12]; 11124c06356bSdh } smp_phy_test_function_req_t; 11134c06356bSdh 11144c06356bSdh typedef enum smp_phy_test_function { 11154c06356bSdh SMP_PHY_TEST_FN_STOP = 0x00, 11164c06356bSdh SMP_PHY_TEST_FN_TRANSMIT_PATTERN = 0x01 11174c06356bSdh } smp_phy_test_function_t; 11184c06356bSdh 11194c06356bSdh /* 11204c06356bSdh * SAS-2 10.4.3.30 CONFIGURE PHY EVENT (no additional response) 11214c06356bSdh */ 11224c06356bSdh typedef struct smp_phy_event_config_descr { 11234c06356bSdh uint8_t _reserved1[3]; 11244c06356bSdh uint8_t specd_phy_event_source; 11254c06356bSdh uint32_t specd_peak_value_detector_threshold; 11264c06356bSdh } smp_phy_event_config_descr_t; 11274c06356bSdh 11284c06356bSdh typedef struct smp_config_phy_event_req { 11294c06356bSdh uint16_t scper_expected_exp_change_count; 11304c06356bSdh DECL_BITFIELD2( 11314c06356bSdh scper_clear_peaks :1, 11324c06356bSdh _reserved1 :7); 11334c06356bSdh uint8_t _reserved2[2]; 11344c06356bSdh uint8_t scper_phy_identifier; 11354c06356bSdh uint8_t _reserved3; 11364c06356bSdh uint8_t scper_n_descrs; 11374c06356bSdh smp_phy_event_config_descr_t scper_descrs[1]; 11384c06356bSdh } smp_config_phy_event_req_t; 11394c06356bSdh 1140936b7af6Sjw #pragma pack() 1141936b7af6Sjw 1142936b7af6Sjw #ifdef __cplusplus 1143936b7af6Sjw } 1144936b7af6Sjw #endif 1145936b7af6Sjw 11464c06356bSdh #endif /* _SYS_SCSI_GENERIC_SMP_FRAMES_H */ 1147