xref: /illumos-gate/usr/src/uts/common/sys/scsi/generic/smp_frames.h (revision 8c69cc8fbe729fa7b091e901c4b50508ccc6bb33)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef _SYS_SCSI_GENERIC_SMP_FRAMES_H
26 #define	_SYS_SCSI_GENERIC_SMP_FRAMES_H
27 
28 #ifdef	__cplusplus
29 extern "C" {
30 #endif
31 
32 #include <sys/sysmacros.h>
33 
34 /*
35  * The definitions of smp frame types and functions conforming to SAS-1.1 and
36  * SAS-2.  Consumers are expected to determine protocol support by examining
37  * the response to the REPORT GENERAL function.
38  */
39 
40 typedef enum smp_frame_type {
41 	SMP_FRAME_TYPE_REQUEST		= 0x40,
42 	SMP_FRAME_TYPE_RESPONSE		= 0x41
43 } smp_frame_type_t;
44 
45 typedef enum smp_function {
46 	SMP_FUNC_REPORT_GENERAL			= 0x00,
47 	SMP_FUNC_REPORT_MANUFACTURER_INFO	= 0x01,
48 	SMP_FUNC_READ_GPIO_REGISTER		= 0x02,
49 	SMP_FUNC_REPORT_SELF_CONFIG_STATUS	= 0x03,
50 	SMP_FUNC_REPORT_ZONE_PERM_TABLE		= 0x04,
51 	SMP_FUNC_REPORT_ZONE_MANAGER_PASSWORD	= 0x05,
52 	SMP_FUNC_REPORT_BROADCAST		= 0x06,
53 	SMP_FUNC_DISCOVER			= 0x10,
54 	SMP_FUNC_REPORT_PHY_ERROR_LOG		= 0x11,
55 	SMP_FUNC_REPORT_PHY_SATA		= 0x12,
56 	SMP_FUNC_REPORT_ROUTE_INFO		= 0x13,
57 	SMP_FUNC_REPORT_PHY_EVENT		= 0x14,
58 	SMP_FUNC_DISCOVER_LIST			= 0x20,
59 	SMP_FUNC_REPORT_PHY_EVENT_LIST		= 0x21,
60 	SMP_FUNC_REPORT_EXP_ROUTE_TABLE_LIST	= 0x22,
61 	SMP_FUNC_CONFIG_GENERAL			= 0x80,
62 	SMP_FUNC_ENABLE_DISABLE_ZONING		= 0x81,
63 	SMP_FUNC_WRITE_GPIO_REGISTER		= 0x82,
64 	SMP_FUNC_ZONED_BROADCAST		= 0x85,
65 	SMP_FUNC_ZONE_LOCK			= 0x86,
66 	SMP_FUNC_ZONE_ACTIVATE			= 0x87,
67 	SMP_FUNC_ZONE_UNLOCK			= 0x88,
68 	SMP_FUNC_CONFIG_ZONE_MANAGER_PASSWORD	= 0x89,
69 	SMP_FUNC_CONFIG_ZONE_PHY_INFO		= 0x8A,
70 	SMP_FUNC_CONFIG_ZONE_PERM_TABLE		= 0x8B,
71 	SMP_FUNC_CONFIG_ROUTE_INFO		= 0x90,
72 	SMP_FUNC_PHY_CONTROL			= 0x91,
73 	SMP_FUNC_PHY_TEST_FUNCTION		= 0x92,
74 	SMP_FUNC_CONFIG_PHY_EVENT		= 0x93
75 } smp_function_t;
76 
77 typedef enum smp_result {
78 	SMP_RES_FUNCTION_ACCEPTED		= 0x00,
79 	SMP_RES_UNKNOWN_FUNCTION		= 0x01,
80 	SMP_RES_FUNCTION_FAILED			= 0x02,
81 	SMP_RES_INVALID_REQUEST_FRAME_LENGTH	= 0x03,
82 	SMP_RES_INVALID_EXPANDER_CHANGE_COUNT	= 0x04,
83 	SMP_RES_BUSY				= 0x05,
84 	SMP_RES_INCOMPLETE_DESCRIPTOR_LIST	= 0x06,
85 	SMP_RES_PHY_DOES_NOT_EXIST		= 0x10,
86 	SMP_RES_INDEX_DOES_NOT_EXIST		= 0x11,
87 	SMP_RES_PHY_DOES_NOT_SUPPORT_SATA	= 0x12,
88 	SMP_RES_UNKNOWN_PHY_OPERATION		= 0x13,
89 	SMP_RES_UNKNOWN_PHY_TEST_FUNCTION	= 0x14,
90 	SMP_RES_PHY_TEST_IN_PROGRESS		= 0x15,
91 	SMP_RES_PHY_VACANT			= 0x16,
92 	SMP_RES_UNKNOWN_PHY_EVENT_SOURCE	= 0x17,
93 	SMP_RES_UNKNOWN_DESCRIPTOR_TYPE		= 0x18,
94 	SMP_RES_UNKNOWN_PHY_FILTER		= 0x19,
95 	SMP_RES_AFFILIATION_VIOLATION		= 0x1A,
96 	SMP_RES_ZONE_VIOLATION			= 0x20,
97 	SMP_RES_NO_MANAGEMENT_ACCESS_RIGHTS	= 0x21,
98 	SMP_RES_UNKNOWN_ENABLE_DISABLE_ZONING	= 0x22,
99 	SMP_RES_ZONE_LOCK_VIOLATION		= 0x23,
100 	SMP_RES_NOT_ACTIVATED			= 0x24,
101 	SMP_RES_ZONE_GROUP_OUT_OF_RANGE		= 0x25,
102 	SMP_RES_NO_PHYSICAL_PRESENCE		= 0x26,
103 	SMP_RES_SAVING_NOT_SUPPORTED		= 0x27,
104 	SMP_RES_SOURCE_ZONE_GROUP_DNE		= 0x28,
105 	SMP_RES_DISABLED_PW_NOT_SUPPORTED	= 0x29,
106 	SMP_RES_NONE				= -1
107 } smp_result_t;
108 
109 #pragma	pack(1)
110 
111 /*
112  * SAS-2 10.4.3.2 request frame format
113  */
114 typedef struct smp_request_frame {
115 	uint8_t srf_frame_type;
116 	uint8_t srf_function;
117 	uint8_t srf_allocated_response_len;	/* reserved in SAS-1 */
118 	uint8_t srf_request_len;
119 	uint8_t srf_data[1];
120 } smp_request_frame_t;
121 
122 /*
123  * SAS-2 10.4.3.3 response frame format
124  */
125 typedef struct smp_response_frame {
126 	uint8_t srf_frame_type;
127 	uint8_t srf_function;
128 	uint8_t srf_result;
129 	uint8_t srf_response_len;	/* reserved in SAS-1 */
130 	uint8_t srf_data[1];
131 } smp_response_frame_t;
132 
133 typedef uint8_t smp_crc_t[4];
134 
135 #ifdef offsetof
136 #define	SMP_REQ_MINLEN	\
137 	(offsetof(smp_request_frame_t, srf_data[0]) + sizeof (smp_crc_t))
138 #define	SMP_RESP_MINLEN	\
139 	(offsetof(smp_response_frame_t, srf_data[0]) + sizeof (smp_crc_t))
140 #endif	/* offsetof */
141 
142 /*
143  * SAS-2 10.4.3.4 REPORT GENERAL (no additional request bytes)
144  */
145 typedef struct smp_report_general_resp {
146 	uint16_t srgr_exp_change_count;
147 	uint16_t srgr_exp_route_indexes;
148 	DECL_BITFIELD2(
149 	    _reserved1		:7,
150 	    srgr_long_response	:1);
151 	uint8_t srgr_number_of_phys;
152 	DECL_BITFIELD7(
153 	    srgr_externally_configurable_route_table	:1,
154 	    srgr_configuring				:1,
155 	    srgr_configures_others			:1,
156 	    srgr_open_reject_retry_supported		:1,
157 	    srgr_stp_continue_awt			:1,
158 	    _reserved2					:2,
159 	    srgr_table_to_table_supported		:1);
160 	uint8_t _reserved3;
161 	uint64_t srgr_enclosure_logical_identifier;
162 	uint8_t _reserved4[8];
163 	uint8_t _reserved5[2];
164 	uint16_t srgr_stp_bus_inactivity_time_limit;
165 	uint16_t srgr_stp_maximum_connect_time_limit;
166 	uint16_t srgr_stp_smp_nexus_loss_time;
167 	DECL_BITFIELD7(
168 	    srgr_zoning_enabled				:1,
169 	    srgr_zoning_supported			:1,
170 	    srgr_physical_presence_asserted		:1,
171 	    srgr_physical_presence_supported		:1,
172 	    srgr_zone_locked				:1,
173 	    _reserved6					:1,
174 	    srgr_number_of_zone_grps			:2);
175 	DECL_BITFIELD6(
176 	    srgr_saving_zoning_enabled_supported	:1,
177 	    srgr_saving_zone_perm_table_supported	:1,
178 	    srgr_saving_zone_phy_info_supported		:1,
179 	    srgr_saving_zone_mgr_password_supported	:1,
180 	    srgr_saving					:1,
181 	    _reserved7					:3);
182 	uint16_t srgr_max_routed_sas_addrs;
183 	uint64_t srgr_active_zm_sas_addr;
184 	uint16_t srgr_zone_lock_inactivity_limit;
185 	uint8_t _reserved8[2];
186 	uint8_t _reserved9;
187 	uint8_t srgr_first_encl_conn_elem_idx;
188 	uint8_t srgr_number_encl_conn_elem_idxs;
189 	uint8_t _reserved10;
190 	DECL_BITFIELD2(
191 	    _reserved11					:7,
192 	    srgr_reduced_functionality			:1);
193 	uint8_t srgr_time_to_reduced_functionality;
194 	uint8_t srgr_initial_time_to_reduced_functionality;
195 	uint8_t srgr_max_reduced_functionality_time;
196 	uint16_t srgr_last_self_conf_status_descr_idx;
197 	uint16_t srgr_max_stored_self_config_status_descrs;
198 	uint16_t srgr_last_phy_event_list_descr_idx;
199 	uint16_t srgr_max_stored_phy_event_list_descrs;
200 	uint16_t srgr_stp_reject_to_open_limit;
201 	uint8_t _reserved12[2];
202 } smp_report_general_resp_t;
203 
204 typedef enum smp_n_zone_grps {
205 	SMP_ZONE_GROUPS_128	= 0x0,
206 	SMP_ZONE_GROUPS_256	= 0x1
207 } smp_n_zone_grps_t;
208 
209 /*
210  * SAS-2 10.4.3.5 REPORT MANUFACTURER INFORMATION (no additional request bytes)
211  */
212 typedef struct smp_report_manufacturer_info_resp {
213 	uint16_t srmir_exp_change_count;
214 	uint8_t _reserved1[2];
215 	DECL_BITFIELD2(
216 	    srmir_sas_1_1_format	:1,
217 	    _reserved2			:7);
218 	uint8_t _reserved3[3];
219 	char srmir_vendor_identification[8];
220 	char srmir_product_identification[16];
221 	char srmir_product_revision_level[4];
222 	char srmir_component_vendor_identification[8];
223 	uint16_t srmir_component_id;
224 	uint8_t srmir_component_revision_level;
225 	uint8_t _reserved4;
226 	uint8_t srmir_vs_52[8];
227 } smp_report_manufacturer_info_resp_t;
228 
229 /*
230  * SAS-2 10.4.3.6 REPORT SELF_CONFIGURATION STATUS
231  */
232 typedef struct smp_report_self_config_status_req {
233 	uint8_t _reserved1[2];
234 	uint16_t srscsr_starting_self_config_status_descr_idx;
235 } smp_report_self_config_status_req_t;
236 
237 typedef struct smp_report_self_config_status_resp {
238 	uint16_t srscsr_exp_change_count;
239 	uint16_t srscsr_starting_self_config_status_descr_idx;
240 	uint16_t srscsr_number_self_config_status_descrs;
241 	uint16_t srscsr_last_self_config_status_descr_idx;
242 	uint8_t srscsr_self_config_status_descr_len;
243 	uint8_t _reserved1[3];
244 	uint8_t srscsr_descrs[1];
245 } smp_report_self_config_status_resp_t;
246 
247 typedef struct smp_self_config_status_descr {
248 	uint8_t sscsd_status_type;
249 	DECL_BITFIELD2(
250 	    sscsd_final		:1,
251 	    _reserved1		:7);
252 	uint8_t _reserved2;
253 	uint8_t sscsd_phy_identifier;
254 	uint8_t _reserved3[4];
255 	uint64_t sscsd_sas_addr;
256 } smp_self_config_status_descr_t;
257 
258 typedef enum smp_self_config_status_type {
259 	SMP_SCST_NONSPECIFIC_ERROR	= 0x01,
260 	SMP_SCST_CONNECTION		= 0x02,
261 	SMP_SCST_ROUTE_TABLE_FULL	= 0x03,
262 	SMP_SCST_NOMEM			= 0x04,
263 	SMP_SCST_PHY_LAYER_ERROR	= 0x20,
264 	SMP_SCST_LOST_SYNC		= 0x21,
265 	SMP_SCST_LINK_LAYER_ERROR	= 0x40,
266 	SMP_SCST_OPEN_TIMEOUT		= 0x41,
267 	SMP_SCST_ABANDON_OPEN_REJECT	= 0x42,
268 	SMP_SCST_RETRY_OPEN_REJECTS	= 0x43,
269 	SMP_SCST_NEXUS_LOSS		= 0x44,
270 	SMP_SCST_BREAK			= 0x45,
271 	SMP_SCST_CRC_ERROR		= 0x46,
272 	SMP_SCST_PORT_LAYER_ERROR	= 0x60,
273 	SMP_SCST_RESPONSE_TIMEOUT	= 0x61,
274 	SMP_SCST_TRANSPORT_LAYER_ERROR	= 0x80,
275 	SMP_SCST_APP_LAYER_ERROR	= 0xA0,
276 	SMP_SCST_RESPONSE_TOO_SHORT	= 0xA1,
277 	SMP_SCST_UNSUPPORTED_VALUES	= 0xA2,
278 	SMP_SCST_INCONSISTENT		= 0xA3,
279 	SMP_SCST_CONFIGURING		= 0xA4
280 } smp_self_config_status_type_t;
281 
282 /*
283  * SAS-2 10.4.3.7 REPORT ZONE PERMISSION TABLE
284  */
285 typedef struct smp_report_zone_perm_table_req {
286 	DECL_BITFIELD2(
287 	    srzptr_report_type		:2,
288 	    _reserved1			:6);
289 	uint8_t _reserved2;
290 	uint8_t srzptr_starting_src_zone_grp;
291 	uint8_t srzptr_max_zone_perm_descrs;
292 } smp_report_zone_perm_table_req_t;
293 
294 typedef enum smp_zone_perm_table_report_type {
295 	SMP_ZPTRT_CURRENT		= 0x0,
296 	SMP_ZPTRT_SHADOW		= 0x1,
297 	SMP_ZPTRT_SAVED			= 0x2,
298 	SMP_ZPTRT_DEFAULT		= 0x3
299 } smp_zone_perm_table_report_type_t;
300 
301 typedef struct smp_report_zone_perm_table_resp {
302 	uint16_t srzptr_exp_change_count;
303 	DECL_BITFIELD3(
304 	    srzptr_report_type		:2,
305 	    _reserved1			:5,
306 	    srzptr_zone_locked		:1);
307 	DECL_BITFIELD2(
308 	    _reserved2			:6,
309 	    srzptr_number_zone_grps	:2);
310 	uint8_t _reserved3[6];
311 	uint8_t srzptr_starting_src_zone_grp;
312 	uint8_t srzptr_number_zone_perm_descrs;
313 	uint8_t srzptr_descrs[1];
314 } smp_report_zone_perm_table_resp_t;
315 
316 typedef uint8_t smp_zone_perm_descr128_t[16];
317 typedef uint8_t smp_zone_perm_descr256_t[32];
318 
319 #define	SMP_ZONE_PERM_BIT128(__d, __z)	\
320 	((__d)[15 - ((__z) >> 3)] & (1 << ((__z) & 7)))
321 
322 #define	SMP_ZONE_PERM_SET128(__d, __z)	\
323 	((__d)[15 - ((__z) >> 3)] |= (1 << ((__z) & 7)))
324 
325 #define	SMP_ZONE_PERM_CLR128(__d, __z)	\
326 	((__d)[15 - ((__z) >> 3)] &= ~(1 << ((__z) & 7)))
327 
328 #define	SMP_ZONE_PERM_BIT256(__d, __z)	\
329 	((__d)[31 - ((__z) >> 3)] & (1 << ((__z) & 7)))
330 
331 #define	SMP_ZONE_PERM_SET256(__d, __z)	\
332 	((__d)[31 - ((__z) >> 3)] |= (1 << ((__z) & 7)))
333 
334 #define	SMP_ZONE_PERM_CLR256(__d, __z)	\
335 	((__d)[31 - ((__z) >> 3)] &= ~(1 << ((__z) & 7)))
336 
337 /*
338  * SAS-2 10.4.3.8 REPORT ZONE MANAGER PASSWORD
339  */
340 typedef enum smp_report_zmp_report_type {
341 	SMP_ZMP_TYPE_CURRENT		= 0x0,
342 	SMP_ZMP_TYPE_SAVED		= 0x2,
343 	SMP_ZMP_TYPE_DEFAULT		= 0x3
344 } smp_report_zmp_report_type_t;
345 
346 typedef struct smp_report_zone_mgr_password_req {
347 	DECL_BITFIELD2(
348 	    srzmpr_rpt_type		:2,
349 	    _reserved1			:6);
350 	uint8_t _reserved2[2];
351 } smp_report_zone_mgr_password_req_t;
352 
353 typedef struct smp_report_zone_mgr_password_resp {
354 	uint16_t srzmpr_exp_change_count;
355 	DECL_BITFIELD2(
356 	    srzmpr_rpt_type		:2,
357 	    _reserved1			:6);
358 	uint8_t _reserved2;
359 	uint8_t srzmpr_zone_mgr_password[32];
360 } smp_report_zone_mgr_password_resp_t;
361 
362 /*
363  * SAS-2 10.4.3.9 REPORT BROADCAST
364  */
365 typedef struct smp_report_broadcast_req {
366 	DECL_BITFIELD2(
367 	    srbr_broadcast_type		:4,
368 	    _reserved1			:4);
369 	uint8_t _reserved2[3];
370 } smp_report_broadcast_req_t;
371 
372 typedef enum smp_broadcast_type {
373 	SMP_BROADCAST_CHANGE		= 0x0,
374 	SMP_BROADCAST_RESERVED_CHANGE_0	= 0x1,
375 	SMP_BROADCAST_RESERVED_CHANGE_1	= 0x2,
376 	SMP_BROADCAST_SES		= 0x3,
377 	SMP_BROADCAST_EXPANDER		= 0x4,
378 	SMP_BROADCAST_ASYNC_EVENT	= 0x5,
379 	SMP_BROADCAST_RESERVED_3	= 0x6,
380 	SMP_BROADCAST_RESERVED_4	= 0x7,
381 	SMP_BROADCAST_ZONE_ACTIVATE	= 0x8
382 } smp_broadcast_type_t;
383 
384 typedef struct smp_broadcast_descr {
385 	DECL_BITFIELD2(
386 	    sbd_broadcast_type		:4,
387 	    _reserved1			:4);
388 	uint8_t sbd_phy_identifier;
389 	DECL_BITFIELD2(
390 	    sbd_broadcast_reason	:4,
391 	    _reserved2			:4);
392 	uint16_t sbd_broadcast_count;
393 	uint8_t _reserved3[10];
394 } smp_broadcast_descr_t;
395 
396 typedef struct smp_report_broadcast_resp {
397 	uint16_t srbr_exp_change_count;
398 	DECL_BITFIELD2(
399 	    srbr_broadcast_type		:4,
400 	    _reserved1			:4);
401 	uint8_t srbr_number_broadcast_descrs;
402 	smp_broadcast_descr_t srbr_descrs[1];
403 } smp_report_broadcast_resp_t;
404 
405 /*
406  * SAS-2 10.4.3.10 DISCOVER
407  */
408 typedef struct smp_discover_req {
409 	uint8_t _reserved1[4];
410 	DECL_BITFIELD2(
411 	    sdr_ignore_zone_grp		:1,
412 	    _reserved2			:7);
413 	uint8_t sdr_phy_identifier;
414 	uint8_t _reserved3[2];
415 } smp_discover_req_t;
416 
417 typedef struct smp_snw3_phy_cap {
418 	DECL_BITFIELD4(
419 	    sspc_requested_logical_link_rate	:4,	/* smp_link_rate_t */
420 	    _reserved1				:2,
421 	    sspc_tx_ssc_type			:1,
422 	    sspc_start				:1);
423 	DECL_BITFIELD7(
424 	    _reserved2				:2,
425 	    sspc_g3_ssc				:1,
426 	    sspc_g3_no_ssc			:1,
427 	    sspc_g2_ssc				:1,
428 	    sspc_g2_no_ssc			:1,
429 	    sspc_g1_ssc				:1,
430 	    sspc_g1_no_ssc			:1);
431 	uint8_t _reserved3;
432 	DECL_BITFIELD2(
433 	    sspc_parity		:1,
434 	    _reserved4		:7);
435 } smp_snw3_phy_cap_t;
436 
437 typedef struct smp_discover_resp {
438 	uint16_t sdr_exp_change_count;
439 	uint8_t _reserved1[3];
440 	uint8_t sdr_phy_identifier;
441 	uint8_t _reserved2[2];
442 	DECL_BITFIELD3(
443 	    sdr_attached_reason		:4,
444 	    sdr_attached_device_type	:3,
445 	    _reserved3			:1);
446 	DECL_BITFIELD2(
447 	    sdr_negotiated_logical_link_rate	:4,	/* smp_link_rate_t */
448 	    _reserved4				:4);
449 	DECL_BITFIELD5(
450 	    sdr_attached_sata_host	:1,
451 	    sdr_attached_smp_initiator	:1,
452 	    sdr_attached_stp_initiator	:1,
453 	    sdr_attached_ssp_initiator	:1,
454 	    _reserved5			:4);
455 	DECL_BITFIELD6(
456 	    sdr_attached_sata_device		:1,
457 	    sdr_attached_smp_target		:1,
458 	    sdr_attached_stp_target		:1,
459 	    sdr_attached_ssp_target		:1,
460 	    _reserved6				:3,
461 	    sdr_attached_sata_port_selector	:1);
462 	uint64_t sdr_sas_addr;
463 	uint64_t sdr_attached_sas_addr;
464 	uint8_t sdr_attached_phy_identifier;
465 	DECL_BITFIELD4(
466 	    sdr_attached_break_reply_capable		:1,
467 	    sdr_attached_requested_inside_zpsds		:1,
468 	    sdr_attached_inside_zpsds_persistent	:1,
469 	    _reserved7					:5);
470 	uint8_t _reserved8[6];
471 	DECL_BITFIELD2(
472 	    sdr_hw_min_phys_link_rate	:4,	/* smp_link_rate_t */
473 	    sdr_prog_min_phys_link_rate	:4);	/* smp_link_rate_t */
474 	DECL_BITFIELD2(
475 	    sdr_hw_max_phys_link_rate	:4,	/* smp_link_rate_t */
476 	    sdr_prog_max_phys_link_rate	:4);	/* smp_link_rate_t */
477 	uint8_t sdr_phy_change_count;
478 	DECL_BITFIELD3(
479 	    sdr_partial_pwy_timeout	:4,
480 	    _reserved9			:3,
481 	    sdr_virtual_phy		:1);
482 	DECL_BITFIELD2(
483 	    sdr_routing_attr		:4,	/* smp_routing_attr_t */
484 	    _reserved10			:4);
485 	DECL_BITFIELD2(
486 	    sdr_connector_type		:7,
487 	    _reserved11			:1);
488 	uint8_t sdr_connector_element_index;
489 	uint8_t sdr_connector_physical_link;
490 	uint8_t _reserved12[2];
491 	uint8_t sdr_vendor[2];
492 	uint64_t sdr_attached_device_name;
493 	DECL_BITFIELD8(
494 	    sdr_zoning_enabled				:1,
495 	    sdr_inside_zpsds				:1,
496 	    sdr_zone_group_persistent			:1,
497 	    _reserved13					:1,
498 	    sdr_requested_inside_zpsds			:1,
499 	    sdr_inside_zpsds_persistent			:1,
500 	    sdr_requested_inside_zpsds_changed_by_exp	:1,
501 	    _reserved14					:1);
502 	uint8_t _reserved15[2];
503 	uint8_t sdr_zone_group;
504 	uint8_t sdr_self_config_status;
505 	uint8_t sdr_self_config_levels_completed;
506 	uint8_t _reserved16[2];
507 	uint64_t sdr_self_config_sas_addr;
508 	smp_snw3_phy_cap_t sdr_prog_phy_cap;
509 	smp_snw3_phy_cap_t sdr_current_phy_cap;
510 	smp_snw3_phy_cap_t sdr_attached_phy_cap;
511 	uint8_t _reserved17[6];
512 	DECL_BITFIELD2(
513 	    sdr_negotiated_phys_link_rate	:4,	/* smp_link_rate_t */
514 	    sdr_reason				:4);
515 	DECL_BITFIELD3(
516 	    sdr_hw_muxing_supported	:1,
517 	    sdr_negotiated_ssc		:1,
518 	    _reserved18			:6);
519 	DECL_BITFIELD7(
520 	    sdr_default_zoning_enabled		:1,
521 	    _reserved19				:1,
522 	    sdr_default_zone_group_persistent	:1,
523 	    _reserved20				:1,
524 	    sdr_default_requested_inside_zpsds	:1,
525 	    sdr_default_inside_zpsds_persistent	:1,
526 	    _reserved21				:2);
527 	uint8_t _reserved22[2];
528 	uint8_t sdr_default_zone_group;
529 	DECL_BITFIELD7(
530 	    sdr_saved_zoning_enabled		:1,
531 	    _reserved23				:1,
532 	    sdr_saved_zone_group_persistent	:1,
533 	    _reserved24				:1,
534 	    sdr_saved_requested_inside_zpsds	:1,
535 	    sdr_saved_inside_zpsds_persistent	:1,
536 	    _reserved25				:2);
537 	uint8_t _reserved26[2];
538 	uint8_t saved_zone_group;
539 	DECL_BITFIELD6(
540 	    _reserved27				:2,
541 	    sdr_shadow_zone_group_persistent	:1,
542 	    _reserved28				:1,
543 	    sdr_shadow_requested_inside_zpsds	:1,
544 	    sdr_shadow_inside_zpsds_persistent	:1,
545 	    _reserved29				:2);
546 	uint8_t _reserved30[2];
547 	uint8_t sdr_shadow_zone_group;
548 } smp_discover_resp_t;
549 
550 typedef enum smp_link_rate {
551 	SMP_LINK_RATE_NO_CHANGE = 0x0,
552 	SMP_LINK_RATE_DISABLED = 0x1,
553 	SMP_LINK_RATE_RESET_PROBLEM = 0x2,
554 	SMP_LINK_RATE_SPINUP_HOLD = 0x3,
555 	SMP_LINK_RATE_PORT_SELECTOR = 0x4,
556 	SMP_LINK_RATE_RESET = 0x5,
557 	SMP_LINK_RATE_UNSUPPORTED = 0x6,
558 	SMP_LINK_RATE_1_5 = 0x8,
559 	SMP_LINK_RATE_3 = 0x9,
560 	SMP_LINK_RATE_6 = 0xA
561 } smp_link_rate_t;
562 
563 typedef enum smp_device_type {
564 	SMP_DEV_NONE = 0x0,
565 	SMP_DEV_SAS_SATA = 0x1,
566 	SMP_DEV_EXPANDER = 0x2,
567 	SMP_DEV_EXPANDER_OLD = 0x3
568 } smp_device_type_t;
569 
570 typedef enum smp_routing_attr {
571 	SMP_ROUTING_DIRECT = 0x0,
572 	SMP_ROUTING_SUBTRACTIVE = 0x1,
573 	SMP_ROUTING_TABLE = 0x2
574 } smp_routing_attr_t;
575 
576 /*
577  * SAS-2 10.4.3.11 REPORT PHY ERROR LOG
578  */
579 typedef struct smp_report_phy_error_log_req {
580 	uint8_t _reserved1[5];
581 	uint8_t srpelr_phy_identifier;
582 	uint8_t _reserved2[2];
583 } smp_report_phy_error_log_req_t;
584 
585 typedef struct smp_report_phy_error_log_resp {
586 	uint16_t srpelr_exp_change_count;
587 	uint8_t _reserved1[3];
588 	uint8_t srpelr_phy_identifier;
589 	uint8_t _reserved2[2];
590 	uint32_t srpelr_invalid_dword_count;
591 	uint32_t srpelr_running_disparity_error_count;
592 	uint32_t srpelr_loss_dword_sync_count;
593 	uint32_t srpelr_phy_reset_problem_count;
594 } smp_report_phy_error_log_resp_t;
595 
596 /*
597  * SAS-2 10.4.3.12 REPORT PHY SATA
598  */
599 typedef struct smp_report_phy_sata_req {
600 	uint8_t _reserved1[5];
601 	uint8_t srpsr_phy_identifier;
602 	uint8_t srpsr_affiliation_context;
603 	uint8_t _reserved2;
604 } smp_report_phy_sata_req_t;
605 
606 typedef struct smp_report_phy_sata_resp {
607 	uint16_t srpsr_exp_change_count;
608 	uint8_t _reserved1[3];
609 	uint8_t srpsr_phy_identifier;
610 	uint8_t _reserved2;
611 	DECL_BITFIELD4(
612 	    srpsr_affiliation_valid		:1,
613 	    srpsr_affiliations_supported	:1,
614 	    srpsr_stp_nexus_loss		:1,
615 	    _reserved3				:5);
616 	uint8_t _reserved4[4];
617 	uint64_t srpsr_stp_sas_addr;
618 	uint8_t srpsr_register_device_host_fis[20];
619 	uint8_t _reserved5[4];
620 	uint64_t srpsr_affiliated_stp_init_sas_addr;
621 	uint64_t srpsr_stp_nexus_loss_sas_addr;
622 	uint8_t _reserved6;
623 	uint8_t srpsr_affiliation_context;
624 	uint8_t srpsr_current_affiliation_contexts;
625 	uint8_t srpsr_max_affiliation_contexts;
626 } smp_report_phy_sata_resp_t;
627 
628 /*
629  * SAS-2 10.4.3.13 REPORT ROUTE INFORMATION
630  */
631 typedef struct smp_report_route_info_req {
632 	uint8_t _reserved1[2];
633 	uint16_t srrir_exp_route_index;
634 	uint8_t _reserved2;
635 	uint8_t srrir_phy_identifier;
636 	uint8_t _reserved3[2];
637 } smp_report_route_info_req_t;
638 
639 typedef struct smp_report_route_info_resp {
640 	uint16_t srrir_exp_change_count;
641 	uint16_t srrir_exp_route_index;
642 	uint8_t _reserved1;
643 	uint8_t srrir_phy_identifier;
644 	uint8_t _reserved2[2];
645 	DECL_BITFIELD2(
646 	    _reserved3				:7,
647 	    srrir_exp_route_entry_disabled	:1);
648 	uint8_t _reserved4[3];
649 	uint64_t srrir_routed_sas_addr;
650 	uint8_t _reserved5[16];
651 } smp_report_route_info_resp_t;
652 
653 /*
654  * SAS-2 10.4.3.14 SAS-2 REPORT PHY EVENT
655  */
656 typedef enum smp_phy_event_source {
657 	SMP_PHY_EVENT_NO_EVENT				= 0x00,
658 	SMP_PHY_EVENT_INVALID_DWORD_COUNT		= 0x01,
659 	SMP_PHY_EVENT_RUNNING_DISPARITY_ERROR_COUNT	= 0x02,
660 	SMP_PHY_EVENT_LOSS_OF_DWORD_SYNC_COUNT		= 0x03,
661 	SMP_PHY_EVENT_PHY_RESET_PROBLEM_COUNT		= 0x04,
662 	SMP_PHY_EVENT_ELASTICITY_BUFFER_OVERFLOW_COUNT	= 0x05,
663 	SMP_PHY_EVENT_RX_ERROR_COUNT			= 0x06,
664 	SMP_PHY_EVENT_RX_ADDR_FRAME_ERROR_COUNT		= 0x20,
665 	SMP_PHY_EVENT_TX_ABANDON_CLASS_OPEN_REJ_COUNT	= 0x21,
666 	SMP_PHY_EVENT_RX_ABANDON_CLASS_OPEN_REJ_COUNT	= 0x22,
667 	SMP_PHY_EVENT_TX_RETRY_CLASS_OPEN_REJ_COUNT	= 0x23,
668 	SMP_PHY_EVENT_RX_RETRY_CLASS_OPEN_REJ_COUNT	= 0x24,
669 	SMP_PHY_EVENT_RX_AIP_W_O_PARTIAL_COUNT		= 0x25,
670 	SMP_PHY_EVENT_RX_AIP_W_O_CONN_COUNT		= 0x26,
671 	SMP_PHY_EVENT_TX_BREAK_COUNT			= 0x27,
672 	SMP_PHY_EVENT_RX_BREAK_COUNT			= 0x28,
673 	SMP_PHY_EVENT_BREAK_TIMEOUT_COUNT		= 0x29,
674 	SMP_PHY_EVENT_CONNECTION_COUNT			= 0x2A,
675 	SMP_PHY_EVENT_PEAK_TX_PATHWAY_BLOCKED_COUNT	= 0x2B,
676 	SMP_PHY_EVENT_PEAK_TX_ARB_WAIT_TIME		= 0x2C,
677 	SMP_PHY_EVENT_PEAK_ARB_TIME			= 0x2D,
678 	SMP_PHY_EVENT_PEAK_CONNECTION_TIME		= 0x2E,
679 	SMP_PHY_EVENT_TX_SSP_FRAME_COUNT		= 0x40,
680 	SMP_PHY_EVENT_RX_SSP_FRAME_COUNT		= 0x41,
681 	SMP_PHY_EVENT_TX_SSP_FRAME_ERROR_COUNT		= 0x42,
682 	SMP_PHY_EVENT_RX_SSP_FRAME_ERROR_COUNT		= 0x43,
683 	SMP_PHY_EVENT_TX_CREDIT_BLOCKED_COUNT		= 0x44,
684 	SMP_PHY_EVENT_RX_CREDIT_BLOCKED_COUNT		= 0x45,
685 	SMP_PHY_EVENT_TX_SATA_FRAME_COUNT		= 0x50,
686 	SMP_PHY_EVENT_RX_SATA_FRAME_COUNT		= 0x51,
687 	SMP_PHY_EVENT_SATA_FLOW_CTRL_BUF_OVERFLOW_COUNT	= 0x52,
688 	SMP_PHY_EVENT_TX_SMP_FRAME_COUNT		= 0x60,
689 	SMP_PHY_EVENT_RX_SMP_FRAME_COUNT		= 0x61,
690 	SMP_PHY_EVENT_RX_SMP_FRAME_ERROR_COUNT		= 0x63
691 } smp_phy_event_source_t;
692 
693 typedef struct smp_report_phy_event_req {
694 	uint8_t _reserved1;
695 	uint8_t _reserved2[4];
696 	uint8_t srper_phy_identifier;
697 	uint8_t _reserved3[2];
698 } smp_report_phy_event_req_t;
699 
700 typedef struct smp_phy_event_report_descr {
701 	uint8_t _reserved1[3];
702 	uint8_t sped_phy_event_source;
703 	uint32_t sped_phy_event;
704 	uint32_t sped_peak_detector_threshold;
705 } smp_phy_event_report_descr_t;
706 
707 typedef struct smp_report_phy_event_resp {
708 	uint16_t srper_exp_change_count;
709 	uint8_t _reserved1[3];
710 	uint8_t srper_phy_identifier;
711 	uint8_t _reserved2[5];
712 	uint8_t srper_n_phy_event_descrs;
713 	smp_phy_event_report_descr_t srper_phy_event_descrs[1];
714 } smp_report_phy_event_resp_t;
715 
716 /*
717  * SAS-2 10.4.3.15 SAS-2 DISCOVER LIST
718  */
719 typedef struct smp_discover_list_req {
720 	uint8_t _reserved1[4];
721 	uint8_t sdlr_starting_phy_identifier;
722 	uint8_t sdlr_max_descrs;
723 	DECL_BITFIELD3(
724 	    sdlr_phy_filter		:4,
725 	    _reserved2			:3,
726 	    sdlr_ignore_zone_group	:1);
727 	DECL_BITFIELD2(
728 	    sdlr_descr_type		:4,
729 	    _reserved3			:4);
730 	uint8_t _reserved4[4];
731 	uint8_t sdlr_vendor[12];
732 } smp_discover_list_req_t;
733 
734 typedef struct smp_discover_short_descr {
735 	uint8_t sdsd_phy_identifier;
736 	uint8_t sdsd_function_result;
737 	DECL_BITFIELD3(
738 	    sdsd_attached_reason	:4,
739 	    sdsd_attached_device_type	:3,
740 	    _restricted1		:1);
741 	DECL_BITFIELD2(
742 	    sdsd_negotiated_logical_link_rate	:4,	/* smp_link_rate_t */
743 	    _restricted2			:4);
744 	DECL_BITFIELD5(
745 	    sdsd_attached_sata_host	:1,
746 	    sdsd_attached_smp_initiator	:1,
747 	    sdsd_attached_stp_initiator	:1,
748 	    sdsd_attached_ssp_initiator	:1,
749 	    _restricted3		:4);
750 	DECL_BITFIELD6(
751 	    sdsd_attached_sata_device		:1,
752 	    sdsd_attached_smp_target		:1,
753 	    sdsd_attached_stp_target		:1,
754 	    sdsd_attached_ssp_target		:1,
755 	    _restricted4			:3,
756 	    sdsd_attached_sata_port_selector	:1);
757 	DECL_BITFIELD3(
758 	    sdsd_routing_attribute	:4,		/* smp_routing_attr_t */
759 	    _reserved1			:3,
760 	    sdsd_virtual_phy		:1);
761 	DECL_BITFIELD2(
762 	    _reserved2			:4,
763 	    sdsd_reason			:4);
764 	uint8_t sdsd_zone_group;
765 	DECL_BITFIELD7(
766 	    _reserved3				:1,
767 	    sdsd_inside_zpsds			:1,
768 	    sdsd_zone_group_persistent		:1,
769 	    _reserved4				:1,
770 	    sdsd_requested_insize_zpsds		:1,
771 	    sdsd_inside_zpsds_persistent	:1,
772 	    _restricted5			:2);
773 	uint8_t sdsd_attached_phy_identifier;
774 	uint8_t sdsd_phy_change_count;
775 	uint64_t sdsd_attached_sas_addr;
776 	uint8_t _reserved5[4];
777 } smp_discover_short_descr_t;
778 
779 typedef struct smp_discover_long_descr {
780 	uint8_t _reserved1[2];
781 	uint8_t sdld_function_result;
782 	uint8_t _reserved2[1];
783 	smp_discover_resp_t sdld_response;
784 } smp_discover_long_descr_t;
785 
786 #define	SMP_DISCOVER_RESP(_ld)	\
787 	(((smp_discover_long_descr_t *)(_ld))->sdld_function_result ==	\
788 	SMP_FUNCTION_ACCEPTED ?	\
789 	&((smp_discover_long_descr_t *)(_ld))->sdld_response :	\
790 	NULL)
791 
792 typedef struct smp_discover_list_resp {
793 	uint16_t sdlr_exp_change_count;
794 	uint8_t _reserved1[2];
795 	uint8_t sdlr_starting_phy_identifier;
796 	uint8_t sdlr_n_descrs;
797 	DECL_BITFIELD2(
798 	    sdlr_phy_filter		:4,
799 	    _reserved2			:4);
800 	DECL_BITFIELD2(
801 	    sdlr_descr_type		:4,
802 	    _reserved3			:4);
803 	uint8_t sdlr_descr_length;
804 	uint8_t _reserved4[3];
805 	DECL_BITFIELD5(
806 	    sdlr_externally_configurable_route_table	:1,
807 	    sdlr_configuring				:1,
808 	    _reserved5					:4,
809 	    sdlr_zoning_enabled				:1,
810 	    sdlr_zoning_supported			:1);
811 	uint8_t _reserved6;
812 	uint16_t sdlr_last_sc_status_descr_index;
813 	uint16_t sdlr_last_phy_event_list_descr_index;
814 	uint8_t _reserved7[10];
815 	uint8_t sdlr_vendor[16];
816 	uint8_t sdlr_descrs[1];	/* short or long format */
817 } smp_discover_list_resp_t;
818 
819 /*
820  * SAS-2 10.4.3.16 REPORT PHY EVENT LIST
821  */
822 typedef struct smp_report_phy_event_list_req {
823 	uint8_t _reserved1[2];
824 	uint16_t srpelr_starting_descr_index;
825 } smp_report_phy_event_list_req_t;
826 
827 typedef struct smp_phy_event_list_descr {
828 	uint8_t _reserved1[2];
829 	uint8_t speld_phy_identifier;
830 	uint8_t speld_phy_event_source;
831 	uint32_t speld_phy_event;
832 	uint32_t speld_peak_detector_threshold;
833 } smp_phy_event_list_descr_t;
834 
835 typedef struct smp_report_phy_event_list_resp {
836 	uint16_t srpelr_exp_change_count;
837 	uint16_t srpelr_starting_descr_index;
838 	uint16_t srpelr_last_descr_index;
839 	uint8_t srpelr_phy_event_list_descr_length;
840 	uint8_t _reserved1[3];
841 	uint8_t srpelr_n_descrs;
842 	smp_phy_event_list_descr_t srpelr_descrs[1];
843 } smp_report_phy_event_list_resp_t;
844 
845 /*
846  * SAS-2 10.4.3.17 REPORT EXPANDER ROUTE TABLE LIST
847  */
848 typedef struct smp_report_exp_route_table_list_req {
849 	uint8_t _reserved1[4];
850 	uint16_t srertlr_max_descrs;
851 	uint16_t srertlr_starting_routed_sas_addr_index;
852 	uint8_t _reserved2[7];
853 	uint8_t srertlr_starting_phy_identifier;
854 	uint8_t _reserved3[8];
855 } smp_report_exp_route_table_list_req_t;
856 
857 typedef struct smp_route_table_descr {
858 	uint64_t srtd_routed_sas_addr;
859 	uint8_t srtd_phy_bitmap[6];
860 	DECL_BITFIELD2(
861 	    _reserved1			:7,
862 	    srtd_zone_group_valid	:1);
863 	uint8_t srtd_zone_group;
864 } smp_route_table_descr_t;
865 
866 #define	SMP_ROUTE_PHY(_d, _s, _i)	\
867 	((_d)->srtd_phy_bitmap[(48 - (_i) + (_s)) >> 3] & \
868 	(1 << ((48 - (_i) + (_s)) & 7)))
869 
870 typedef struct smp_report_exp_route_table_list_resp {
871 	uint16_t srertlr_exp_change_count;
872 	uint16_t srertlr_route_table_change_count;
873 	DECL_BITFIELD5(
874 	    srertlr_zoning_enabled	:1,
875 	    srertlr_configuring		:1,
876 	    srertlr_zone_configuring	:1,
877 	    srertlr_self_configuring	:1,
878 	    _reserved2			:4);
879 	uint8_t _reserved3;
880 	uint8_t srertlr_descr_length;
881 	uint8_t srertlr_n_descrs;
882 	uint16_t srertlr_first_routed_sas_addr_index;
883 	uint16_t srertlr_last_routed_sas_addr_index;
884 	uint8_t _reserved4[3];
885 	uint8_t srertlr_starting_phy_identifier;
886 	uint8_t _reserved5[12];
887 	smp_route_table_descr_t srertlr_descrs[1];
888 } smp_report_exp_route_table_list_resp_t;
889 
890 /*
891  * SAS-2 10.4.3.18 CONFIGURE GENERAL (no additional response)
892  */
893 typedef struct smp_config_general_req {
894 	uint16_t scgr_expected_exp_change_count;
895 	uint8_t _reserved1[2];
896 	DECL_BITFIELD6(
897 	    scgr_update_stp_bus_inactivity			:1,
898 	    scgr_update_stp_max_conn				:1,
899 	    scgr_update_stp_smp_nexus_loss			:1,
900 	    scgr_update_initial_time_to_reduced_functionality	:1,
901 	    scgr_update_stp_reject_to_open			:1,
902 	    _reserved2						:3);
903 	uint8_t _reserved3;
904 	uint16_t scgr_stp_bus_inactivity;
905 	uint16_t scgr_stp_max_conn;
906 	uint16_t scgr_stp_smp_nexus_loss;
907 	uint8_t scgr_initial_time_to_reduced_functionality;
908 	uint8_t _reserved4;
909 	uint16_t scgr_stp_reject_to_open;
910 } smp_config_general_req_t;
911 
912 /*
913  * SAS-2 10.4.3.19 ENABLE DISABLE ZONING (no additional response)
914  */
915 typedef struct smp_enable_disable_zoning_req {
916 	uint16_t sedzr_expected_exp_change_count;
917 	DECL_BITFIELD2(
918 	    sedzr_save	:2,		/* smp_zoning_save_t */
919 	    _reserved1	:6);
920 	uint8_t _reserved2;
921 	DECL_BITFIELD2(
922 	    sedzr_enable_disable_zoning	:2,
923 	    _reserved3			:6);
924 	uint8_t _reserved4[3];
925 } smp_enable_disable_zoning_req_t;
926 
927 typedef enum smp_zoning_save {
928 	SMP_ZONING_SAVE_CURRENT = 0x0,
929 	SMP_ZONING_SAVE_SAVED = 0x1,
930 	SMP_ZONING_SAVE_BOTH_IF_SUPP = 0x2,
931 	SMP_ZONING_SAVE_BOTH = 0x3
932 } smp_zoning_save_t;
933 
934 typedef enum smp_zoning_enable_op {
935 	SMP_ZONING_ENABLE_OP_NONE = 0x0,
936 	SMP_ZONING_ENABLE_OP_ENABLE = 0x1,
937 	SMP_ZONING_ENABLE_OP_DISABLE = 0x2
938 } smp_zoning_enable_op_t;
939 
940 /*
941  * SAS-2 10.4.3.20 ZONED BROADCAST (no additional response)
942  */
943 typedef struct smp_zoned_broadcast_req {
944 	uint8_t _restricted1[2];
945 	DECL_BITFIELD2(
946 	    szbr_broadcast_type	:4,
947 	    _reserved		:4);
948 	uint8_t szbr_n_broadcast_source_zone_groups;
949 	uint8_t szbr_broadcast_source_zone_groups[1];
950 } smp_zoned_broadcast_req_t;
951 
952 /*
953  * SAS-2 10.4.3.21 ZONE LOCK
954  */
955 typedef struct smp_zone_lock_req {
956 	uint16_t szlr_expected_exp_change_count;
957 	uint16_t szlr_zone_lock_inactivity_timeout;
958 	uint8_t szlr_zone_manager_password[32];
959 } smp_zone_lock_req_t;
960 
961 typedef struct smp_zone_lock_resp {
962 	uint8_t _reserved1[4];
963 	uint64_t szlr_active_zone_manager_sas_addr;
964 } smp_zone_lock_resp_t;
965 
966 /*
967  * SAS-2 10.4.3.22 ZONE ACTIVATE (no additional response)
968  */
969 typedef struct smp_zone_activate_req {
970 	uint16_t szar_expected_exp_change_count;
971 	uint8_t _reserved1[2];
972 } smp_zone_activate_req_t;
973 
974 /*
975  * SAS-2 10.4.3.23 ZONE UNLOCK (no additional response)
976  */
977 typedef struct smp_zone_unlock_req {
978 	uint8_t _restricted1[2];
979 	DECL_BITFIELD2(
980 	    szur_activate_required	:1,
981 	    _reserved1			:7);
982 	uint8_t _reserved2;
983 } smp_zone_unlock_req_t;
984 
985 /*
986  * SAS-2 10.4.3.24 CONFIGURE ZONE MANAGER PASSWORD (no additional response)
987  */
988 typedef struct smp_config_zone_manager_password_req {
989 	uint16_t sczmpr_expected_exp_change_count;
990 	DECL_BITFIELD2(
991 	    sczmpr_save		:2,		/* smp_zoning_save_t */
992 	    _reserved1		:6);
993 	uint8_t _reserved2;
994 	uint8_t sczmpr_zone_manager_password[32];
995 	uint8_t sczmpr_new_zone_manager_password[32];
996 } smp_config_zone_manager_password_req_t;
997 
998 /*
999  * SAS-2 10.4.3.25 CONFIGURE ZONE PHY INFORMATION (no additional response)
1000  */
1001 typedef struct smp_zone_phy_config_descr {
1002 	uint8_t szpcd_phy_identifier;
1003 	DECL_BITFIELD6(
1004 	    _reserved1				:2,
1005 	    szpcd_zone_group_persistent		:1,
1006 	    _reserved2				:1,
1007 	    szpcd_requested_inside_zpsds	:1,
1008 	    szpcd_inside_zpsds_persistent	:1,
1009 	    _reserved3				:2);
1010 	uint8_t _reserved4;
1011 	uint8_t szpcd_zone_group;
1012 } smp_zone_phy_config_descr_t;
1013 
1014 typedef struct smp_config_zone_phy_info_req {
1015 	uint16_t sczpir_expected_exp_change_count;
1016 	DECL_BITFIELD2(
1017 	    sczpir_save		:2,		/* smp_zoning_save_t */
1018 	    _reserved1		:6);
1019 	uint8_t sczpir_n_descrs;
1020 	smp_zone_phy_config_descr_t sczpir_descrs[1];
1021 } smp_config_zone_phy_info_req_t;
1022 
1023 /*
1024  * SAS-2 10.4.3.26 CONFIGURE ZONE PERMISSION TABLE (no additional response)
1025  */
1026 typedef struct smp_config_zone_perm_table_req {
1027 	uint16_t sczptr_expected_exp_change_count;
1028 	uint8_t sczptr_starting_source_zone_group;
1029 	uint8_t sczptr_n_descrs;
1030 	DECL_BITFIELD3(
1031 	    sczptr_save			:2,	/* smp_zoning_save_t */
1032 	    _reserved1			:4,
1033 	    sczptr_n_zone_groups	:2);	/* smp_n_zone_grps_t */
1034 	uint8_t _reserved2[7];
1035 	uint8_t sczptr_descrs[1];	/* smp_zone_perm_descrXXX_t */
1036 } smp_config_zone_perm_table_req_t;
1037 
1038 /*
1039  * SAS-2 10.4.3.27 CONFIGURE ROUTE INFORMATION (no additional response)
1040  */
1041 typedef struct smp_config_route_info_req {
1042 	uint16_t scrir_expected_exp_change_count;
1043 	uint16_t scrir_exp_route_index;
1044 	uint8_t _reserved1;
1045 	uint8_t scrir_phy_identifier;
1046 	uint8_t _reserved2[2];
1047 	DECL_BITFIELD2(
1048 	    _reserved3				:7,
1049 	    scrir_disable_exp_route_entry	:1);
1050 	uint8_t _reserved4[3];
1051 	uint64_t scrir_routed_sas_addr;
1052 	uint8_t _reserved5[16];
1053 } smp_config_route_info_req_t;
1054 
1055 /*
1056  * SAS-2 10.4.3.28 PHY CONTROL (no additional response)
1057  */
1058 typedef struct smp_phy_control_req {
1059 	uint16_t spcr_expected_exp_change_count;
1060 	uint8_t _reserved1[3];
1061 	uint8_t spcr_phy_identifier;
1062 	uint8_t spcr_phy_operation;
1063 	DECL_BITFIELD2(
1064 	    spcr_update_partial_pwy_timeout	:1,
1065 	    _reserved2				:7);
1066 	uint8_t _reserved3[12];
1067 	uint64_t spcr_attached_device_name;
1068 	DECL_BITFIELD2(
1069 	    _reserved4				:4,
1070 	    spcr_prog_min_phys_link_rate	:4);	/* smp_link_rate_t */
1071 	DECL_BITFIELD2(
1072 	    _reserved5				:4,
1073 	    spcr_prog_max_phys_link_rate	:4);	/* smp_link_rate_t */
1074 	uint8_t _reserved6[2];
1075 	DECL_BITFIELD2(
1076 	    spcr_partial_pwy_timeout	:4,
1077 	    _reserved7			:4);
1078 	uint8_t _reserved8[3];
1079 } smp_phy_control_req_t;
1080 
1081 typedef enum smp_phy_op {
1082 	SMP_PHY_OP_NOP = 0x00,
1083 	SMP_PHY_OP_LINK_RESET = 0x01,
1084 	SMP_PHY_OP_HARD_RESET = 0x02,
1085 	SMP_PHY_OP_DISABLE = 0x03,
1086 	SMP_PHY_OP_CLEAR_ERROR_LOG = 0x05,
1087 	SMP_PHY_OP_CLEAR_AFFILIATION = 0x06,
1088 	SMP_PHY_OP_TRANSMIT_SATA_PORT_SELECTION_SIGNAL = 0x07,
1089 	SMP_PHY_OP_CLEAR_STP_NEXUS_LOSS = 0x08,
1090 	SMP_PHY_OP_SET_ATTACHED_DEVICE_NAME = 0x09
1091 } smp_phy_op_t;
1092 
1093 /*
1094  * SAS-2 10.4.3.29 PHY TEST FUNCTION (no additional response)
1095  */
1096 typedef struct smp_phy_test_function_req {
1097 	uint16_t sptfr_expected_exp_change_count;
1098 	uint8_t _reserved1[3];
1099 	uint8_t sptfr_phy_identifier;
1100 	uint8_t sptfr_phy_test_function;
1101 	uint8_t sptfr_phy_test_pattern;		/* smp_phy_test_function_t */
1102 	uint8_t _reserved2[3];
1103 	DECL_BITFIELD4(
1104 	    sptfr_test_pattern_phys_link_rate	:4,	/* smp_link_rate_t */
1105 	    sptfr_test_pattern_ssc		:2,
1106 	    sptfr_test_pattern_sata		:1,
1107 	    _reserved3				:1);
1108 	uint8_t _reserved4[3];
1109 	uint8_t sptfr_phy_test_pattern_dwords_ctl;
1110 	uint8_t sptfr_phy_test_pattern_dwords[8];
1111 	uint8_t _reserved5[12];
1112 } smp_phy_test_function_req_t;
1113 
1114 typedef enum smp_phy_test_function {
1115 	SMP_PHY_TEST_FN_STOP = 0x00,
1116 	SMP_PHY_TEST_FN_TRANSMIT_PATTERN = 0x01
1117 } smp_phy_test_function_t;
1118 
1119 /*
1120  * SAS-2 10.4.3.30 CONFIGURE PHY EVENT (no additional response)
1121  */
1122 typedef struct smp_phy_event_config_descr {
1123 	uint8_t _reserved1[3];
1124 	uint8_t specd_phy_event_source;
1125 	uint32_t specd_peak_value_detector_threshold;
1126 } smp_phy_event_config_descr_t;
1127 
1128 typedef struct smp_config_phy_event_req {
1129 	uint16_t scper_expected_exp_change_count;
1130 	DECL_BITFIELD2(
1131 	    scper_clear_peaks	:1,
1132 	    _reserved1		:7);
1133 	uint8_t _reserved2[2];
1134 	uint8_t scper_phy_identifier;
1135 	uint8_t _reserved3;
1136 	uint8_t scper_n_descrs;
1137 	smp_phy_event_config_descr_t scper_descrs[1];
1138 } smp_config_phy_event_req_t;
1139 
1140 #pragma	pack()
1141 
1142 #ifdef	__cplusplus
1143 }
1144 #endif
1145 
1146 #endif	/* _SYS_SCSI_GENERIC_SMP_FRAMES_H */
1147