2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
26 * Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 * @brief This file contains all of the definitions relating to structures,
61 * constants, etc. defined by the SAS specification.
64 #include <dev/isci/types.h>
65 #include <dev/isci/scil/intel_sata.h>
66 #include <dev/isci/scil/intel_scsi.h>
69 * @struct SCI_SAS_ADDRESS
70 * @brief This structure depicts how a SAS address is represented by SCI.
72 typedef struct SCI_SAS_ADDRESS
75 * This member contains the higher 32-bits of the SAS address.
80 * This member contains the lower 32-bits of the SAS address.
87 * @struct SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS
88 * @brief This structure depicts the contents of bytes 2 and 3 in the
89 * SAS IDENTIFY ADDRESS FRAME (IAF).
90 * @note For specific information on each of these
91 * individual fields please reference the SAS specification
92 * Link layer section on address frames.
94 typedef struct SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS
101 U16 smp_initiator : 1;
102 U16 stp_initiator : 1;
103 U16 ssp_initiator : 1;
115 } SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS_T;
118 * @struct SCI_SAS_IDENTIFY_ADDRESS_FRAME
119 * @brief This structure depicts the contents of the SAS IDENTIFY ADDRESS
121 * @note For specific information on each of these
122 * individual fields please reference the SAS specification
123 * Link layer section on address frames.
125 typedef struct SCI_SAS_IDENTIFY_ADDRESS_FRAME
127 U16 address_frame_type : 4;
133 SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS_T protocols;
135 SCI_SAS_ADDRESS_T device_name;
136 SCI_SAS_ADDRESS_T sas_address;
138 U32 phy_identifier : 8;
139 U32 break_reply_capable : 1;
140 U32 requested_in_zpsds : 1;
141 U32 in_zpsds_persistent : 1;
146 } SCI_SAS_IDENTIFY_ADDRESS_FRAME_T;
149 * @struct SAS_CAPABILITIES
150 * @brief This structure depicts the various SAS capabilities supported
151 * by the directly attached target device. For specific information
152 * on each of these individual fields please reference the SAS
153 * specification Phy layer section on speed negotiation windows.
155 typedef struct SAS_CAPABILITIES
159 #if defined (SCIC_SDS_4_ENABLED)
163 * The SAS specification indicates the start bit shall always be set to
164 * 1. This implementation will have the start bit set to 0 if the
165 * PHY CAPABILITIES were either not received or speed negotiation failed.
170 U32 requested_logical_link_rate : 4;
172 U32 gen1_without_ssc_supported : 1;
173 U32 gen1_with_ssc_supported : 1;
174 U32 gen2_without_ssc_supported : 1;
175 U32 gen2_with_ssc_supported : 1;
176 U32 gen3_without_ssc_supported : 1;
177 U32 gen3_with_ssc_supported : 1;
181 #endif // (SCIC_SDS_4_ENABLED)
186 } SAS_CAPABILITIES_T;
189 * @enum _SCI_SAS_LINK_RATE
190 * @brief This enumeration depicts the SAS specification defined link speeds.
192 typedef enum _SCI_SAS_LINK_RATE
194 SCI_SAS_NO_LINK_RATE = 0,
195 SCI_SATA_SPINUP_HOLD = 0x3,
196 SCI_SAS_150_GB = 0x8,
197 SCI_SAS_300_GB = 0x9,
202 * @enum _SCI_SAS_TASK_ATTRIBUTE
203 * @brief This enumeration depicts the SAM/SAS specification defined task
204 * attribute values for a command information unit.
206 typedef enum _SCI_SAS_TASK_ATTRIBUTE
208 SCI_SAS_SIMPLE_ATTRIBUTE = 0,
209 SCI_SAS_HEAD_OF_QUEUE_ATTRIBUTE = 1,
210 SCI_SAS_ORDERED_ATTRIBUTE = 2,
211 SCI_SAS_ACA_ATTRIBUTE = 4,
212 } SCI_SAS_TASK_ATTRIBUTE;
215 * @enum _SCI_SAS_TASK_MGMT_FUNCTION
216 * @brief This enumeration depicts the SAM/SAS specification defined task
217 * management functions.
218 * @note This HARD_RESET function listed here is not actually defined
219 * as a task management function in the industry standard.
221 typedef enum _SCI_SAS_TASK_MGMT_FUNCTION
223 SCI_SAS_ABORT_TASK = SCSI_TASK_REQUEST_ABORT_TASK,
224 SCI_SAS_ABORT_TASK_SET = SCSI_TASK_REQUEST_ABORT_TASK_SET,
225 SCI_SAS_CLEAR_TASK_SET = SCSI_TASK_REQUEST_CLEAR_TASK_SET,
226 SCI_SAS_LOGICAL_UNIT_RESET = SCSI_TASK_REQUEST_LOGICAL_UNIT_RESET,
227 SCI_SAS_I_T_NEXUS_RESET = SCSI_TASK_REQUEST_I_T_NEXUS_RESET,
228 SCI_SAS_CLEAR_ACA = SCSI_TASK_REQUEST_CLEAR_ACA,
229 SCI_SAS_QUERY_TASK = SCSI_TASK_REQUEST_QUERY_TASK,
230 SCI_SAS_QUERY_TASK_SET = SCSI_TASK_REQUEST_QUERY_TASK_SET,
231 SCI_SAS_QUERY_ASYNCHRONOUS_EVENT = SCSI_TASK_REQUEST_QUERY_UNIT_ATTENTION,
232 SCI_SAS_HARD_RESET = 0xFF
233 } SCI_SAS_TASK_MGMT_FUNCTION_T;
237 * @enum _SCI_SAS_FRAME_TYPE
238 * @brief This enumeration depicts the SAS specification defined SSP frame
241 typedef enum _SCI_SAS_FRAME_TYPE
243 SCI_SAS_DATA_FRAME = 0x01,
244 SCI_SAS_XFER_RDY_FRAME = 0x05,
245 SCI_SAS_COMMAND_FRAME = 0x06,
246 SCI_SAS_RESPONSE_FRAME = 0x07,
247 SCI_SAS_TASK_FRAME = 0x16
248 } SCI_SAS_FRAME_TYPE_T;
252 * @struct SCI_SSP_COMMAND_IU
253 * @brief This structure depicts the contents of the SSP COMMAND
254 * INFORMATION UNIT. For specific information on each of these
255 * individual fields please reference the SAS specification SSP
256 * transport layer section.
258 typedef struct SCI_SSP_COMMAND_IU
263 U32 additional_cdb_length : 6;
266 U32 enable_first_burst : 1;
267 U32 task_priority : 4;
268 U32 task_attribute : 3;
273 } SCI_SSP_COMMAND_IU_T;
276 * @struct SCI_SSP_TASK_IU
277 * @brief This structure depicts the contents of the SSP TASK INFORMATION
278 * UNIT. For specific information on each of these individual fields
279 * please reference the SAS specification SSP transport layer
282 typedef struct SCI_SSP_TASK_IU
288 U32 task_function : 8;
299 #define SSP_RESPONSE_IU_MAX_DATA 64
301 #define SCI_SSP_RESPONSE_IU_DATA_PRESENT_MASK (0x03)
304 * @struct SCI_SSP_RESPONSE_IU
305 * @brief This structure depicts the contents of the SSP RESPONSE
306 * INFORMATION UNIT. For specific information on each of these
307 * individual fields please reference the SAS specification SSP
308 * transport layer section.
310 typedef struct SCI_SSP_RESPONSE_IU
314 U8 retry_delay_timer[2];
319 U8 sense_data_length[4];
320 U8 response_data_length[4];
322 U32 data[SSP_RESPONSE_IU_MAX_DATA];
324 } SCI_SSP_RESPONSE_IU_T;
327 * @enum _SCI_SAS_DATA_PRESENT_TYPE
328 * @brief This enumeration depicts the SAS specification defined SSP data present
329 * types in SCI_SSP_RESPONSE_IU.
331 typedef enum _SCI_SSP_RESPONSE_IU_DATA_PRESENT_TYPE
333 SCI_SSP_RESPONSE_IU_NO_DATA = 0x00,
334 SCI_SSP_RESPONSE_IU_RESPONSE_DATA = 0x01,
335 SCI_SSP_RESPONSE_IU_SENSE_DATA = 0x02
336 } SCI_SSP_RESPONSE_IU_DATA_PRESENT_TYPE_T;
339 * @struct SCI_SSP_FRAME_HEADER
341 * @brief This structure depicts the contents of an SSP frame header. For
342 * specific information on the individual fields please reference
343 * the SAS specification transport layer SSP frame format.
345 typedef struct SCI_SSP_FRAME_HEADER
348 U32 hashed_destination_address :24;
352 U32 hashed_source_address :24;
360 U32 retry_data_frames : 1;
362 U32 changing_data_pointer : 1;
369 U16 target_port_transfer_tag;
375 } SCI_SSP_FRAME_HEADER_T;
378 * @struct SMP_REQUEST_HEADER
379 * @brief This structure defines the contents of an SMP Request header.
380 * @note For specific information on each of these
381 * individual fields please reference the SAS specification.
383 typedef struct SMP_REQUEST_HEADER
385 U8 smp_frame_type; // byte 0
386 U8 function; // byte 1
387 U8 allocated_response_length; // byte 2
388 U8 request_length; // byte 3
389 } SMP_REQUEST_HEADER_T;
392 * @struct SMP_RESPONSE_HEADER
393 * @brief This structure depicts the contents of the SAS SMP DISCOVER
394 * RESPONSE frame. For specific information on each of these
395 * individual fields please reference the SAS specification Link
396 * layer section on address frames.
398 typedef struct SMP_RESPONSE_HEADER
400 U8 smp_frame_type; // byte 0
401 U8 function; // byte 1
402 U8 function_result; // byte 2
403 U8 response_length; // byte 3
404 } SMP_RESPONSE_HEADER_T;
407 * @struct SMP_REQUEST_GENERAL
408 * @brief This structure defines the contents of an SMP Request that
409 * is comprised of the SMP_REQUEST_HEADER and a CRC.
410 * @note For specific information on each of these
411 * individual fields please reference the SAS specification.
413 typedef struct SMP_REQUEST_GENERAL
415 U32 crc; // bytes 4-7
417 } SMP_REQUEST_GENERAL_T;
420 * @struct SMP_REQUEST_PHY_IDENTIFIER
421 * @brief This structure defines the contents of an SMP Request that
422 * is comprised of the SMP_REQUEST_HEADER and a phy identifier.
423 * Examples: SMP_REQUEST_DISCOVER, SMP_REQUEST_REPORT_PHY_SATA.
424 * @note For specific information on each of these
425 * individual fields please reference the SAS specification.
427 typedef struct SMP_REQUEST_PHY_IDENTIFIER
429 U32 reserved_byte4_7; // bytes 4-7
431 U32 ignore_zone_group:1; // byte 8
432 U32 reserved_byte8:7;
434 U32 phy_identifier:8; // byte 9
435 U32 reserved_byte10:8; // byte 10
436 U32 reserved_byte11:8; // byte 11
438 } SMP_REQUEST_PHY_IDENTIFIER_T;
441 * @struct SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION
442 * @brief This structure defines the contents of an SMP Configure Route
443 * Information request.
444 * @note For specific information on each of these
445 * individual fields please reference the SAS specification.
447 typedef struct SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION
449 U32 expected_expander_change_count:16; // bytes 4-5
450 U32 expander_route_index_high:8;
451 U32 expander_route_index:8; // bytes 6-7
453 U32 reserved_byte8:8; // bytes 8
454 U32 phy_identifier:8; // bytes 9
455 U32 reserved_byte_10_11:16; // bytes 10-11
457 U32 reserved_byte_12_bit_0_6:7;
458 U32 disable_route_entry:1; // byte 12
459 U32 reserved_byte_13_15:24; // bytes 13-15
461 U32 routed_sas_address[2]; // bytes 16-23
462 U8 reserved_byte_24_39[16]; // bytes 24-39
464 } SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION_T;
467 * @struct SMP_REQUEST_PHY_CONTROL
468 * @brief This structure defines the contents of an SMP Phy Controler
470 * @note For specific information on each of these
471 * individual fields please reference the SAS specification.
473 typedef struct SMP_REQUEST_PHY_CONTROL
475 U16 expected_expander_change_count; // byte 4-5
477 U16 reserved_byte_6_7; // byte 6-7
478 U8 reserved_byte_8; // byte 8
480 U8 phy_identifier; // byte 9
481 U8 phy_operation; // byte 10
483 U8 update_partial_pathway_timeout_value:1;
484 U8 reserved_byte_11_bit_1_7:7; // byte 11
486 U8 reserved_byte_12_23[12]; // byte 12-23
488 U8 attached_device_name[8]; // byte 24-31
490 U8 reserved_byte_32_bit_3_0:4; // byte 32
491 U8 programmed_minimum_physical_link_rate:4;
493 U8 reserved_byte_33_bit_3_0:4; // byte 33
494 U8 programmed_maximum_physical_link_rate:4;
496 U16 reserved_byte_34_35; // byte 34-35
498 U8 partial_pathway_timeout_value:4;
499 U8 reserved_byte_36_bit_4_7:4; // byte 36
501 U16 reserved_byte_37_38; // byte 37-38
502 U8 reserved_byte_39; // byte 39
504 } SMP_REQUEST_PHY_CONTROL_T;
507 * @struct SMP_REQUEST_VENDOR_SPECIFIC
508 * @brief This structure depicts the vendor specific space for SMP request.
510 #define SMP_REQUEST_VENDOR_SPECIFIC_MAX_LENGTH 1016
511 typedef struct SMP_REQUEST_VENDOR_SPECIFIC
513 U8 request_bytes[SMP_REQUEST_VENDOR_SPECIFIC_MAX_LENGTH];
514 }SMP_REQUEST_VENDOR_SPECIFIC_T;
517 * @struct SMP_REQUEST
518 * @brief This structure simply unionizes the existing request
519 * structures into a common request type.
521 typedef struct _SMP_REQUEST
523 SMP_REQUEST_HEADER_T header;
527 SMP_REQUEST_GENERAL_T report_general;
528 SMP_REQUEST_PHY_IDENTIFIER_T discover;
529 SMP_REQUEST_GENERAL_T report_manufacturer_information;
530 SMP_REQUEST_PHY_IDENTIFIER_T report_phy_sata;
531 SMP_REQUEST_PHY_CONTROL_T phy_control;
532 SMP_REQUEST_PHY_IDENTIFIER_T report_phy_error_log;
533 SMP_REQUEST_PHY_IDENTIFIER_T report_route_information;
534 SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION_T configure_route_information;
535 SMP_REQUEST_VENDOR_SPECIFIC_T vendor_specific_request;
542 * @struct SMP_RESPONSE_REPORT_GENERAL
543 * @brief This structure depicts the SMP Report General for
544 * expander devices. It adheres to the SAS-2.1 specification.
545 * @note For specific information on each of these
546 * individual fields please reference the SAS specification
547 * Application layer section on SMP.
549 typedef struct SMP_RESPONSE_REPORT_GENERAL
551 U16 expander_change_count; //byte 4-5
552 U16 expander_route_indexes; //byte 6-7
554 U32 reserved_byte8:7; //byte 8 bit 0-6
555 U32 long_response:1; //byte 8 bit 7
557 U32 number_of_phys:8; //byte 9
559 U32 configurable_route_table:1; //byte 10
561 U32 configures_others:1;
562 U32 open_reject_retry_supported:1;
563 U32 stp_continue_awt:1;
564 U32 self_configuring:1;
565 U32 zone_configuring:1;
566 U32 table_to_table_supported:1;
568 U32 reserved_byte11:8; //byte 11
570 U32 enclosure_logical_identifier_high; //byte 12-15
571 U32 enclosure_logical_identifier_low; //byte 16-19
573 U32 reserved_byte20_23;
574 U32 reserved_byte24_27;
576 } SMP_RESPONSE_REPORT_GENERAL_T;
578 typedef struct SMP_RESPONSE_REPORT_GENERAL_LONG
580 SMP_RESPONSE_REPORT_GENERAL_T sas1_1;
585 U16 stp_bus_inactivity_time_limit;
586 U16 stp_max_connect_time_limit;
587 U16 stp_smp_i_t_nexus_loss_time;
589 U32 zoning_enabled : 1;
590 U32 zoning_supported : 1;
591 U32 physicaL_presence_asserted : 1;
594 U32 num_zone_groups : 3;
595 U32 saving_zoning_enabled_supported : 3;
596 U32 saving_zone_perms_table_supported : 1;
597 U32 saving_zone_phy_info_supported : 1;
598 U32 saving_zone_manager_password_supported : 1;
601 U32 max_number_routed_sas_addresses : 16;
603 SCI_SAS_ADDRESS_T active_zone_manager_sas_address;
605 U16 zone_lock_inactivity_time_limit;
609 U8 first_enclosure_connector_element_index;
610 U8 number_of_enclosure_connector_element_indices;
614 U32 reduced_functionality : 1;
615 U32 time_to_reduce_functionality : 8;
616 U32 initial_time_to_reduce_functionality : 8;
617 U8 max_reduced_functionality_time;
619 U16 last_self_config_status_descriptor_index;
620 U16 max_number_of_stored_self_config_status_descriptors;
622 U16 last_phy_event_list_descriptor_index;
623 U16 max_number_of_stored_phy_event_list_descriptors;
626 } SMP_RESPONSE_REPORT_GENERAL_LONG_T;
629 * @struct SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION
630 * @brief This structure depicts the SMP report manufacturer
631 * information for expander devices. It adheres to the
632 * SAS-2.1 specification.
633 * @note For specific information on each of these
634 * individual fields please reference the SAS specification
635 * Application layer section on SMP.
637 typedef struct SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION
639 U32 expander_change_count : 16; // bytes 4-5
642 U32 sas1_1_format : 1;
647 U8 product_revision_level[4];
648 U8 component_vendor_id[8];
650 U8 component_revision_level;
652 U8 vendor_specific[8];
654 } SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION_T;
656 #define SMP_RESPONSE_DISCOVER_FORMAT_1_1_SIZE 52
657 #define SMP_RESPONSE_DISCOVER_FORMAT_2_SIZE 116
660 * @struct SMP_DISCOVER_RESPONSE_PROTOCOLS
661 * @brief This structure depicts the discover response where the
662 * supported protocols by the remote phy are specified.
663 * @note For specific information on each of these
664 * individual fields please reference the SAS specification
665 * Link layer section on address frames.
667 typedef struct SMP_DISCOVER_RESPONSE_PROTOCOLS
673 U16 attached_sata_host : 1;
674 U16 attached_smp_initiator : 1;
675 U16 attached_stp_initiator : 1;
676 U16 attached_ssp_initiator : 1;
678 U16 attached_sata_device : 1;
679 U16 attached_smp_target : 1;
680 U16 attached_stp_target : 1;
681 U16 attached_ssp_target : 1;
683 U16 attached_sata_port_selector : 1;
689 } SMP_DISCOVER_RESPONSE_PROTOCOLS_T;
692 * @struct SMP_RESPONSE_DISCOVER_FORMAT
693 * @brief This structure defines the SMP phy discover response format.
694 * It handles both SAS1.1 and SAS 2 definitions. The unions
695 * indicate locations where the SAS specification versions
696 * differ from one another.
698 typedef struct SMP_RESPONSE_DISCOVER
710 U16 expander_change_count;
724 U16 attached_device_type : 3;
726 U16 negotiated_physical_link_rate : 4;
732 U16 attached_reason : 4;
733 U16 attached_device_type : 3;
735 U16 negotiated_logical_link_rate : 4;
741 SMP_DISCOVER_RESPONSE_PROTOCOLS_T protocols;
742 SCI_SAS_ADDRESS_T sas_address;
743 SCI_SAS_ADDRESS_T attached_sas_address;
745 U8 attached_phy_identifier;
756 U8 attached_break_reply_capable : 1;
757 U8 attached_requested_inside_zpsds : 1;
758 U8 attached_inside_zpsds_persistent : 1;
764 U8 reserved_for_identify[6];
766 U32 hardware_min_physical_link_rate : 4;
767 U32 programmed_min_physical_link_rate : 4;
768 U32 hardware_max_physical_link_rate : 4;
769 U32 programmed_max_physical_link_rate : 4;
770 U32 phy_change_count : 8;
771 U32 partial_pathway_timeout_value : 4;
775 U32 routing_attribute : 4;
777 U32 connector_type : 7;
779 U32 connector_element_index : 8;
780 U32 connector_physical_link : 8;
790 * In the SAS 1.1 specification this structure ends after 52 bytes.
791 * As a result, the contents of this field should never have a
792 * real value. It is undefined.
794 U8 undefined[SMP_RESPONSE_DISCOVER_FORMAT_2_SIZE
795 - SMP_RESPONSE_DISCOVER_FORMAT_1_1_SIZE];
800 SCI_SAS_ADDRESS_T attached_device_name;
802 U32 zoning_enabled : 1;
803 U32 inside_zpsds : 1;
804 U32 zone_group_persistent : 1;
806 U32 requested_inside_zpsds : 1;
807 U32 inside_zpsds_persistent : 1;
808 U32 requested_inside_zpsds_changed_by_expander : 1;
810 U32 reserved_for_zoning_fields : 16;
813 U8 self_configuration_status;
814 U8 self_configuration_levels_completed;
815 U16 reserved_for_self_config_fields;
817 SCI_SAS_ADDRESS_T self_configuration_sas_address;
819 U32 programmed_phy_capabilities;
820 U32 current_phy_capabilities;
821 U32 attached_phy_capabilities;
826 U32 negotiated_physical_link_rate : 4;
828 U32 hardware_muxing_supported : 1;
829 U32 negotiated_ssc : 1;
832 U32 default_zoning_enabled : 1;
834 U32 default_zone_group_persistent : 1;
836 U32 default_requested_inside_zpsds : 1;
837 U32 default_inside_zpsds_persistent : 1;
840 U32 default_zone_group : 8;
842 U32 saved_zoning_enabled : 1;
844 U32 saved_zone_group_persistent : 1;
846 U32 saved_requested_inside_zpsds : 1;
847 U32 saved_inside_zpsds_persistent : 1;
849 U32 saved_zone_group : 8;
852 U32 shadow_zone_group_persistent : 1;
854 U32 shadow_requested_inside_zpsds : 1;
855 U32 shadow_inside_zpsds_persistent : 1;
857 U32 shadow_zone_group : 8;
859 U8 device_slot_number;
860 U8 device_slot_group_number;
861 U8 device_slot_group_output_connector[6];
866 } SMP_RESPONSE_DISCOVER_T;
869 * @struct SMP_RESPONSE_REPORT_PHY_SATA
870 * @brief This structure depicts the contents of the SAS SMP REPORT
871 * PHY SATA frame. For specific information on each of these
872 * individual fields please reference the SAS specification Link
873 * layer section on address frames.
875 typedef struct SMP_RESPONSE_REPORT_PHY_SATA
877 U32 ignored_byte_4_7; // bytes 4-7
879 U32 affiliations_valid:1;
880 U32 affiliations_supported:1;
881 U32 reserved_byte11:6; // byte 11
882 U32 ignored_byte10:8; // byte 10
883 U32 phy_identifier:8; // byte 9
884 U32 reserved_byte_8:8; // byte 8
887 U32 stp_sas_address[2];
888 U8 device_to_host_fis[20];
890 U32 affiliated_stp_initiator_sas_address[2];
892 } SMP_RESPONSE_REPORT_PHY_SATA_T;
894 typedef struct SMP_RESPONSE_VENDOR_SPECIFIC
896 U8 response_bytes[SMP_REQUEST_VENDOR_SPECIFIC_MAX_LENGTH];
897 }SMP_RESPONSE_VENDOR_SPECIFIC_T;
899 typedef union SMP_RESPONSE_BODY
901 SMP_RESPONSE_REPORT_GENERAL_T report_general;
902 SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION_T report_manufacturer_information;
903 SMP_RESPONSE_DISCOVER_T discover;
904 SMP_RESPONSE_REPORT_PHY_SATA_T report_phy_sata;
905 SMP_RESPONSE_VENDOR_SPECIFIC_T vendor_specific_response;
906 } SMP_RESPONSE_BODY_T;
909 * @struct SMP_RESPONSE
910 * @brief This structure simply unionizes the existing response
911 * structures into a common response type.
913 typedef struct _SMP_RESPONSE
915 SMP_RESPONSE_HEADER_T header;
917 SMP_RESPONSE_BODY_T response;
921 // SMP Request Functions
922 #define SMP_FUNCTION_REPORT_GENERAL 0x00
923 #define SMP_FUNCTION_REPORT_MANUFACTURER_INFORMATION 0x01
924 #define SMP_FUNCTION_DISCOVER 0x10
925 #define SMP_FUNCTION_REPORT_PHY_ERROR_LOG 0x11
926 #define SMP_FUNCTION_REPORT_PHY_SATA 0x12
927 #define SMP_FUNCTION_REPORT_ROUTE_INFORMATION 0X13
928 #define SMP_FUNCTION_CONFIGURE_ROUTE_INFORMATION 0X90
929 #define SMP_FUNCTION_PHY_CONTROL 0x91
930 #define SMP_FUNCTION_PHY_TEST 0x92
932 #define SMP_FRAME_TYPE_REQUEST 0x40
933 #define SMP_FRAME_TYPE_RESPONSE 0x41
935 #define PHY_OPERATION_NOP 0x00
936 #define PHY_OPERATION_LINK_RESET 0x01
937 #define PHY_OPERATION_HARD_RESET 0x02
938 #define PHY_OPERATION_DISABLE 0x03
939 #define PHY_OPERATION_CLEAR_ERROR_LOG 0x05
940 #define PHY_OPERATION_CLEAR_AFFILIATION 0x06
942 #define NPLR_PHY_ENABLED_UNK_LINK_RATE 0x00
943 #define NPLR_PHY_DISABLED 0x01
944 #define NPLR_PHY_ENABLED_SPD_NEG_FAILED 0x02
945 #define NPLR_PHY_ENABLED_SATA_HOLD 0x03
946 #define NPLR_PHY_ENABLED_1_5G 0x08
947 #define NPLR_PHY_ENABLED_3_0G 0x09
949 // SMP Function Result values.
950 #define SMP_RESULT_FUNCTION_ACCEPTED 0x00
951 #define SMP_RESULT_UNKNOWN_FUNCTION 0x01
952 #define SMP_RESULT_FUNCTION_FAILED 0x02
953 #define SMP_RESULT_INVALID_REQUEST_FRAME_LEN 0x03
954 #define SMP_RESULT_INAVALID_EXPANDER_CHANGE_COUNT 0x04
955 #define SMP_RESULT_BUSY 0x05
956 #define SMP_RESULT_INCOMPLETE_DESCRIPTOR_LIST 0x06
957 #define SMP_RESULT_PHY_DOES_NOT_EXIST 0x10
958 #define SMP_RESULT_INDEX_DOES_NOT_EXIST 0x11
959 #define SMP_RESULT_PHY_DOES_NOT_SUPPORT_SATA 0x12
960 #define SMP_RESULT_UNKNOWN_PHY_OPERATION 0x13
961 #define SMP_RESULT_UNKNOWN_PHY_TEST_FUNCTION 0x14
962 #define SMP_RESULT_PHY_TEST_IN_PROGRESS 0x15
963 #define SMP_RESULT_PHY_VACANT 0x16
965 /* Attached Device Types */
966 #define SMP_NO_DEVICE_ATTACHED 0
967 #define SMP_END_DEVICE_ONLY 1
968 #define SMP_EDGE_EXPANDER_DEVICE 2
969 #define SMP_FANOUT_EXPANDER_DEVICE 3
971 /* Expander phy routine attribute */
972 #define DIRECT_ROUTING_ATTRIBUTE 0
973 #define SUBTRACTIVE_ROUTING_ATTRIBUTE 1
974 #define TABLE_ROUTING_ATTRIBUTE 2
976 #endif // _INTEL_SAS_H_