#include <IOKit/storage/ata/IOATAStorageDefines.h>
IOKit/storage/ata/IOATAStorageDefines.h Kernel.framework
Important word offsets in device identify data as
defined in ATA-5 standard
includes: Kernel/stdint.h
22 enums · 2 typedefs · 1 macro
underlying type unsigned int
| kATAIdentifyConfiguration | 0 | |
| kATAIdentifyLogicalCylinderCount | 1 | |
| kATAIdentifyLogicalHeadCount | 3 | |
| kATAIdentifySectorsPerTrack | 6 | |
| kATAIdentifySerialNumber | 10 | |
| kATAIdentifyFirmwareRevision | 23 | |
| kATAIdentifyModelNumber | 27 | |
| kATAIdentifyMultipleSectorCount | 47 | |
| kATAIdentifyDriveCapabilities | 49 | |
| kATAIdentifyDriveCapabilitiesExtended | 50 | |
| kATAIdentifyPIOTiming | 51 | |
| kATAIdentifyExtendedInfoSupport | 53 | |
| kATAIdentifyCurrentCylinders | 54 | |
| kATAIdentifyCurrentHeads | 55 | |
| kATAIdentifyCurrentSectors | 56 | |
| kATAIdentifyCurrentCapacity | 57 | |
| kATAIdentifyCurrentMultipleSectors | 59 | |
| kATAIdentifyLBACapacity | 60 | |
| kATAIdentifySingleWordDMA | 62 | |
| kATAIdentifyMultiWordDMA | 63 | |
| kATAIdentifyAdvancedPIOModes | 64 | |
| kATAIdentifyMinMultiWordDMATime | 65 | |
| kATAIdentifyRecommendedMultiWordDMATime | 66 | |
| kATAIdentifyMinPIOTime | 67 | |
| kATAIdentifyMinPIOTimeWithIORDY | 68 | |
| kATAIdentifyQueueDepth | 75 | |
| kATAIdentifyMajorVersion | 80 | |
| kATAIdentifyMinorVersion | 81 | |
| kATAIdentifyCommandSetSupported | 82 | |
| kATAIdentifyCommandSetSupported2 | 83 | |
| kATAIdentifyCommandExtension1 | 84 | |
| kATAIdentifyCommandExtension2 | 85 | |
| kATAIdentifyCommandsEnabled | 86 | |
| kATAIdentifyCommandsDefault | 87 | |
| kATAIdentifyUltraDMASupported | 88 | |
| kATAIdentifyPhysicalLogicalSectorSize | 106 | |
| kATAIdentifyWordsPerLogicalSector1 | 117 | |
| kATAIdentifyWordsPerLogicalSector2 | 118 | |
| kATAIdentifyLogicalSectorAlignment | 209 | |
| kATAIdentifyIntegrity | 255 | |
underlying type unsigned int
| kFixedDeviceBit | 6 | Configuration field (word 0) Fixed disk indicator bit |
| kRemoveableMediaBit | 7 | Removable media indicator bit |
| kNonMagneticDriveBit | 15 | Non-magnetic drive indicator bit |
| kFixedDeviceMask | 64 | Mask for fixed disk indicator |
| kRemoveableMediaMask | 128 | Mask for removable media indicator |
| kNonMagneticDriveMask | 32768 | Mask for non-magnetic drive indicator |
| kDMABit | 8 | Capabilities field (word 49) DMA supported bit |
| kLBABit | 9 | LBA supported bit |
| kIORDYDisableBit | 10 | IORDY can be disabled bit |
| kIORDYBit | 11 | IORDY supported bit |
| kStandbyTimerBit | 13 | Standby timer supported bit |
| kDMASupportedMask | 256 | Mask for DMA supported |
| kLBASupportedMask | 512 | Mask for LBA supported |
| kDMADisableMask | 1024 | Mask for DMA supported |
| kIORDYSupportedMask | 2048 | Mask for IORDY supported |
| kStandbySupportedMask | 8192 | Mask for Standby Timer supported |
| kCurFieldsValidBit | 0 | Extensions field (word 53) Bit to show words 54-58 are valid |
| kExtFieldsValidBit | 1 | Bit to show words 64-70 are valid |
| kCurFieldsValidMask | 1 | Mask for current fields valid |
| kExtFieldsValidMask | 2 | Extension word valid |
| kMode3Bit | 0 | Advanced PIO Transfer Modes field (word 64) Bit to indicate mode 3 is supported |
| kMode3Mask | 1 | Mask for mode 3 support |
| kChecksumValidCookie | 165 | Integrity of Identify data (word 255) Bits 7:0 if device supports feature |
String size constants
underlying type unsigned int
| kSizeOfATAModelString | 40 | |
| kSizeOfATARevisionString | 8 | |
ATA Command timeout constants ( in milliseconds )
underlying type unsigned int
| kATATimeout10Seconds | 10000 | |
| kATATimeout30Seconds | 30000 | |
| kATATimeout45Seconds | 45000 | |
| kATATimeout1Minute | 60000 | |
| kATADefaultTimeout | 30000 | |
Retry constants
underlying type unsigned int
| kATAZeroRetries | 0 | |
| kATADefaultRetries | 4 | |
max number of blocks supported in ATA transaction
underlying type unsigned int
| kIOATASectorCount8Bit | 8 | |
| kIOATASectorCount16Bit | 16 | |
underlying type unsigned int
| kIOATAMaximumBlockCount8Bit | 256 | |
| kIOATAMaximumBlockCount16Bit | 65536 | |
| kIOATAMaxBlocksPerXfer | 256 | For backwards compatibility |
Power Management time constants (in seconds)
underlying type unsigned int
| kSecondsInAMinute | 60 | |
| k5Minutes | 300 | |
Bits for features published in Word 82 of device identify data
underlying type unsigned int
| kATASupportsSMARTBit | 0 | |
| kATASupportsPowerManagementBit | 3 | |
| kATASupportsWriteCacheBit | 5 | |
Masks for features published in Word 82 of device identify data
underlying type unsigned int
| kATASupportsSMARTMask | 1 | |
| kATASupportsPowerManagementMask | 8 | |
| kATASupportsWriteCacheMask | 32 | |
Bits for features published in Word 83 of device identify data
underlying type unsigned int
| kATASupportsCompactFlashBit | 2 | |
| kATASupportsAdvancedPowerManagementBit | 3 | |
| kATASupports48BitAddressingBit | 10 | |
| kATASupportsFlushCacheBit | 12 | |
| kATASupportsFlushCacheExtendedBit | 13 | |
Masks for features published in Word 83 of device identify data
underlying type unsigned int
| kATASupportsCompactFlashMask | 4 | |
| kATASupportsAdvancedPowerManagementMask | 8 | |
| kATASupports48BitAddressingMask | 1024 | |
| kATASupportsFlushCacheMask | 4096 | |
| kATASupportsFlushCacheExtendedMask | 8192 | |
| kIdentifyWordValidationMask | 49152 | Mask to ensure data is valid |
| kIdentifyWordValid | 16384 | |
Bits for features published in Word 84 of device identify data
underlying type unsigned int
| kATAForceUnitAccessFeatureBit | 6 | |
Masks for features published in Word 84 of device identify data
underlying type unsigned int
| kATAForceUnitAccessFeatureMask | 64 | |
Bits for features published in Word 85 of device identify data
underlying type unsigned int
| kATAWriteCacheEnabledBit | 5 | |
Masks for features published in Word 85 of device identify data
underlying type unsigned int
| kATAWriteCacheEnabledMask | 32 | |
Bits for features published in Word 106 of device identify data
underlying type unsigned int
| kATAPhysicalLogicalEnabledBit0 | 15 | |
| kATAPhysicalLogicalEnabledBit1 | 14 | |
| kATAMultipleLogicalSectorsBit | 13 | |
| kATAValidLogicalSectorSizeBit | 12 | |
Masks for features published in Word 106 of device identify data
underlying type unsigned int
| kATAPhysicalLogicalEnabledMask | 49152 | |
| kATAPhysicalLogicalEnabledValue | 16384 | |
| kATAMultipleLogicalSectorsMask | 8192 | |
| kATAValidLogicalSectorSizeMask | 4096 | |
| kATAPhysicalSectorSizeMask | 15 | |
| kATALogicalSectorAlignmentMask | 16383 | |
Property table keys
#define kIOATASupportedFeaturesKey "ATA Features"
ATA supported features
underlying type unsigned int
| kIOATAFeaturePowerManagement | 1 | OBSOLETE |
| kIOATAFeatureWriteCache | 2 | OBSOLETE |
| kIOATAFeatureAdvancedPowerManagement | 4 | |
| kIOATAFeatureCompactFlash | 8 | |
| kIOATAFeature48BitLBA | 16 | |
| kIOATAFeatureSMART | 32 | |
ATA Advanced Power Management settings (valid settings range from 1-254),
the settings below are the more common settings
underlying type unsigned int
| kIOATAMaxPerformance | 254 | |
| kIOATADefaultPerformance | 128 | |
| kIOATAMaxPowerSavings | 1 | |
ATA Transfer Mode bit masks
underlying type unsigned int
| kATAEnableUltraDMAModeMask | 64 | |
| kATAEnableMultiWordDMAModeMask | 32 | |
| kATAEnablePIOModeMask | 8 | |
typedef uint32_t ATAOperationType
underlying type unsigned int
| kATAOperationTypeRead | 0 | |
| kATAOperationTypeWrite | 1 | |
| kATAOperationTypeFlushCache | 2 | |
| kATAOperationTypeSMART | 3 | |
| kATAOperationTypeConfiguration | 4 | |
| kATAOperationTypePowerManagement | 5 | |
| kATAOperationTypeSMS | 6 | |
typedef struct __ATAIORequest * ATARequestIdentifier