]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Scrub EFI_ATA_IDENTIFY_DATA and EFI_ATAPI_IDENTIFY_DATA to strict follow ATA-8 spec...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Jan 2010 05:14:54 +0000 (05:14 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Jan 2010 05:14:54 +0000 (05:14 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9817 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/IndustryStandard/Atapi.h
MdePkg/Include/Protocol/IdeControllerInit.h

index 7a406e114e2724d9a00cb852083e94f5ea98acad..695e5cf25d8fadf2282df5925f074c3419455530 100644 (file)
@@ -2,7 +2,7 @@
   This file contains just some basic definitions that are needed by drivers\r
   that dealing with ATA/ATAPI interface.\r
 \r
-Copyright (c) 2007 - 2009, Intel Corporation\r
+Copyright (c) 2007 - 2010, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,7 +19,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #pragma pack(1)\r
 \r
 ///\r
-/// ATA_IDENTIFY_DATA is defined in ATA-5\r
+/// ATA5_IDENTIFY_DATA is defined in ATA-5\r
+/// (This structure is provided here mainly for backward-compatibility support.\r
+/// Old drivers may reference some field that is marked "obsolete" in \r
+/// ATA_IDENTIFY_DATA, which current conforms to ATA-8) \r
 ///\r
 typedef struct {    \r
   UINT16  config;             ///< General Configuration \r
@@ -71,73 +74,170 @@ typedef struct {
   UINT16  security_status; \r
   UINT16  vendor_data_129_159[31]; \r
   UINT16  reserved_160_255[96]; \r
+} ATA5_IDENTIFY_DATA;\r
+\r
+///\r
+/// ATA_IDENTIFY_DATA is strictly complied with ATA/ATAPI-8 Spec\r
+/// to define the data returned by an ATA device upon successful\r
+/// completion of the ATA IDENTIFY_DEVICE command\r
+///\r
+typedef struct {\r
+  UINT16  config;                                  ///< General Configuration\r
+  UINT16  obsolete_1;\r
+  UINT16  specific_config;                         ///< Specific Configuration\r
+  UINT16  obsolete_3;\r
+  UINT16  retired_4_5[2]; \r
+  UINT16  obsolete_6;\r
+  UINT16  cfa_reserved_7_8[2];\r
+  UINT16  retired_9; \r
+  CHAR8   SerialNo[20];                            ///< word 10~19\r
+  UINT16  retired_20_21[2];  \r
+  UINT16  obsolete_22;    \r
+  CHAR8   FirmwareVer[8];                          ///< word 23~26\r
+  CHAR8   ModelName[40];                           ///< word 27~46\r
+  UINT16  multi_sector_cmd_max_sct_cnt;\r
+  UINT16  trusted_computing_support; \r
+  UINT16  capabilities_49;\r
+  UINT16  capabilities_50;\r
+  UINT16  obsolete_51_52[2];           \r
+  UINT16  field_validity;     \r
+  UINT16  obsolete_54_58[5];     \r
+  UINT16  multi_sector_setting;     \r
+  UINT16  user_addressable_sectors_lo; \r
+  UINT16  user_addressable_sectors_hi; \r
+  UINT16  obsolete_62;     \r
+  UINT16  multi_word_dma_mode;    \r
+  UINT16  advanced_pio_modes; \r
+  UINT16  min_multi_word_dma_cycle_time; \r
+  UINT16  rec_multi_word_dma_cycle_time; \r
+  UINT16  min_pio_cycle_time_without_flow_control; \r
+  UINT16  min_pio_cycle_time_with_flow_control; \r
+  UINT16  reserved_69_74[6]; \r
+  UINT16  queue_depth;     \r
+  UINT16  reserved_76_79[4];                       ///< reserved for Serial ATA\r
+  UINT16  major_version_no; \r
+  UINT16  minor_version_no; \r
+  UINT16  command_set_supported_82;                ///< word 82\r
+  UINT16  command_set_supported_83;                ///< word 83\r
+  UINT16  command_set_feature_extn;                ///< word 84\r
+  UINT16  command_set_feature_enb_85;              ///< word 85\r
+  UINT16  command_set_feature_enb_86;              ///< word 86\r
+  UINT16  command_set_feature_default;             ///< word 87\r
+  UINT16  ultra_dma_mode;                          ///< word 88 \r
+  UINT16  time_for_security_erase_unit; \r
+  UINT16  time_for_enhanced_security_erase_unit;\r
+  UINT16  advanced_power_management_level;\r
+  UINT16  master_password_identifier;\r
+  UINT16  hardware_configuration_test_result;\r
+  UINT16  acoustic_management_value;\r
+  UINT16  stream_minimum_request_size;\r
+  UINT16  streaming_transfer_time_for_dma;\r
+  UINT16  streaming_access_latency_for_dma_and_pio;\r
+  UINT16  streaming_performance_granularity[2];    ///< word 98~99\r
+  UINT16  maximum_lba_for_48bit_addressing[4];     ///< word 100~103\r
+  UINT16  streaming_transfer_time_for_pio;\r
+  UINT16  reserved_105;\r
+  UINT16  phy_logic_sector_support;                ///< word 106\r
+  UINT16  interseek_delay_for_iso7779;\r
+  UINT16  world_wide_name[4];                      ///< word 108~111\r
+  UINT16  reserved_for_128bit_wwn_112_115[4];\r
+  UINT16  reserved_for_technical_report;\r
+  UINT16  logic_sector_size_lo;                    ///< word 117\r
+  UINT16  logic_sector_size_hi;                    ///< word 118\r
+  UINT16  features_and_command_sets_supported_ext; ///< word 119\r
+  UINT16  features_and_command_sets_enabled_ext;   ///< word 120\r
+  UINT16  reserved_121_126[8];\r
+  UINT16  obsolete_127;\r
+  UINT16  security_status;                         ///< word 128\r
+  UINT16  vendor_specific_129_159[31]; \r
+  UINT16  cfa_power_mode;                          ///< word 160\r
+  UINT16  reserved_for_compactflash_161_175[15];\r
+  CHAR8   media_serial_number[60];                 ///< word 176~205\r
+  UINT16  sct_command_transport;                   ///< word 206\r
+  UINT16  reserved_207_208[2];\r
+  UINT16  alignment_logic_in_phy_blocks;           ///< word 209\r
+  UINT16  write_read_verify_sector_count_mode3[2]; ///< word 210~211\r
+  UINT16  verify_sector_count_mode2[2];\r
+  UINT16  nv_cache_capabilities;\r
+  UINT16  nv_cache_size_in_logical_block_lsw;      ///< word 215\r
+  UINT16  nv_cache_size_in_logical_block_msw;      ///< word 216\r
+  UINT16  nv_cache_read_speed;\r
+  UINT16  nv_cache_write_speed;\r
+  UINT16  nv_cache_options;                        ///< word 219\r
+  UINT16  write_read_verify_mode;                  ///< word 220\r
+  UINT16  reserved_221;\r
+  UINT16  transport_major_revision_number;\r
+  UINT16  transport_minor_revision_number;\r
+  UINT16  reserved_224_233[10];\r
+  UINT16  min_number_per_download_microcode_mode3; ///< word 234\r
+  UINT16  max_number_per_download_microcode_mode3; ///< word 235\r
+  UINT16  reserved_236_254[19];\r
+  UINT16  integrity_word;\r
 } ATA_IDENTIFY_DATA;\r
 \r
 ///\r
-/// ATAPI_IDENTIFY_DATA is defined in ATA-6\r
+/// ATAPI_IDENTIFY_DATA is strictly complied with ATA/ATAPI-8 Spec\r
+/// to define the data returned by an ATAPI device upon successful\r
+/// completion of the ATA IDENTIFY_PACKET_DEVICE command\r
 ///\r
 typedef struct {\r
-    UINT16  config;             ///< General Configuration\r
-    UINT16  obsolete_1;\r
-    UINT16  specific_config;\r
-    UINT16  obsolete_3;\r
-    UINT16  retired_4_5[2];\r
-    UINT16  obsolete_6;\r
-    UINT16  cfa_reserved_7_8[2];\r
-    UINT16  retired_9;\r
-    CHAR8   SerialNo[20];       ///< ASCII\r
-    UINT16  retired_20_21[2];\r
-    UINT16  obsolete_22;\r
-    CHAR8   FirmwareVer[8];     ///< ASCII\r
-    CHAR8   ModelName[40];      ///< ASCII\r
-    UINT16  multi_sector_cmd_max_sct_cnt;\r
-    UINT16  reserved_48;\r
-    UINT16  capabilities_49;\r
-    UINT16  capabilities_50;\r
-    UINT16  obsolete_51_52[2];\r
-    UINT16  field_validity;\r
-    UINT16  obsolete_54_58[5];\r
-    UINT16  mutil_sector_setting;\r
-    UINT16  user_addressable_sectors_lo;\r
-    UINT16  user_addressable_sectors_hi;\r
-    UINT16  obsolete_62;\r
-    UINT16  multi_word_dma_mode;\r
-    UINT16  advanced_pio_modes;\r
-    UINT16  min_multi_word_dma_cycle_time;\r
-    UINT16  rec_multi_word_dma_cycle_time;\r
-    UINT16  min_pio_cycle_time_without_flow_control;\r
-    UINT16  min_pio_cycle_time_with_flow_control;\r
-    UINT16  reserved_69_74[6];\r
-    UINT16  queue_depth;\r
-    UINT16  reserved_76_79[4];\r
-    UINT16  major_version_no;\r
-    UINT16  minor_version_no;\r
-    UINT16  cmd_set_support_82;\r
-    UINT16  cmd_set_support_83;\r
-    UINT16  cmd_feature_support;\r
-    UINT16  cmd_feature_enable_85;\r
-    UINT16  cmd_feature_enable_86;\r
-    UINT16  cmd_feature_default;\r
-    UINT16  ultra_dma_select;\r
-    UINT16  time_required_for_sec_erase;\r
-    UINT16  time_required_for_enhanced_sec_erase;\r
-    UINT16  current_advanced_power_mgmt_value;\r
-    UINT16  master_pwd_revison_code;\r
-    UINT16  hardware_reset_result;\r
-    UINT16  current_auto_acoustic_mgmt_value;\r
-    UINT16  reserved_95_99[5];\r
-    UINT16  max_user_lba_for_48bit_addr[4];\r
-    UINT16  reserved_104_126[23];\r
-    UINT16  removable_media_status_notification_support;\r
-    UINT16  security_status;\r
-    UINT16  vendor_data_129_159[31];\r
-    UINT16  cfa_power_mode;\r
-    UINT16  cfa_reserved_161_175[15];\r
-    UINT16  current_media_serial_no[30];\r
-    UINT16  reserved_206_254[49];\r
-    UINT16  integrity_word;\r
+  UINT16  config;                                  ///< General Configuration\r
+  UINT16  reserved_1;\r
+  UINT16  specific_config;                         ///< Specific Configuration\r
+  UINT16  reserved_3_9[7];\r
+  CHAR8   SerialNo[20];                            ///< word 10~19\r
+  UINT16  reserved_20_22[3];\r
+  CHAR8   FirmwareVer[8];                          ///< word 23~26\r
+  CHAR8   ModelName[40];                           ///< word 27~46\r
+  UINT16  reserved_47_48[2];\r
+  UINT16  capabilities_49;\r
+  UINT16  capabilities_50;\r
+  UINT16  obsolete_51;\r
+  UINT16  reserved_52;\r
+  UINT16  field_validity;                          ///< word 53\r
+  UINT16  reserved_54_61[8];\r
+  UINT16  dma_dir;\r
+  UINT16  multi_word_dma_mode;                     ///< word 63\r
+  UINT16  advanced_pio_modes;                      ///< word 64\r
+  UINT16  min_multi_word_dma_cycle_time;\r
+  UINT16  rec_multi_word_dma_cycle_time;\r
+  UINT16  min_pio_cycle_time_without_flow_control;\r
+  UINT16  min_pio_cycle_time_with_flow_control;\r
+  UINT16  reserved_69_70[2];\r
+  UINT16  obsolete_71_72[2];\r
+  UINT16  reserved_73_74[2];\r
+  UINT16  queue_depth;\r
+  UINT16  reserved_76_79[4];\r
+  UINT16  major_version_no;                        ///< word 80\r
+  UINT16  minor_version_no;                        ///< word 81\r
+  UINT16  cmd_set_support_82;\r
+  UINT16  cmd_set_support_83;\r
+  UINT16  cmd_feature_support;\r
+  UINT16  cmd_feature_enable_85;\r
+  UINT16  cmd_feature_enable_86;\r
+  UINT16  cmd_feature_default;\r
+  UINT16  ultra_dma_select;\r
+  UINT16  time_required_for_sec_erase;             ///< word 89\r
+  UINT16  time_required_for_enhanced_sec_erase;    ///< word 90\r
+  UINT16  reserved_91;\r
+  UINT16  master_pwd_revison_code;\r
+  UINT16  hardware_reset_result;                   ///< word 93\r
+  UINT16  current_auto_acoustic_mgmt_value;\r
+  UINT16  reserved_95_107[13];\r
+  UINT16  world_wide_name[4];                      ///< word 108~111\r
+  UINT16  reserved_for_128bit_wwn_112_115[4];\r
+  UINT16  reserved_116_124[9];\r
+  UINT16  atapi_byte_count_0_behavior;             ///< word 125\r
+  UINT16  obsolete_126;\r
+  UINT16  removable_media_status_notification_support;\r
+  UINT16  security_status;\r
+  UINT16  reserved_129_160[32];\r
+  UINT16  cfa_reserved_161_175[15];\r
+  UINT16  reserved_176_254[79];\r
+  UINT16  integrity_word;\r
 } ATAPI_IDENTIFY_DATA;\r
 \r
+\r
 ///\r
 /// Standard Quiry Data format, defined in SFF-8070i(ATAPI Removable Rewritable Specification)\r
 ///\r
index b4c5dcb0dfb21acf917bdf43d51fb52657f4e9cd..92f94ea59e6a6ab1d0629938c0b02cd1797b3d87 100644 (file)
@@ -13,7 +13,7 @@
   \r
   A device handle for an IDE controller must contain an EFI_DEVICE_PATH_PROTOCOL.\r
 \r
-  Copyright (c) 2007 - 2009, Intel Corporation\r
+  Copyright (c) 2007 - 2010, Intel Corporation\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -31,6 +31,8 @@
 #ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_\r
 #define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_\r
 \r
+#include <IndustryStandard/Atapi.h>\r
+\r
 ///\r
 /// Global ID for the EFI_IDE_CONTROLLER_INIT_PROTOCOL\r
 ///\r
@@ -199,147 +201,14 @@ typedef struct {
 } EFI_ATA_COLLECTIVE_MODE;\r
 \r
 ///\r
-/// EFI_ATA_IDENTIFY_DATA structure\r
-///\r
-/// This structure definition is not part of the protocol\r
-/// definition because the ATA/ATAPI Specification controls\r
-/// the definition of all the fields. The ATA/ATAPI\r
-/// Specification can obsolete old fields or redefine existing\r
-/// fields. This definition is provided here for reference only.\r
-///\r
-#pragma pack(1)\r
-typedef struct {\r
-  UINT16  config;                 ///< General Configuration\r
-  UINT16  cylinders;              ///< Number of Cylinders\r
-  UINT16  reserved_2;\r
-  UINT16  heads;                  ///< Number of logical heads\r
-  UINT16  vendor_data1;\r
-  UINT16  vendor_data2;\r
-  UINT16  sectors_per_track;\r
-  UINT16  vendor_specific_7_9[3];\r
-  CHAR8   SerialNo[20];           ///< ASCII\r
-  UINT16  vendor_specific_20_21[2];\r
-  UINT16  ecc_bytes_available;\r
-  CHAR8   FirmwareVer[8];         ///< ASCII\r
-  CHAR8   ModelName[40];          ///< ASCII\r
-  UINT16  multi_sector_cmd_max_sct_cnt;\r
-  UINT16  reserved_48;\r
-  UINT16  capabilities;\r
-  UINT16  reserved_50;\r
-  UINT16  pio_cycle_timing;\r
-  UINT16  reserved_52;\r
-  UINT16  field_validity;\r
-  UINT16  current_cylinders;\r
-  UINT16  current_heads;\r
-  UINT16  current_sectors;\r
-  UINT16  CurrentCapacityLsb;\r
-  UINT16  CurrentCapacityMsb;\r
-  UINT16  reserved_59;\r
-  UINT16  user_addressable_sectors_lo;\r
-  UINT16  user_addressable_sectors_hi;\r
-  UINT16  reserved_62;\r
-  UINT16  multi_word_dma_mode;\r
-  UINT16  advanced_pio_modes;\r
-  UINT16  min_multi_word_dma_cycle_time;\r
-  UINT16  rec_multi_word_dma_cycle_time;\r
-  UINT16  min_pio_cycle_time_without_flow_control;\r
-  UINT16  min_pio_cycle_time_with_flow_control;\r
-  UINT16  reserved_69_79[11];\r
-  UINT16  major_version_no;\r
-  UINT16  minor_version_no;\r
-  UINT16  command_set_supported_82;   ///< word 82\r
-  UINT16  command_set_supported_83;   ///< word 83\r
-  UINT16  command_set_feature_extn;   ///< word 84\r
-  UINT16  command_set_feature_enb_85; ///< word 85\r
-  UINT16  command_set_feature_enb_86; ///< word 86\r
-  UINT16  command_set_feature_default; ///< word 87\r
-  UINT16  ultra_dma_mode;             ///< word 88\r
-  UINT16  reserved_89_105[17];\r
-  UINT16  phy_logic_sector_support;   ///< word 106\r
-  UINT16  reserved_107_116[10];\r
-  UINT16  logic_sector_size_lo;       ///< word 117\r
-  UINT16  logic_sector_size_hi;       ///< word 118\r
-  UINT16  reserved_119_127[9];\r
-  UINT16  security_status;\r
-  UINT16  vendor_data_129_159[31];\r
-  UINT16  reserved_160_208[49];\r
-  UINT16  alignment_logic_in_phy_blocks; ///< word 209\r
-  UINT16  reserved_210_255[46];\r
-} EFI_ATA_IDENTIFY_DATA;\r
-#pragma pack()\r
-\r
-///\r
-/// EFI_ATAPI_IDENTIFY_DATA structure\r
+/// EFI_ATA_IDENTIFY_DATA & EFI_ATAPI_IDENTIFY_DATA structure\r
 ///\r
-/// This structure definition is not part of the protocol\r
-/// definition because the ATA/ATAPI Specification controls\r
-/// the definition of all the fields. The ATA/ATAPI\r
-/// Specification can obsolete old fields or redefine existing\r
-/// fields. This definition is provided here for reference only.\r
-///\r
-#pragma pack(1)\r
-typedef struct {\r
-    UINT16  config;             ///< General Configuration\r
-    UINT16  obsolete_1;\r
-    UINT16  specific_config;\r
-    UINT16  obsolete_3;\r
-    UINT16  retired_4_5[2];\r
-    UINT16  obsolete_6;\r
-    UINT16  cfa_reserved_7_8[2];\r
-    UINT16  retired_9;\r
-    CHAR8   SerialNo[20];       ///< ASCII\r
-    UINT16  retired_20_21[2];\r
-    UINT16  obsolete_22;\r
-    CHAR8   FirmwareVer[8];     ///< ASCII\r
-    CHAR8   ModelName[40];      ///< ASCII\r
-    UINT16  multi_sector_cmd_max_sct_cnt;\r
-    UINT16  reserved_48;\r
-    UINT16  capabilities_49;\r
-    UINT16  capabilities_50;\r
-    UINT16  obsolete_51_52[2];\r
-    UINT16  field_validity;\r
-    UINT16  obsolete_54_58[5];\r
-    UINT16  mutil_sector_setting;\r
-    UINT16  user_addressable_sectors_lo;\r
-    UINT16  user_addressable_sectors_hi;\r
-    UINT16  obsolete_62;\r
-    UINT16  multi_word_dma_mode;\r
-    UINT16  advanced_pio_modes;\r
-    UINT16  min_multi_word_dma_cycle_time;\r
-    UINT16  rec_multi_word_dma_cycle_time;\r
-    UINT16  min_pio_cycle_time_without_flow_control;\r
-    UINT16  min_pio_cycle_time_with_flow_control;\r
-    UINT16  reserved_69_74[6];\r
-    UINT16  queue_depth;\r
-    UINT16  reserved_76_79[4];\r
-    UINT16  major_version_no;\r
-    UINT16  minor_version_no;\r
-    UINT16  cmd_set_support_82;\r
-    UINT16  cmd_set_support_83;\r
-    UINT16  cmd_feature_support;\r
-    UINT16  cmd_feature_enable_85;\r
-    UINT16  cmd_feature_enable_86;\r
-    UINT16  cmd_feature_default;\r
-    UINT16  ultra_dma_select;\r
-    UINT16  time_required_for_sec_erase;\r
-    UINT16  time_required_for_enhanced_sec_erase;\r
-    UINT16  current_advanced_power_mgmt_value;\r
-    UINT16  master_pwd_revison_code;\r
-    UINT16  hardware_reset_result;\r
-    UINT16  current_auto_acoustic_mgmt_value;\r
-    UINT16  reserved_95_99[5];\r
-    UINT16  max_user_lba_for_48bit_addr[4];\r
-    UINT16  reserved_104_126[23];\r
-    UINT16  removable_media_status_notification_support;\r
-    UINT16  security_status;\r
-    UINT16  vendor_data_129_159[31];\r
-    UINT16  cfa_power_mode;\r
-    UINT16  cfa_reserved_161_175[15];\r
-    UINT16  current_media_serial_no[30];\r
-    UINT16  reserved_206_254[49];\r
-    UINT16  integrity_word;\r
-} EFI_ATAPI_IDENTIFY_DATA;\r
-#pragma pack()\r
+/// The definition of these two structures is not part of the protocol\r
+/// definition because the ATA/ATAPI Specification controls the definition\r
+/// of all the fields. The ATA/ATAPI Specification can obsolete old fields\r
+/// or redefine existing fields. \r
+typedef ATA_IDENTIFY_DATA   EFI_ATA_IDENTIFY_DATA;\r
+typedef ATAPI_IDENTIFY_DATA EFI_ATAPI_IDENTIFY_DATA;\r
 \r
 ///\r
 /// This flag indicates whether the IDENTIFY data is a response from an ATA device\r