2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 * The full GNU General Public License is included in this distribution
24 * in the file called LICENSE.GPL.
28 * Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
35 * * Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in
39 * the documentation and/or other materials provided with the
42 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 * @brief This file contains all of the definitions relating to structures,
63 * constants, etc. defined by the SAS specification.
66 #include <dev/isci/types.h>
67 #include <dev/isci/scil/intel_sata.h>
68 #include <dev/isci/scil/intel_scsi.h>
71 * @struct SCI_SAS_ADDRESS
72 * @brief This structure depicts how a SAS address is represented by SCI.
74 typedef struct SCI_SAS_ADDRESS
77 * This member contains the higher 32-bits of the SAS address.
82 * This member contains the lower 32-bits of the SAS address.
89 * @struct SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS
90 * @brief This structure depicts the contents of bytes 2 and 3 in the
91 * SAS IDENTIFY ADDRESS FRAME (IAF).
92 * @note For specific information on each of these
93 * individual fields please reference the SAS specification
94 * Link layer section on address frames.
96 typedef struct SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS
103 U16 smp_initiator : 1;
104 U16 stp_initiator : 1;
105 U16 ssp_initiator : 1;
117 } SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS_T;
120 * @struct SCI_SAS_IDENTIFY_ADDRESS_FRAME
121 * @brief This structure depicts the contents of the SAS IDENTIFY ADDRESS
123 * @note For specific information on each of these
124 * individual fields please reference the SAS specification
125 * Link layer section on address frames.
127 typedef struct SCI_SAS_IDENTIFY_ADDRESS_FRAME
129 U16 address_frame_type : 4;
135 SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS_T protocols;
137 SCI_SAS_ADDRESS_T device_name;
138 SCI_SAS_ADDRESS_T sas_address;
140 U32 phy_identifier : 8;
141 U32 break_reply_capable : 1;
142 U32 requested_in_zpsds : 1;
143 U32 in_zpsds_persistent : 1;
148 } SCI_SAS_IDENTIFY_ADDRESS_FRAME_T;
151 * @struct SAS_CAPABILITIES
152 * @brief This structure depicts the various SAS capabilities supported
153 * by the directly attached target device. For specific information
154 * on each of these individual fields please reference the SAS
155 * specification Phy layer section on speed negotiation windows.
157 typedef struct SAS_CAPABILITIES
161 #if defined (SCIC_SDS_4_ENABLED)
165 * The SAS specification indicates the start bit shall always be set to
166 * 1. This implementation will have the start bit set to 0 if the
167 * PHY CAPABILITIES were either not received or speed negotiation failed.
172 U32 requested_logical_link_rate : 4;
174 U32 gen1_without_ssc_supported : 1;
175 U32 gen1_with_ssc_supported : 1;
176 U32 gen2_without_ssc_supported : 1;
177 U32 gen2_with_ssc_supported : 1;
178 U32 gen3_without_ssc_supported : 1;
179 U32 gen3_with_ssc_supported : 1;
183 #endif // (SCIC_SDS_4_ENABLED)
188 } SAS_CAPABILITIES_T;
191 * @enum _SCI_SAS_LINK_RATE
192 * @brief This enumeration depicts the SAS specification defined link speeds.
194 typedef enum _SCI_SAS_LINK_RATE
196 SCI_SAS_NO_LINK_RATE = 0,
197 SCI_SATA_SPINUP_HOLD = 0x3,
198 SCI_SAS_150_GB = 0x8,
199 SCI_SAS_300_GB = 0x9,
204 * @enum _SCI_SAS_TASK_ATTRIBUTE
205 * @brief This enumeration depicts the SAM/SAS specification defined task
206 * attribute values for a command information unit.
208 typedef enum _SCI_SAS_TASK_ATTRIBUTE
210 SCI_SAS_SIMPLE_ATTRIBUTE = 0,
211 SCI_SAS_HEAD_OF_QUEUE_ATTRIBUTE = 1,
212 SCI_SAS_ORDERED_ATTRIBUTE = 2,
213 SCI_SAS_ACA_ATTRIBUTE = 4,
214 } SCI_SAS_TASK_ATTRIBUTE;
217 * @enum _SCI_SAS_TASK_MGMT_FUNCTION
218 * @brief This enumeration depicts the SAM/SAS specification defined task
219 * management functions.
220 * @note This HARD_RESET function listed here is not actually defined
221 * as a task management function in the industry standard.
223 typedef enum _SCI_SAS_TASK_MGMT_FUNCTION
225 SCI_SAS_ABORT_TASK = SCSI_TASK_REQUEST_ABORT_TASK,
226 SCI_SAS_ABORT_TASK_SET = SCSI_TASK_REQUEST_ABORT_TASK_SET,
227 SCI_SAS_CLEAR_TASK_SET = SCSI_TASK_REQUEST_CLEAR_TASK_SET,
228 SCI_SAS_LOGICAL_UNIT_RESET = SCSI_TASK_REQUEST_LOGICAL_UNIT_RESET,
229 SCI_SAS_I_T_NEXUS_RESET = SCSI_TASK_REQUEST_I_T_NEXUS_RESET,
230 SCI_SAS_CLEAR_ACA = SCSI_TASK_REQUEST_CLEAR_ACA,
231 SCI_SAS_QUERY_TASK = SCSI_TASK_REQUEST_QUERY_TASK,
232 SCI_SAS_QUERY_TASK_SET = SCSI_TASK_REQUEST_QUERY_TASK_SET,
233 SCI_SAS_QUERY_ASYNCHRONOUS_EVENT = SCSI_TASK_REQUEST_QUERY_UNIT_ATTENTION,
234 SCI_SAS_HARD_RESET = 0xFF
235 } SCI_SAS_TASK_MGMT_FUNCTION_T;
239 * @enum _SCI_SAS_FRAME_TYPE
240 * @brief This enumeration depicts the SAS specification defined SSP frame
243 typedef enum _SCI_SAS_FRAME_TYPE
245 SCI_SAS_DATA_FRAME = 0x01,
246 SCI_SAS_XFER_RDY_FRAME = 0x05,
247 SCI_SAS_COMMAND_FRAME = 0x06,
248 SCI_SAS_RESPONSE_FRAME = 0x07,
249 SCI_SAS_TASK_FRAME = 0x16
250 } SCI_SAS_FRAME_TYPE_T;
254 * @struct SCI_SSP_COMMAND_IU
255 * @brief This structure depicts the contents of the SSP COMMAND
256 * INFORMATION UNIT. For specific information on each of these
257 * individual fields please reference the SAS specification SSP
258 * transport layer section.
260 typedef struct SCI_SSP_COMMAND_IU
265 U32 additional_cdb_length : 6;
268 U32 enable_first_burst : 1;
269 U32 task_priority : 4;
270 U32 task_attribute : 3;
275 } SCI_SSP_COMMAND_IU_T;
278 * @struct SCI_SSP_TASK_IU
279 * @brief This structure depicts the contents of the SSP TASK INFORMATION
280 * UNIT. For specific information on each of these individual fields
281 * please reference the SAS specification SSP transport layer
284 typedef struct SCI_SSP_TASK_IU
290 U32 task_function : 8;
301 #define SSP_RESPONSE_IU_MAX_DATA 64
303 #define SCI_SSP_RESPONSE_IU_DATA_PRESENT_MASK (0x03)
306 * @struct SCI_SSP_RESPONSE_IU
307 * @brief This structure depicts the contents of the SSP RESPONSE
308 * INFORMATION UNIT. For specific information on each of these
309 * individual fields please reference the SAS specification SSP
310 * transport layer section.
312 typedef struct SCI_SSP_RESPONSE_IU
316 U8 retry_delay_timer[2];
321 U8 sense_data_length[4];
322 U8 response_data_length[4];
324 U32 data[SSP_RESPONSE_IU_MAX_DATA];
326 } SCI_SSP_RESPONSE_IU_T;
329 * @enum _SCI_SAS_DATA_PRESENT_TYPE
330 * @brief This enumeration depicts the SAS specification defined SSP data present
331 * types in SCI_SSP_RESPONSE_IU.
333 typedef enum _SCI_SSP_RESPONSE_IU_DATA_PRESENT_TYPE
335 SCI_SSP_RESPONSE_IU_NO_DATA = 0x00,
336 SCI_SSP_RESPONSE_IU_RESPONSE_DATA = 0x01,
337 SCI_SSP_RESPONSE_IU_SENSE_DATA = 0x02
338 } SCI_SSP_RESPONSE_IU_DATA_PRESENT_TYPE_T;
341 * @struct SCI_SSP_FRAME_HEADER
343 * @brief This structure depicts the contents of an SSP frame header. For
344 * specific information on the individual fields please reference
345 * the SAS specification transport layer SSP frame format.
347 typedef struct SCI_SSP_FRAME_HEADER
350 U32 hashed_destination_address :24;
354 U32 hashed_source_address :24;
362 U32 retry_data_frames : 1;
364 U32 changing_data_pointer : 1;
371 U16 target_port_transfer_tag;
377 } SCI_SSP_FRAME_HEADER_T;
380 * @struct SMP_REQUEST_HEADER
381 * @brief This structure defines the contents of an SMP Request header.
382 * @note For specific information on each of these
383 * individual fields please reference the SAS specification.
385 typedef struct SMP_REQUEST_HEADER
387 U8 smp_frame_type; // byte 0
388 U8 function; // byte 1
389 U8 allocated_response_length; // byte 2
390 U8 request_length; // byte 3
391 } SMP_REQUEST_HEADER_T;
394 * @struct SMP_RESPONSE_HEADER
395 * @brief This structure depicts the contents of the SAS SMP DISCOVER
396 * RESPONSE frame. For specific information on each of these
397 * individual fields please reference the SAS specification Link
398 * layer section on address frames.
400 typedef struct SMP_RESPONSE_HEADER
402 U8 smp_frame_type; // byte 0
403 U8 function; // byte 1
404 U8 function_result; // byte 2
405 U8 response_length; // byte 3
406 } SMP_RESPONSE_HEADER_T;
409 * @struct SMP_REQUEST_GENERAL
410 * @brief This structure defines the contents of an SMP Request that
411 * is comprised of the SMP_REQUEST_HEADER and a CRC.
412 * @note For specific information on each of these
413 * individual fields please reference the SAS specification.
415 typedef struct SMP_REQUEST_GENERAL
417 U32 crc; // bytes 4-7
419 } SMP_REQUEST_GENERAL_T;
422 * @struct SMP_REQUEST_PHY_IDENTIFIER
423 * @brief This structure defines the contents of an SMP Request that
424 * is comprised of the SMP_REQUEST_HEADER and a phy identifier.
425 * Examples: SMP_REQUEST_DISCOVER, SMP_REQUEST_REPORT_PHY_SATA.
426 * @note For specific information on each of these
427 * individual fields please reference the SAS specification.
429 typedef struct SMP_REQUEST_PHY_IDENTIFIER
431 U32 reserved_byte4_7; // bytes 4-7
433 U32 ignore_zone_group:1; // byte 8
434 U32 reserved_byte8:7;
436 U32 phy_identifier:8; // byte 9
437 U32 reserved_byte10:8; // byte 10
438 U32 reserved_byte11:8; // byte 11
440 } SMP_REQUEST_PHY_IDENTIFIER_T;
443 * @struct SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION
444 * @brief This structure defines the contents of an SMP Configure Route
445 * Information request.
446 * @note For specific information on each of these
447 * individual fields please reference the SAS specification.
449 typedef struct SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION
451 U32 expected_expander_change_count:16; // bytes 4-5
452 U32 expander_route_index_high:8;
453 U32 expander_route_index:8; // bytes 6-7
455 U32 reserved_byte8:8; // bytes 8
456 U32 phy_identifier:8; // bytes 9
457 U32 reserved_byte_10_11:16; // bytes 10-11
459 U32 reserved_byte_12_bit_0_6:7;
460 U32 disable_route_entry:1; // byte 12
461 U32 reserved_byte_13_15:24; // bytes 13-15
463 U32 routed_sas_address[2]; // bytes 16-23
464 U8 reserved_byte_24_39[16]; // bytes 24-39
466 } SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION_T;
469 * @struct SMP_REQUEST_PHY_CONTROL
470 * @brief This structure defines the contents of an SMP Phy Controller
472 * @note For specific information on each of these
473 * individual fields please reference the SAS specification.
475 typedef struct SMP_REQUEST_PHY_CONTROL
477 U16 expected_expander_change_count; // byte 4-5
479 U16 reserved_byte_6_7; // byte 6-7
480 U8 reserved_byte_8; // byte 8
482 U8 phy_identifier; // byte 9
483 U8 phy_operation; // byte 10
485 U8 update_partial_pathway_timeout_value:1;
486 U8 reserved_byte_11_bit_1_7:7; // byte 11
488 U8 reserved_byte_12_23[12]; // byte 12-23
490 U8 attached_device_name[8]; // byte 24-31
492 U8 reserved_byte_32_bit_3_0:4; // byte 32
493 U8 programmed_minimum_physical_link_rate:4;
495 U8 reserved_byte_33_bit_3_0:4; // byte 33
496 U8 programmed_maximum_physical_link_rate:4;
498 U16 reserved_byte_34_35; // byte 34-35
500 U8 partial_pathway_timeout_value:4;
501 U8 reserved_byte_36_bit_4_7:4; // byte 36
503 U16 reserved_byte_37_38; // byte 37-38
504 U8 reserved_byte_39; // byte 39
506 } SMP_REQUEST_PHY_CONTROL_T;
509 * @struct SMP_REQUEST_VENDOR_SPECIFIC
510 * @brief This structure depicts the vendor specific space for SMP request.
512 #define SMP_REQUEST_VENDOR_SPECIFIC_MAX_LENGTH 1016
513 typedef struct SMP_REQUEST_VENDOR_SPECIFIC
515 U8 request_bytes[SMP_REQUEST_VENDOR_SPECIFIC_MAX_LENGTH];
516 }SMP_REQUEST_VENDOR_SPECIFIC_T;
519 * @struct SMP_REQUEST
520 * @brief This structure simply unionizes the existing request
521 * structures into a common request type.
523 typedef struct _SMP_REQUEST
525 SMP_REQUEST_HEADER_T header;
529 SMP_REQUEST_GENERAL_T report_general;
530 SMP_REQUEST_PHY_IDENTIFIER_T discover;
531 SMP_REQUEST_GENERAL_T report_manufacturer_information;
532 SMP_REQUEST_PHY_IDENTIFIER_T report_phy_sata;
533 SMP_REQUEST_PHY_CONTROL_T phy_control;
534 SMP_REQUEST_PHY_IDENTIFIER_T report_phy_error_log;
535 SMP_REQUEST_PHY_IDENTIFIER_T report_route_information;
536 SMP_REQUEST_CONFIGURE_ROUTE_INFORMATION_T configure_route_information;
537 SMP_REQUEST_VENDOR_SPECIFIC_T vendor_specific_request;
544 * @struct SMP_RESPONSE_REPORT_GENERAL
545 * @brief This structure depicts the SMP Report General for
546 * expander devices. It adheres to the SAS-2.1 specification.
547 * @note For specific information on each of these
548 * individual fields please reference the SAS specification
549 * Application layer section on SMP.
551 typedef struct SMP_RESPONSE_REPORT_GENERAL
553 U16 expander_change_count; //byte 4-5
554 U16 expander_route_indexes; //byte 6-7
556 U32 reserved_byte8:7; //byte 8 bit 0-6
557 U32 long_response:1; //byte 8 bit 7
559 U32 number_of_phys:8; //byte 9
561 U32 configurable_route_table:1; //byte 10
563 U32 configures_others:1;
564 U32 open_reject_retry_supported:1;
565 U32 stp_continue_awt:1;
566 U32 self_configuring:1;
567 U32 zone_configuring:1;
568 U32 table_to_table_supported:1;
570 U32 reserved_byte11:8; //byte 11
572 U32 enclosure_logical_identifier_high; //byte 12-15
573 U32 enclosure_logical_identifier_low; //byte 16-19
575 U32 reserved_byte20_23;
576 U32 reserved_byte24_27;
578 } SMP_RESPONSE_REPORT_GENERAL_T;
580 typedef struct SMP_RESPONSE_REPORT_GENERAL_LONG
582 SMP_RESPONSE_REPORT_GENERAL_T sas1_1;
587 U16 stp_bus_inactivity_time_limit;
588 U16 stp_max_connect_time_limit;
589 U16 stp_smp_i_t_nexus_loss_time;
591 U32 zoning_enabled : 1;
592 U32 zoning_supported : 1;
593 U32 physicaL_presence_asserted : 1;
596 U32 num_zone_groups : 3;
597 U32 saving_zoning_enabled_supported : 3;
598 U32 saving_zone_perms_table_supported : 1;
599 U32 saving_zone_phy_info_supported : 1;
600 U32 saving_zone_manager_password_supported : 1;
603 U32 max_number_routed_sas_addresses : 16;
605 SCI_SAS_ADDRESS_T active_zone_manager_sas_address;
607 U16 zone_lock_inactivity_time_limit;
611 U8 first_enclosure_connector_element_index;
612 U8 number_of_enclosure_connector_element_indices;
616 U32 reduced_functionality : 1;
617 U32 time_to_reduce_functionality : 8;
618 U32 initial_time_to_reduce_functionality : 8;
619 U8 max_reduced_functionality_time;
621 U16 last_self_config_status_descriptor_index;
622 U16 max_number_of_stored_self_config_status_descriptors;
624 U16 last_phy_event_list_descriptor_index;
625 U16 max_number_of_stored_phy_event_list_descriptors;
628 } SMP_RESPONSE_REPORT_GENERAL_LONG_T;
631 * @struct SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION
632 * @brief This structure depicts the SMP report manufacturer
633 * information for expander devices. It adheres to the
634 * SAS-2.1 specification.
635 * @note For specific information on each of these
636 * individual fields please reference the SAS specification
637 * Application layer section on SMP.
639 typedef struct SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION
641 U32 expander_change_count : 16; // bytes 4-5
644 U32 sas1_1_format : 1;
649 U8 product_revision_level[4];
650 U8 component_vendor_id[8];
652 U8 component_revision_level;
654 U8 vendor_specific[8];
656 } SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION_T;
658 #define SMP_RESPONSE_DISCOVER_FORMAT_1_1_SIZE 52
659 #define SMP_RESPONSE_DISCOVER_FORMAT_2_SIZE 116
662 * @struct SMP_DISCOVER_RESPONSE_PROTOCOLS
663 * @brief This structure depicts the discover response where the
664 * supported protocols by the remote phy are specified.
665 * @note For specific information on each of these
666 * individual fields please reference the SAS specification
667 * Link layer section on address frames.
669 typedef struct SMP_DISCOVER_RESPONSE_PROTOCOLS
675 U16 attached_sata_host : 1;
676 U16 attached_smp_initiator : 1;
677 U16 attached_stp_initiator : 1;
678 U16 attached_ssp_initiator : 1;
680 U16 attached_sata_device : 1;
681 U16 attached_smp_target : 1;
682 U16 attached_stp_target : 1;
683 U16 attached_ssp_target : 1;
685 U16 attached_sata_port_selector : 1;
691 } SMP_DISCOVER_RESPONSE_PROTOCOLS_T;
694 * @struct SMP_RESPONSE_DISCOVER_FORMAT
695 * @brief This structure defines the SMP phy discover response format.
696 * It handles both SAS1.1 and SAS 2 definitions. The unions
697 * indicate locations where the SAS specification versions
698 * differ from one another.
700 typedef struct SMP_RESPONSE_DISCOVER
712 U16 expander_change_count;
726 U16 attached_device_type : 3;
728 U16 negotiated_physical_link_rate : 4;
734 U16 attached_reason : 4;
735 U16 attached_device_type : 3;
737 U16 negotiated_logical_link_rate : 4;
743 SMP_DISCOVER_RESPONSE_PROTOCOLS_T protocols;
744 SCI_SAS_ADDRESS_T sas_address;
745 SCI_SAS_ADDRESS_T attached_sas_address;
747 U8 attached_phy_identifier;
758 U8 attached_break_reply_capable : 1;
759 U8 attached_requested_inside_zpsds : 1;
760 U8 attached_inside_zpsds_persistent : 1;
766 U8 reserved_for_identify[6];
768 U32 hardware_min_physical_link_rate : 4;
769 U32 programmed_min_physical_link_rate : 4;
770 U32 hardware_max_physical_link_rate : 4;
771 U32 programmed_max_physical_link_rate : 4;
772 U32 phy_change_count : 8;
773 U32 partial_pathway_timeout_value : 4;
777 U32 routing_attribute : 4;
779 U32 connector_type : 7;
781 U32 connector_element_index : 8;
782 U32 connector_physical_link : 8;
792 * In the SAS 1.1 specification this structure ends after 52 bytes.
793 * As a result, the contents of this field should never have a
794 * real value. It is undefined.
796 U8 undefined[SMP_RESPONSE_DISCOVER_FORMAT_2_SIZE
797 - SMP_RESPONSE_DISCOVER_FORMAT_1_1_SIZE];
802 SCI_SAS_ADDRESS_T attached_device_name;
804 U32 zoning_enabled : 1;
805 U32 inside_zpsds : 1;
806 U32 zone_group_persistent : 1;
808 U32 requested_inside_zpsds : 1;
809 U32 inside_zpsds_persistent : 1;
810 U32 requested_inside_zpsds_changed_by_expander : 1;
812 U32 reserved_for_zoning_fields : 16;
815 U8 self_configuration_status;
816 U8 self_configuration_levels_completed;
817 U16 reserved_for_self_config_fields;
819 SCI_SAS_ADDRESS_T self_configuration_sas_address;
821 U32 programmed_phy_capabilities;
822 U32 current_phy_capabilities;
823 U32 attached_phy_capabilities;
828 U32 negotiated_physical_link_rate : 4;
830 U32 hardware_muxing_supported : 1;
831 U32 negotiated_ssc : 1;
834 U32 default_zoning_enabled : 1;
836 U32 default_zone_group_persistent : 1;
838 U32 default_requested_inside_zpsds : 1;
839 U32 default_inside_zpsds_persistent : 1;
842 U32 default_zone_group : 8;
844 U32 saved_zoning_enabled : 1;
846 U32 saved_zone_group_persistent : 1;
848 U32 saved_requested_inside_zpsds : 1;
849 U32 saved_inside_zpsds_persistent : 1;
851 U32 saved_zone_group : 8;
854 U32 shadow_zone_group_persistent : 1;
856 U32 shadow_requested_inside_zpsds : 1;
857 U32 shadow_inside_zpsds_persistent : 1;
859 U32 shadow_zone_group : 8;
861 U8 device_slot_number;
862 U8 device_slot_group_number;
863 U8 device_slot_group_output_connector[6];
868 } SMP_RESPONSE_DISCOVER_T;
871 * @struct SMP_RESPONSE_REPORT_PHY_SATA
872 * @brief This structure depicts the contents of the SAS SMP REPORT
873 * PHY SATA frame. For specific information on each of these
874 * individual fields please reference the SAS specification Link
875 * layer section on address frames.
877 typedef struct SMP_RESPONSE_REPORT_PHY_SATA
879 U32 ignored_byte_4_7; // bytes 4-7
881 U32 affiliations_valid:1;
882 U32 affiliations_supported:1;
883 U32 reserved_byte11:6; // byte 11
884 U32 ignored_byte10:8; // byte 10
885 U32 phy_identifier:8; // byte 9
886 U32 reserved_byte_8:8; // byte 8
889 U32 stp_sas_address[2];
890 U8 device_to_host_fis[20];
892 U32 affiliated_stp_initiator_sas_address[2];
894 } SMP_RESPONSE_REPORT_PHY_SATA_T;
896 typedef struct SMP_RESPONSE_VENDOR_SPECIFIC
898 U8 response_bytes[SMP_REQUEST_VENDOR_SPECIFIC_MAX_LENGTH];
899 }SMP_RESPONSE_VENDOR_SPECIFIC_T;
901 typedef union SMP_RESPONSE_BODY
903 SMP_RESPONSE_REPORT_GENERAL_T report_general;
904 SMP_RESPONSE_REPORT_MANUFACTURER_INFORMATION_T report_manufacturer_information;
905 SMP_RESPONSE_DISCOVER_T discover;
906 SMP_RESPONSE_REPORT_PHY_SATA_T report_phy_sata;
907 SMP_RESPONSE_VENDOR_SPECIFIC_T vendor_specific_response;
908 } SMP_RESPONSE_BODY_T;
911 * @struct SMP_RESPONSE
912 * @brief This structure simply unionizes the existing response
913 * structures into a common response type.
915 typedef struct _SMP_RESPONSE
917 SMP_RESPONSE_HEADER_T header;
919 SMP_RESPONSE_BODY_T response;
923 // SMP Request Functions
924 #define SMP_FUNCTION_REPORT_GENERAL 0x00
925 #define SMP_FUNCTION_REPORT_MANUFACTURER_INFORMATION 0x01
926 #define SMP_FUNCTION_DISCOVER 0x10
927 #define SMP_FUNCTION_REPORT_PHY_ERROR_LOG 0x11
928 #define SMP_FUNCTION_REPORT_PHY_SATA 0x12
929 #define SMP_FUNCTION_REPORT_ROUTE_INFORMATION 0X13
930 #define SMP_FUNCTION_CONFIGURE_ROUTE_INFORMATION 0X90
931 #define SMP_FUNCTION_PHY_CONTROL 0x91
932 #define SMP_FUNCTION_PHY_TEST 0x92
934 #define SMP_FRAME_TYPE_REQUEST 0x40
935 #define SMP_FRAME_TYPE_RESPONSE 0x41
937 #define PHY_OPERATION_NOP 0x00
938 #define PHY_OPERATION_LINK_RESET 0x01
939 #define PHY_OPERATION_HARD_RESET 0x02
940 #define PHY_OPERATION_DISABLE 0x03
941 #define PHY_OPERATION_CLEAR_ERROR_LOG 0x05
942 #define PHY_OPERATION_CLEAR_AFFILIATION 0x06
944 #define NPLR_PHY_ENABLED_UNK_LINK_RATE 0x00
945 #define NPLR_PHY_DISABLED 0x01
946 #define NPLR_PHY_ENABLED_SPD_NEG_FAILED 0x02
947 #define NPLR_PHY_ENABLED_SATA_HOLD 0x03
948 #define NPLR_PHY_ENABLED_1_5G 0x08
949 #define NPLR_PHY_ENABLED_3_0G 0x09
951 // SMP Function Result values.
952 #define SMP_RESULT_FUNCTION_ACCEPTED 0x00
953 #define SMP_RESULT_UNKNOWN_FUNCTION 0x01
954 #define SMP_RESULT_FUNCTION_FAILED 0x02
955 #define SMP_RESULT_INVALID_REQUEST_FRAME_LEN 0x03
956 #define SMP_RESULT_INAVALID_EXPANDER_CHANGE_COUNT 0x04
957 #define SMP_RESULT_BUSY 0x05
958 #define SMP_RESULT_INCOMPLETE_DESCRIPTOR_LIST 0x06
959 #define SMP_RESULT_PHY_DOES_NOT_EXIST 0x10
960 #define SMP_RESULT_INDEX_DOES_NOT_EXIST 0x11
961 #define SMP_RESULT_PHY_DOES_NOT_SUPPORT_SATA 0x12
962 #define SMP_RESULT_UNKNOWN_PHY_OPERATION 0x13
963 #define SMP_RESULT_UNKNOWN_PHY_TEST_FUNCTION 0x14
964 #define SMP_RESULT_PHY_TEST_IN_PROGRESS 0x15
965 #define SMP_RESULT_PHY_VACANT 0x16
967 /* Attached Device Types */
968 #define SMP_NO_DEVICE_ATTACHED 0
969 #define SMP_END_DEVICE_ONLY 1
970 #define SMP_EDGE_EXPANDER_DEVICE 2
971 #define SMP_FANOUT_EXPANDER_DEVICE 3
973 /* Expander phy routine attribute */
974 #define DIRECT_ROUTING_ATTRIBUTE 0
975 #define SUBTRACTIVE_ROUTING_ATTRIBUTE 1
976 #define TABLE_ROUTING_ATTRIBUTE 2
978 #endif // _INTEL_SAS_H_