ata.h 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _NTATA_
  7. #define _NTATA_
  8. #pragma pack(push,1)
  9. typedef struct _IDENTIFY_DEVICE_DATA {
  10. struct {
  11. USHORT Reserved1 : 1;
  12. USHORT Retired3 : 1;
  13. USHORT ResponseIncomplete : 1;
  14. USHORT Retired2 : 3;
  15. USHORT FixedDevice : 1;
  16. USHORT RemovableMedia : 1;
  17. USHORT Retired1 : 7;
  18. USHORT DeviceType : 1;
  19. } GeneralConfiguration;
  20. USHORT NumCylinders;
  21. USHORT SpecificConfiguration;
  22. USHORT NumHeads;
  23. USHORT Retired1[2];
  24. USHORT NumSectorsPerTrack;
  25. USHORT VendorUnique1[3];
  26. UCHAR SerialNumber[20];
  27. USHORT Retired2[2];
  28. USHORT Obsolete1;
  29. UCHAR FirmwareRevision[8];
  30. UCHAR ModelNumber[40];
  31. UCHAR MaximumBlockTransfer;
  32. UCHAR VendorUnique2;
  33. struct {
  34. USHORT FeatureSupported : 1;
  35. USHORT Reserved : 15;
  36. } TrustedComputing;
  37. struct {
  38. UCHAR CurrentLongPhysicalSectorAlignment : 2;
  39. UCHAR ReservedByte49 : 6;
  40. UCHAR DmaSupported : 1;
  41. UCHAR LbaSupported : 1;
  42. UCHAR IordyDisable : 1;
  43. UCHAR IordySupported : 1;
  44. UCHAR Reserved1 : 1;
  45. UCHAR StandybyTimerSupport : 1;
  46. UCHAR Reserved2 : 2;
  47. USHORT ReservedWord50;
  48. } Capabilities;
  49. USHORT ObsoleteWords51[2];
  50. USHORT TranslationFieldsValid : 3;
  51. USHORT Reserved3 : 5;
  52. USHORT FreeFallControlSensitivity : 8;
  53. USHORT NumberOfCurrentCylinders;
  54. USHORT NumberOfCurrentHeads;
  55. USHORT CurrentSectorsPerTrack;
  56. ULONG CurrentSectorCapacity;
  57. UCHAR CurrentMultiSectorSetting;
  58. UCHAR MultiSectorSettingValid : 1;
  59. UCHAR ReservedByte59 : 3;
  60. UCHAR SanitizeFeatureSupported : 1;
  61. UCHAR CryptoScrambleExtCommandSupported : 1;
  62. UCHAR OverwriteExtCommandSupported : 1;
  63. UCHAR BlockEraseExtCommandSupported : 1;
  64. ULONG UserAddressableSectors;
  65. USHORT ObsoleteWord62;
  66. USHORT MultiWordDMASupport : 8;
  67. USHORT MultiWordDMAActive : 8;
  68. USHORT AdvancedPIOModes : 8;
  69. USHORT ReservedByte64 : 8;
  70. USHORT MinimumMWXferCycleTime;
  71. USHORT RecommendedMWXferCycleTime;
  72. USHORT MinimumPIOCycleTime;
  73. USHORT MinimumPIOCycleTimeIORDY;
  74. struct {
  75. USHORT ZonedCapabilities : 2;
  76. USHORT NonVolatileWriteCache : 1;
  77. USHORT ExtendedUserAddressableSectorsSupported : 1;
  78. USHORT DeviceEncryptsAllUserData : 1;
  79. USHORT ReadZeroAfterTrimSupported : 1;
  80. USHORT Optional28BitCommandsSupported : 1;
  81. USHORT IEEE1667 : 1;
  82. USHORT DownloadMicrocodeDmaSupported : 1;
  83. USHORT SetMaxSetPasswordUnlockDmaSupported : 1;
  84. USHORT WriteBufferDmaSupported : 1;
  85. USHORT ReadBufferDmaSupported : 1;
  86. USHORT DeviceConfigIdentifySetDmaSupported : 1;
  87. USHORT LPSAERCSupported : 1;
  88. USHORT DeterministicReadAfterTrimSupported : 1;
  89. USHORT CFastSpecSupported : 1;
  90. } AdditionalSupported;
  91. USHORT ReservedWords70[5];
  92. USHORT QueueDepth : 5;
  93. USHORT ReservedWord75 : 11;
  94. struct {
  95. USHORT Reserved0 : 1;
  96. USHORT SataGen1 : 1;
  97. USHORT SataGen2 : 1;
  98. USHORT SataGen3 : 1;
  99. USHORT Reserved1 : 4;
  100. USHORT NCQ : 1;
  101. USHORT HIPM : 1;
  102. USHORT PhyEvents : 1;
  103. USHORT NcqUnload : 1;
  104. USHORT NcqPriority : 1;
  105. USHORT HostAutoPS : 1;
  106. USHORT DeviceAutoPS : 1;
  107. USHORT ReadLogDMA : 1;
  108. USHORT Reserved2 : 1;
  109. USHORT CurrentSpeed : 3;
  110. USHORT NcqStreaming : 1;
  111. USHORT NcqQueueMgmt : 1;
  112. USHORT NcqReceiveSend : 1;
  113. USHORT DEVSLPtoReducedPwrState : 1;
  114. USHORT Reserved3 : 8;
  115. } SerialAtaCapabilities;
  116. struct {
  117. USHORT Reserved0 : 1;
  118. USHORT NonZeroOffsets : 1;
  119. USHORT DmaSetupAutoActivate : 1;
  120. USHORT DIPM : 1;
  121. USHORT InOrderData : 1;
  122. USHORT HardwareFeatureControl : 1;
  123. USHORT SoftwareSettingsPreservation : 1;
  124. USHORT NCQAutosense : 1;
  125. USHORT DEVSLP : 1;
  126. USHORT HybridInformation : 1;
  127. USHORT Reserved1 : 6;
  128. } SerialAtaFeaturesSupported;
  129. struct {
  130. USHORT Reserved0 : 1;
  131. USHORT NonZeroOffsets : 1;
  132. USHORT DmaSetupAutoActivate : 1;
  133. USHORT DIPM : 1;
  134. USHORT InOrderData : 1;
  135. USHORT HardwareFeatureControl : 1;
  136. USHORT SoftwareSettingsPreservation : 1;
  137. USHORT DeviceAutoPS : 1;
  138. USHORT DEVSLP : 1;
  139. USHORT HybridInformation : 1;
  140. USHORT Reserved1 : 6;
  141. } SerialAtaFeaturesEnabled;
  142. USHORT MajorRevision;
  143. USHORT MinorRevision;
  144. struct {
  145. USHORT SmartCommands : 1;
  146. USHORT SecurityMode : 1;
  147. USHORT RemovableMediaFeature : 1;
  148. USHORT PowerManagement : 1;
  149. USHORT Reserved1 : 1;
  150. USHORT WriteCache : 1;
  151. USHORT LookAhead : 1;
  152. USHORT ReleaseInterrupt : 1;
  153. USHORT ServiceInterrupt : 1;
  154. USHORT DeviceReset : 1;
  155. USHORT HostProtectedArea : 1;
  156. USHORT Obsolete1 : 1;
  157. USHORT WriteBuffer : 1;
  158. USHORT ReadBuffer : 1;
  159. USHORT Nop : 1;
  160. USHORT Obsolete2 : 1;
  161. USHORT DownloadMicrocode : 1;
  162. USHORT DmaQueued : 1;
  163. USHORT Cfa : 1;
  164. USHORT AdvancedPm : 1;
  165. USHORT Msn : 1;
  166. USHORT PowerUpInStandby : 1;
  167. USHORT ManualPowerUp : 1;
  168. USHORT Reserved2 : 1;
  169. USHORT SetMax : 1;
  170. USHORT Acoustics : 1;
  171. USHORT BigLba : 1;
  172. USHORT DeviceConfigOverlay : 1;
  173. USHORT FlushCache : 1;
  174. USHORT FlushCacheExt : 1;
  175. USHORT WordValid83 : 2;
  176. USHORT SmartErrorLog : 1;
  177. USHORT SmartSelfTest : 1;
  178. USHORT MediaSerialNumber : 1;
  179. USHORT MediaCardPassThrough : 1;
  180. USHORT StreamingFeature : 1;
  181. USHORT GpLogging : 1;
  182. USHORT WriteFua : 1;
  183. USHORT WriteQueuedFua : 1;
  184. USHORT WWN64Bit : 1;
  185. USHORT URGReadStream : 1;
  186. USHORT URGWriteStream : 1;
  187. USHORT ReservedForTechReport : 2;
  188. USHORT IdleWithUnloadFeature : 1;
  189. USHORT WordValid : 2;
  190. } CommandSetSupport;
  191. struct {
  192. USHORT SmartCommands : 1;
  193. USHORT SecurityMode : 1;
  194. USHORT RemovableMediaFeature : 1;
  195. USHORT PowerManagement : 1;
  196. USHORT Reserved1 : 1;
  197. USHORT WriteCache : 1;
  198. USHORT LookAhead : 1;
  199. USHORT ReleaseInterrupt : 1;
  200. USHORT ServiceInterrupt : 1;
  201. USHORT DeviceReset : 1;
  202. USHORT HostProtectedArea : 1;
  203. USHORT Obsolete1 : 1;
  204. USHORT WriteBuffer : 1;
  205. USHORT ReadBuffer : 1;
  206. USHORT Nop : 1;
  207. USHORT Obsolete2 : 1;
  208. USHORT DownloadMicrocode : 1;
  209. USHORT DmaQueued : 1;
  210. USHORT Cfa : 1;
  211. USHORT AdvancedPm : 1;
  212. USHORT Msn : 1;
  213. USHORT PowerUpInStandby : 1;
  214. USHORT ManualPowerUp : 1;
  215. USHORT Reserved2 : 1;
  216. USHORT SetMax : 1;
  217. USHORT Acoustics : 1;
  218. USHORT BigLba : 1;
  219. USHORT DeviceConfigOverlay : 1;
  220. USHORT FlushCache : 1;
  221. USHORT FlushCacheExt : 1;
  222. USHORT Resrved3 : 1;
  223. USHORT Words119_120Valid : 1;
  224. USHORT SmartErrorLog : 1;
  225. USHORT SmartSelfTest : 1;
  226. USHORT MediaSerialNumber : 1;
  227. USHORT MediaCardPassThrough : 1;
  228. USHORT StreamingFeature : 1;
  229. USHORT GpLogging : 1;
  230. USHORT WriteFua : 1;
  231. USHORT WriteQueuedFua : 1;
  232. USHORT WWN64Bit : 1;
  233. USHORT URGReadStream : 1;
  234. USHORT URGWriteStream : 1;
  235. USHORT ReservedForTechReport : 2;
  236. USHORT IdleWithUnloadFeature : 1;
  237. USHORT Reserved4 : 2;
  238. } CommandSetActive;
  239. USHORT UltraDMASupport : 8;
  240. USHORT UltraDMAActive : 8;
  241. struct {
  242. USHORT TimeRequired : 15;
  243. USHORT ExtendedTimeReported : 1;
  244. } NormalSecurityEraseUnit;
  245. struct {
  246. USHORT TimeRequired : 15;
  247. USHORT ExtendedTimeReported : 1;
  248. } EnhancedSecurityEraseUnit;
  249. USHORT CurrentAPMLevel : 8;
  250. USHORT ReservedWord91 : 8;
  251. USHORT MasterPasswordID;
  252. USHORT HardwareResetResult;
  253. USHORT CurrentAcousticValue : 8;
  254. USHORT RecommendedAcousticValue : 8;
  255. USHORT StreamMinRequestSize;
  256. USHORT StreamingTransferTimeDMA;
  257. USHORT StreamingAccessLatencyDMAPIO;
  258. ULONG StreamingPerfGranularity;
  259. ULONG Max48BitLBA[2];
  260. USHORT StreamingTransferTime;
  261. USHORT DsmCap;
  262. struct {
  263. USHORT LogicalSectorsPerPhysicalSector : 4;
  264. USHORT Reserved0 : 8;
  265. USHORT LogicalSectorLongerThan256Words : 1;
  266. USHORT MultipleLogicalSectorsPerPhysicalSector : 1;
  267. USHORT Reserved1 : 2;
  268. } PhysicalLogicalSectorSize;
  269. USHORT InterSeekDelay;
  270. USHORT WorldWideName[4];
  271. USHORT ReservedForWorldWideName128[4];
  272. USHORT ReservedForTlcTechnicalReport;
  273. USHORT WordsPerLogicalSector[2];
  274. struct {
  275. USHORT ReservedForDrqTechnicalReport : 1;
  276. USHORT WriteReadVerify : 1;
  277. USHORT WriteUncorrectableExt : 1;
  278. USHORT ReadWriteLogDmaExt : 1;
  279. USHORT DownloadMicrocodeMode3 : 1;
  280. USHORT FreefallControl : 1;
  281. USHORT SenseDataReporting : 1;
  282. USHORT ExtendedPowerConditions : 1;
  283. USHORT Reserved0 : 6;
  284. USHORT WordValid : 2;
  285. } CommandSetSupportExt;
  286. struct {
  287. USHORT ReservedForDrqTechnicalReport : 1;
  288. USHORT WriteReadVerify : 1;
  289. USHORT WriteUncorrectableExt : 1;
  290. USHORT ReadWriteLogDmaExt : 1;
  291. USHORT DownloadMicrocodeMode3 : 1;
  292. USHORT FreefallControl : 1;
  293. USHORT SenseDataReporting : 1;
  294. USHORT ExtendedPowerConditions : 1;
  295. USHORT Reserved0 : 6;
  296. USHORT Reserved1 : 2;
  297. } CommandSetActiveExt;
  298. USHORT ReservedForExpandedSupportandActive[6];
  299. USHORT MsnSupport : 2;
  300. USHORT ReservedWord127 : 14;
  301. struct {
  302. USHORT SecuritySupported : 1;
  303. USHORT SecurityEnabled : 1;
  304. USHORT SecurityLocked : 1;
  305. USHORT SecurityFrozen : 1;
  306. USHORT SecurityCountExpired : 1;
  307. USHORT EnhancedSecurityEraseSupported : 1;
  308. USHORT Reserved0 : 2;
  309. USHORT SecurityLevel : 1;
  310. USHORT Reserved1 : 7;
  311. } SecurityStatus;
  312. USHORT ReservedWord129[31];
  313. struct {
  314. USHORT MaximumCurrentInMA : 12;
  315. USHORT CfaPowerMode1Disabled : 1;
  316. USHORT CfaPowerMode1Required : 1;
  317. USHORT Reserved0 : 1;
  318. USHORT Word160Supported : 1;
  319. } CfaPowerMode1;
  320. USHORT ReservedForCfaWord161[7];
  321. USHORT NominalFormFactor : 4;
  322. USHORT ReservedWord168 : 12;
  323. struct {
  324. USHORT SupportsTrim : 1;
  325. USHORT Reserved0 : 15;
  326. } DataSetManagementFeature;
  327. USHORT AdditionalProductID[4];
  328. USHORT ReservedForCfaWord174[2];
  329. USHORT CurrentMediaSerialNumber[30];
  330. struct {
  331. USHORT Supported : 1;
  332. USHORT Reserved0 : 1;
  333. USHORT WriteSameSuported : 1;
  334. USHORT ErrorRecoveryControlSupported : 1;
  335. USHORT FeatureControlSuported : 1;
  336. USHORT DataTablesSuported : 1;
  337. USHORT Reserved1 : 6;
  338. USHORT VendorSpecific : 4;
  339. } SCTCommandTransport;
  340. USHORT ReservedWord207[2];
  341. struct {
  342. USHORT AlignmentOfLogicalWithinPhysical : 14;
  343. USHORT Word209Supported : 1;
  344. USHORT Reserved0 : 1;
  345. } BlockAlignment;
  346. USHORT WriteReadVerifySectorCountMode3Only[2];
  347. USHORT WriteReadVerifySectorCountMode2Only[2];
  348. struct {
  349. USHORT NVCachePowerModeEnabled : 1;
  350. USHORT Reserved0 : 3;
  351. USHORT NVCacheFeatureSetEnabled : 1;
  352. USHORT Reserved1 : 3;
  353. USHORT NVCachePowerModeVersion : 4;
  354. USHORT NVCacheFeatureSetVersion : 4;
  355. } NVCacheCapabilities;
  356. USHORT NVCacheSizeLSW;
  357. USHORT NVCacheSizeMSW;
  358. USHORT NominalMediaRotationRate;
  359. USHORT ReservedWord218;
  360. struct {
  361. UCHAR NVCacheEstimatedTimeToSpinUpInSeconds;
  362. UCHAR Reserved;
  363. } NVCacheOptions;
  364. USHORT WriteReadVerifySectorCountMode : 8;
  365. USHORT ReservedWord220 : 8;
  366. USHORT ReservedWord221;
  367. struct {
  368. USHORT MajorVersion : 12;
  369. USHORT TransportType : 4;
  370. } TransportMajorVersion;
  371. USHORT TransportMinorVersion;
  372. USHORT ReservedWord224[6];
  373. ULONG ExtendedNumberOfUserAddressableSectors[2];
  374. USHORT MinBlocksPerDownloadMicrocodeMode03;
  375. USHORT MaxBlocksPerDownloadMicrocodeMode03;
  376. USHORT ReservedWord236[19];
  377. USHORT Signature : 8;
  378. USHORT CheckSum : 8;
  379. } IDENTIFY_DEVICE_DATA, *PIDENTIFY_DEVICE_DATA;
  380. typedef struct _IDENTIFY_PACKET_DATA {
  381. struct {
  382. USHORT PacketType : 2;
  383. USHORT IncompleteResponse : 1;
  384. USHORT Reserved1 : 2;
  385. USHORT DrqDelay : 2;
  386. USHORT RemovableMedia : 1;
  387. USHORT CommandPacketType : 5;
  388. USHORT Reserved2 : 1;
  389. USHORT DeviceType : 2;
  390. } GeneralConfiguration;
  391. USHORT ResevedWord1;
  392. USHORT UniqueConfiguration;
  393. USHORT ReservedWords3[7];
  394. UCHAR SerialNumber[20];
  395. USHORT ReservedWords20[3];
  396. UCHAR FirmwareRevision[8];
  397. UCHAR ModelNumber[40];
  398. USHORT ReservedWords47[2];
  399. struct {
  400. USHORT VendorSpecific : 8;
  401. USHORT DmaSupported : 1;
  402. USHORT LbaSupported : 1;
  403. USHORT IordyDisabled : 1;
  404. USHORT IordySupported : 1;
  405. USHORT Obsolete : 1;
  406. USHORT OverlapSupported : 1;
  407. USHORT QueuedCommandsSupported : 1;
  408. USHORT InterleavedDmaSupported : 1;
  409. USHORT DeviceSpecificStandbyTimerValueMin : 1;
  410. USHORT Obsolete1 : 1;
  411. USHORT ReservedWord50 : 12;
  412. USHORT WordValid : 2;
  413. } Capabilities;
  414. USHORT ObsoleteWords51[2];
  415. USHORT TranslationFieldsValid : 3;
  416. USHORT Reserved3 : 13;
  417. USHORT ReservedWords54[8];
  418. struct {
  419. USHORT UDMA0Supported : 1;
  420. USHORT UDMA1Supported : 1;
  421. USHORT UDMA2Supported : 1;
  422. USHORT UDMA3Supported : 1;
  423. USHORT UDMA4Supported : 1;
  424. USHORT UDMA5Supported : 1;
  425. USHORT UDMA6Supported : 1;
  426. USHORT MDMA0Supported : 1;
  427. USHORT MDMA1Supported : 1;
  428. USHORT MDMA2Supported : 1;
  429. USHORT DMASupported : 1;
  430. USHORT ReservedWord62 : 4;
  431. USHORT DMADIRBitRequired : 1;
  432. } DMADIR;
  433. USHORT MultiWordDMASupport : 8;
  434. USHORT MultiWordDMAActive : 8;
  435. USHORT AdvancedPIOModes : 8;
  436. USHORT ReservedByte64 : 8;
  437. USHORT MinimumMWXferCycleTime;
  438. USHORT RecommendedMWXferCycleTime;
  439. USHORT MinimumPIOCycleTime;
  440. USHORT MinimumPIOCycleTimeIORDY;
  441. USHORT ReservedWords69[2];
  442. USHORT BusReleaseDelay;
  443. USHORT ServiceCommandDelay;
  444. USHORT ReservedWords73[2];
  445. USHORT QueueDepth : 5;
  446. USHORT ReservedWord75 : 11;
  447. struct {
  448. USHORT Reserved0 : 1;
  449. USHORT SataGen1 : 1;
  450. USHORT SataGen2 : 1;
  451. USHORT SataGen3 : 1;
  452. USHORT Reserved1 : 5;
  453. USHORT HIPM : 1;
  454. USHORT PhyEvents : 1;
  455. USHORT Reserved3 : 2;
  456. USHORT HostAutoPS : 1;
  457. USHORT DeviceAutoPS : 1;
  458. USHORT Reserved4 : 1;
  459. USHORT Reserved5 : 1;
  460. USHORT CurrentSpeed : 3;
  461. USHORT SlimlineDeviceAttention : 1;
  462. USHORT HostEnvironmentDetect : 1;
  463. USHORT Reserved : 10;
  464. } SerialAtaCapabilities;
  465. struct {
  466. USHORT Reserved0 : 1;
  467. USHORT Reserved1 : 2;
  468. USHORT DIPM : 1;
  469. USHORT Reserved2 : 1;
  470. USHORT AsynchronousNotification : 1;
  471. USHORT SoftwareSettingsPreservation : 1;
  472. USHORT Reserved3 : 9;
  473. } SerialAtaFeaturesSupported;
  474. struct {
  475. USHORT Reserved0 : 1;
  476. USHORT Reserved1 : 2;
  477. USHORT DIPM : 1;
  478. USHORT Reserved2 : 1;
  479. USHORT AsynchronousNotification : 1;
  480. USHORT SoftwareSettingsPreservation : 1;
  481. USHORT DeviceAutoPS : 1;
  482. USHORT Reserved3 : 8;
  483. } SerialAtaFeaturesEnabled;
  484. USHORT MajorRevision;
  485. USHORT MinorRevision;
  486. struct {
  487. USHORT SmartCommands : 1;
  488. USHORT SecurityMode : 1;
  489. USHORT RemovableMedia : 1;
  490. USHORT PowerManagement : 1;
  491. USHORT PacketCommands : 1;
  492. USHORT WriteCache : 1;
  493. USHORT LookAhead : 1;
  494. USHORT ReleaseInterrupt : 1;
  495. USHORT ServiceInterrupt : 1;
  496. USHORT DeviceReset : 1;
  497. USHORT HostProtectedArea : 1;
  498. USHORT Obsolete1 : 1;
  499. USHORT WriteBuffer : 1;
  500. USHORT ReadBuffer : 1;
  501. USHORT Nop : 1;
  502. USHORT Obsolete2 : 1;
  503. USHORT DownloadMicrocode : 1;
  504. USHORT Reserved1 : 2;
  505. USHORT AdvancedPm : 1;
  506. USHORT Msn : 1;
  507. USHORT PowerUpInStandby : 1;
  508. USHORT ManualPowerUp : 1;
  509. USHORT Reserved2 : 1;
  510. USHORT SetMax : 1;
  511. USHORT Reserved3 : 3;
  512. USHORT FlushCache : 1;
  513. USHORT Reserved4 : 1;
  514. USHORT WordValid : 2;
  515. } CommandSetSupport;
  516. struct {
  517. USHORT Reserved0 : 5;
  518. USHORT GpLogging : 1;
  519. USHORT Reserved1 : 2;
  520. USHORT WWN64Bit : 1;
  521. USHORT Reserved2 : 5;
  522. USHORT WordValid : 2;
  523. } CommandSetSupportExt;
  524. struct {
  525. USHORT SmartCommands : 1;
  526. USHORT SecurityMode : 1;
  527. USHORT RemovableMedia : 1;
  528. USHORT PowerManagement : 1;
  529. USHORT PacketCommands : 1;
  530. USHORT WriteCache : 1;
  531. USHORT LookAhead : 1;
  532. USHORT ReleaseInterrupt : 1;
  533. USHORT ServiceInterrupt : 1;
  534. USHORT DeviceReset : 1;
  535. USHORT HostProtectedArea : 1;
  536. USHORT Obsolete1 : 1;
  537. USHORT WriteBuffer : 1;
  538. USHORT ReadBuffer : 1;
  539. USHORT Nop : 1;
  540. USHORT Obsolete2 : 1;
  541. USHORT DownloadMicrocode : 1;
  542. USHORT Reserved1 : 2;
  543. USHORT AdvancedPm : 1;
  544. USHORT Msn : 1;
  545. USHORT PowerUpInStandby : 1;
  546. USHORT ManualPowerUp : 1;
  547. USHORT Reserved2 : 1;
  548. USHORT SetMax : 1;
  549. USHORT Reserved3 : 3;
  550. USHORT FlushCache : 1;
  551. USHORT Reserved : 3;
  552. } CommandSetActive;
  553. struct {
  554. USHORT Reserved0 : 5;
  555. USHORT GpLogging : 1;
  556. USHORT Reserved1 : 2;
  557. USHORT WWN64Bit : 1;
  558. USHORT Reserved2 : 5;
  559. USHORT WordValid : 2;
  560. } CommandSetActiveExt;
  561. USHORT UltraDMASupport : 8;
  562. USHORT UltraDMAActive : 8;
  563. USHORT TimeRequiredForNormalEraseModeSecurityEraseUnit;
  564. USHORT TimeRequiredForEnhancedEraseModeSecurityEraseUnit;
  565. USHORT CurrentAPMLevel;
  566. USHORT MasterPasswordID;
  567. USHORT HardwareResetResult;
  568. USHORT ReservedWords94[14];
  569. USHORT WorldWideName[4];
  570. USHORT ReservedWords112[13];
  571. USHORT AtapiZeroByteCount;
  572. USHORT ReservedWord126;
  573. USHORT MsnSupport : 2;
  574. USHORT ReservedWord127 : 14;
  575. USHORT SecurityStatus;
  576. USHORT VendorSpecific[31];
  577. USHORT ReservedWord160[16];
  578. USHORT ReservedWord176[46];
  579. struct {
  580. USHORT MajorVersion : 12;
  581. USHORT TransportType : 4;
  582. } TransportMajorVersion;
  583. USHORT TransportMinorVersion;
  584. USHORT ReservedWord224[31];
  585. USHORT Signature : 8;
  586. USHORT CheckSum : 8;
  587. } IDENTIFY_PACKET_DATA, *PIDENTIFY_PACKET_DATA;
  588. typedef struct _REGISTER_FIS {
  589. UCHAR FisType;
  590. UCHAR Reserved0 : 7;
  591. UCHAR CmdReg : 1;
  592. UCHAR Command;
  593. UCHAR Features;
  594. UCHAR SectorNumber;
  595. UCHAR CylinderLow;
  596. UCHAR CylinderHigh;
  597. UCHAR DeviceHead;
  598. UCHAR SectorNumberExp;
  599. UCHAR CylinderLowExp;
  600. UCHAR CylinderHighExp;
  601. UCHAR FeaturesExp;
  602. UCHAR SectorCount;
  603. UCHAR SectorCountExp;
  604. UCHAR Reserved2;
  605. UCHAR Control;
  606. ULONG Reserved3;
  607. } REGISTER_FIS, *PREGISTER_FIS;
  608. typedef union _ATA_HYBRID_INFO_FIELDS {
  609. _ANONYMOUS_STRUCT struct {
  610. UCHAR HybridPriority : 4;
  611. UCHAR Reserved0 : 1;
  612. UCHAR InfoValid : 1;
  613. UCHAR Reserved1 : 2;
  614. } DUMMYSTRUCTNAME;
  615. UCHAR AsUchar;
  616. } ATA_HYBRID_INFO_FIELDS, *PATA_HYBRID_INFO_FIELDS;
  617. typedef struct _DEVICE_SET_PASSWORD {
  618. struct {
  619. USHORT PasswordIdentifier : 1;
  620. USHORT Reserved1 : 7;
  621. USHORT MasterPasswordCapability : 1;
  622. USHORT Reserved2 : 7;
  623. } ControlWord;
  624. USHORT Password[16];
  625. USHORT MasterPasswordIdentifier;
  626. USHORT Reserved[238];
  627. } DEVICE_SET_PASSWORD, *PDEVICE_SET_PASSWORD;
  628. typedef struct _IDENTIFY_DEVICE_DATA_LOG_PAGE_HEADER {
  629. ULONGLONG RevisionNumber : 16;
  630. ULONGLONG PageNumber : 8;
  631. ULONGLONG Reserved : 39;
  632. ULONGLONG Valid : 1;
  633. } IDENTIFY_DEVICE_DATA_LOG_PAGE_HEADER, *PIDENTIFY_DEVICE_DATA_LOG_PAGE_HEADER;
  634. typedef struct _IDENTIFY_DEVICE_DATA_LOG_PAGE_SUPPORTED_CAPABILITIES {
  635. IDENTIFY_DEVICE_DATA_LOG_PAGE_HEADER Header;
  636. struct {
  637. ULONGLONG WRV : 1;
  638. ULONGLONG WriteUncorrectable : 1;
  639. ULONGLONG GplDma : 1;
  640. ULONGLONG DmMode3 : 1;
  641. ULONGLONG FreeFall : 1;
  642. ULONGLONG SenseData : 1;
  643. ULONGLONG EPC : 1;
  644. ULONGLONG SmartErrorLogging : 1;
  645. ULONGLONG SmartSelfTest : 1;
  646. ULONGLONG Reserved9 : 1;
  647. ULONGLONG Streaming : 1;
  648. ULONGLONG GPL : 1;
  649. ULONGLONG WriteFuaExt : 1;
  650. ULONGLONG Unload : 1;
  651. ULONGLONG DownloadMicrocode : 1;
  652. ULONGLONG Reserved15ForCFA : 1;
  653. ULONGLONG APM : 1;
  654. ULONGLONG PUIS : 1;
  655. ULONGLONG SpinUp : 1;
  656. ULONGLONG Reserved19 : 1;
  657. ULONGLONG Cmd48Bit : 1;
  658. ULONGLONG Reserved21 : 1;
  659. ULONGLONG FlushCacheExt : 1;
  660. ULONGLONG Smart : 1;
  661. ULONGLONG VolatileWriteCache : 1;
  662. ULONGLONG ReadLookahead : 1;
  663. ULONGLONG Reserved26 : 1;
  664. ULONGLONG WriteBuffer : 1;
  665. ULONGLONG ReadBuffer : 1;
  666. ULONGLONG NOP : 1;
  667. ULONGLONG Reserved30 : 1;
  668. ULONGLONG RZAT : 1;
  669. ULONGLONG Cmd28bit : 1;
  670. ULONGLONG DownloadMicrocodeDma : 1;
  671. ULONGLONG Reserved34 : 1;
  672. ULONGLONG WriteBufferDma : 1;
  673. ULONGLONG ReadBufferDma : 1;
  674. ULONGLONG Reserved37 : 1;
  675. ULONGLONG LpsMisalignmentReporting : 1;
  676. ULONGLONG DRAT : 1;
  677. ULONGLONG Reserved40ForCFA : 1;
  678. ULONGLONG AmaxAddr : 1;
  679. ULONGLONG SetEpcPowerSource : 1;
  680. ULONGLONG LowPowerStandby : 1;
  681. ULONGLONG DSN : 1;
  682. ULONGLONG RequestSenseDeviceFault : 1;
  683. ULONGLONG Reserved : 17;
  684. ULONGLONG Valid : 1;
  685. } SupportedCapabilities;
  686. struct {
  687. ULONGLONG DmMinTransferSize : 16;
  688. ULONGLONG DmMaxTransferSize : 16;
  689. ULONGLONG DmOffsetsImmediateSupported : 1;
  690. ULONGLONG DmImmediateSupported : 1;
  691. ULONGLONG DmOffsetsDeferredSupported : 1;
  692. ULONGLONG Reserved : 28;
  693. ULONGLONG Valid : 1;
  694. } DownloadMicrocodeCapabilities;
  695. struct {
  696. ULONGLONG Rate : 16;
  697. ULONGLONG Reserved : 47;
  698. ULONGLONG Valid : 1;
  699. } NominalMediaRotationRate;
  700. struct {
  701. ULONGLONG Factor : 4;
  702. ULONGLONG Reserved : 59;
  703. ULONGLONG Valid : 1;
  704. } NominalFormFactor;
  705. struct {
  706. ULONGLONG Count : 32;
  707. ULONGLONG Reserved : 31;
  708. ULONGLONG Valid : 1;
  709. } WRVSectorCountMode3;
  710. struct {
  711. ULONGLONG Count : 32;
  712. ULONGLONG Reserved : 31;
  713. ULONGLONG Valid : 1;
  714. } WRVSectorCountMode2;
  715. struct {
  716. ULONGLONG Name;
  717. ULONGLONG Reserved : 63;
  718. ULONGLONG Valid : 1;
  719. } WorldWideName;
  720. struct {
  721. ULONGLONG TrimSupported : 1;
  722. ULONGLONG Reserved : 62;
  723. ULONGLONG Valid : 1;
  724. } DataSetManagement;
  725. struct {
  726. ULONGLONG UtilizationA : 32;
  727. ULONGLONG UtilizationB : 32;
  728. ULONGLONG Reserved0 : 32;
  729. ULONGLONG UtilizationInterval : 8;
  730. ULONGLONG UtilizationUnit : 8;
  731. ULONGLONG UtilizationType : 8;
  732. ULONGLONG Reserved1 : 7;
  733. ULONGLONG Valid : 1;
  734. } UtilizationPerUnitTime;
  735. struct {
  736. ULONGLONG DateTimeRateBasisSupported : 1;
  737. ULONGLONG Reserved0 : 3;
  738. ULONGLONG PowerOnHoursRateBasisSupported : 1;
  739. ULONGLONG Reserved1 : 3;
  740. ULONGLONG SincePowerOnRateBasisSupported : 1;
  741. ULONGLONG Reserved2 : 14;
  742. ULONGLONG SettingRateBasisSupported : 1;
  743. ULONGLONG Reserved3 : 39;
  744. ULONGLONG Valid : 1;
  745. } UtilizationUsageRateSupport;
  746. struct {
  747. ULONGLONG Zoned : 2;
  748. ULONGLONG Reserved : 61;
  749. ULONGLONG Valid : 1;
  750. } ZonedCapabilities;
  751. struct {
  752. ULONGLONG ReportZonesExtSupported : 1;
  753. ULONGLONG NonDataOpenZoneExtSupported : 1;
  754. ULONGLONG NonDataCloseZoneExtSupported : 1;
  755. ULONGLONG NonDataFinishZoneExtSupported : 1;
  756. ULONGLONG NonDataResetWritePointersExtSupported : 1;
  757. ULONGLONG Reserved : 58;
  758. ULONGLONG Valid : 1;
  759. } SupportedZacCapabilities;
  760. UCHAR Reserved[392];
  761. } IDENTIFY_DEVICE_DATA_LOG_PAGE_SUPPORTED_CAPABILITIES, *PIDENTIFY_DEVICE_DATA_LOG_PAGE_SUPPORTED_CAPABILITIES;
  762. typedef struct _IDENTIFY_DEVICE_DATA_LOG_PAGE_ZONED_DEVICE_INFO {
  763. IDENTIFY_DEVICE_DATA_LOG_PAGE_HEADER Header;
  764. struct {
  765. ULONGLONG URSWRZ : 1;
  766. ULONGLONG Reserved : 62;
  767. ULONGLONG Valid : 1;
  768. } ZonedDeviceCapabilities;
  769. struct {
  770. ULONGLONG Reserved : 63;
  771. ULONGLONG Valid : 1;
  772. } ZonedDeviceSettings;
  773. struct {
  774. ULONGLONG Number : 32;
  775. ULONGLONG Reserved : 31;
  776. ULONGLONG Valid : 1;
  777. } OptimalNumberOfOpenSequentialWritePreferredZones;
  778. struct {
  779. ULONGLONG Number : 32;
  780. ULONGLONG Reserved : 31;
  781. ULONGLONG Valid : 1;
  782. } OptimalNumberOfNonSequentiallyWrittenSequentialWritePreferredZones;
  783. struct {
  784. ULONGLONG Number : 32;
  785. ULONGLONG Reserved : 31;
  786. ULONGLONG Valid : 1;
  787. } MaxNumberOfOpenSequentialWriteRequiredZones;
  788. struct {
  789. ULONGLONG ZacMinorVersion : 16;
  790. ULONGLONG Reserved0 : 47;
  791. ULONGLONG Valid : 1;
  792. } Version;
  793. UCHAR Reserved[456];
  794. } IDENTIFY_DEVICE_DATA_LOG_PAGE_ZONED_DEVICE_INFO, *PIDENTIFY_DEVICE_DATA_LOG_PAGE_ZONED_DEVICE_INFO;
  795. typedef struct _CURRENT_DEVICE_INTERNAL_STATUS_LOG {
  796. UCHAR LogAddress;
  797. UCHAR Reserved0[3];
  798. ULONG OrganizationID;
  799. USHORT Area1LastLogPage;
  800. USHORT Area2LastLogPage;
  801. USHORT Area3LastLogPage;
  802. UCHAR Reserved2[368];
  803. UCHAR SavedDataAvailable;
  804. UCHAR SavedDataGenerationNumber;
  805. UCHAR ReasonIdentifier[128];
  806. } CURRENT_DEVICE_INTERNAL_STATUS_LOG, *PCURRENT_DEVICE_INTERNAL_STATUS_LOG;
  807. typedef struct _SAVED_DEVICE_INTERNAL_STATUS_LOG {
  808. UCHAR LogAddress;
  809. UCHAR Reserved0[3];
  810. ULONG OrganizationID;
  811. USHORT Area1LastLogPage;
  812. USHORT Area2LastLogPage;
  813. USHORT Area3LastLogPage;
  814. UCHAR Reserved2[368];
  815. UCHAR SavedDataAvailable;
  816. UCHAR GenerationNumber;
  817. UCHAR ReasonIdentifier[128];
  818. } SAVED_DEVICE_INTERNAL_STATUS_LOG, *PSAVED_DEVICE_INTERNAL_STATUS_LOG;
  819. typedef struct _DEVICE_STATISTICS_LOG_PAGE_HEADER {
  820. ULONGLONG RevisionNumber : 16;
  821. ULONGLONG PageNumber : 8;
  822. ULONGLONG Reserved : 40;
  823. } DEVICE_STATISTICS_LOG_PAGE_HEADER, *PDEVICE_STATISTICS_LOG_PAGE_HEADER;
  824. typedef struct _GP_LOG_SUPPORTED_DEVICE_STATISTICS {
  825. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  826. UCHAR NumberOfEntries;
  827. UCHAR LogPageNumbers[503];
  828. } GP_LOG_SUPPORTED_DEVICE_STATISTICS, *PGP_LOG_SUPPORTED_DEVICE_STATISTICS;
  829. typedef struct _GP_LOG_GENERAL_STATISTICS {
  830. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  831. struct {
  832. ULONGLONG Count : 32;
  833. ULONGLONG Reserved : 24;
  834. ULONGLONG ReservedFlags : 3;
  835. ULONGLONG MonitoredConditionMet : 1;
  836. ULONGLONG StatisticsSupportsDsn : 1;
  837. ULONGLONG Normalized : 1;
  838. ULONGLONG ValidValue : 1;
  839. ULONGLONG Supported : 1;
  840. } LifeTimePoweronResets;
  841. struct {
  842. ULONGLONG Count : 32;
  843. ULONGLONG Reserved : 24;
  844. ULONGLONG ReservedFlags : 3;
  845. ULONGLONG MonitoredConditionMet : 1;
  846. ULONGLONG StatisticsSupportsDsn : 1;
  847. ULONGLONG Normalized : 1;
  848. ULONGLONG ValidValue : 1;
  849. ULONGLONG Supported : 1;
  850. } PoweronHours;
  851. struct {
  852. ULONGLONG Count : 48;
  853. ULONGLONG Reserved : 8;
  854. ULONGLONG ReservedFlags : 3;
  855. ULONGLONG MonitoredConditionMet : 1;
  856. ULONGLONG StatisticsSupportsDsn : 1;
  857. ULONGLONG Normalized : 1;
  858. ULONGLONG ValidValue : 1;
  859. ULONGLONG Supported : 1;
  860. } LogicalSectorsWritten;
  861. struct {
  862. ULONGLONG Count : 48;
  863. ULONGLONG Reserved : 8;
  864. ULONGLONG ReservedFlags : 3;
  865. ULONGLONG MonitoredConditionMet : 1;
  866. ULONGLONG StatisticsSupportsDsn : 1;
  867. ULONGLONG Normalized : 1;
  868. ULONGLONG ValidValue : 1;
  869. ULONGLONG Supported : 1;
  870. } WriteCommandCount;
  871. struct {
  872. ULONGLONG Count : 48;
  873. ULONGLONG Reserved : 8;
  874. ULONGLONG ReservedFlags : 3;
  875. ULONGLONG MonitoredConditionMet : 1;
  876. ULONGLONG StatisticsSupportsDsn : 1;
  877. ULONGLONG Normalized : 1;
  878. ULONGLONG ValidValue : 1;
  879. ULONGLONG Supported : 1;
  880. } LogicalSectorsRead;
  881. struct {
  882. ULONGLONG Count : 48;
  883. ULONGLONG Reserved : 8;
  884. ULONGLONG ReservedFlags : 3;
  885. ULONGLONG MonitoredConditionMet : 1;
  886. ULONGLONG StatisticsSupportsDsn : 1;
  887. ULONGLONG Normalized : 1;
  888. ULONGLONG ValidValue : 1;
  889. ULONGLONG Supported : 1;
  890. } ReadCommandCount;
  891. struct {
  892. ULONGLONG TimeStamp : 48;
  893. ULONGLONG Reserved : 8;
  894. ULONGLONG ReservedFlags : 3;
  895. ULONGLONG MonitoredConditionMet : 1;
  896. ULONGLONG StatisticsSupportsDsn : 1;
  897. ULONGLONG Normalized : 1;
  898. ULONGLONG ValidValue : 1;
  899. ULONGLONG Supported : 1;
  900. } DateAndTime;
  901. struct {
  902. ULONGLONG Count : 32;
  903. ULONGLONG Reserved : 24;
  904. ULONGLONG ReservedFlags : 3;
  905. ULONGLONG MonitoredConditionMet : 1;
  906. ULONGLONG StatisticsSupportsDsn : 1;
  907. ULONGLONG Normalized : 1;
  908. ULONGLONG ValidValue : 1;
  909. ULONGLONG Supported : 1;
  910. } PendingErrorCount;
  911. struct {
  912. ULONGLONG Value : 16;
  913. ULONGLONG Reserved : 40;
  914. ULONGLONG ReservedFlags : 3;
  915. ULONGLONG MonitoredConditionMet : 1;
  916. ULONGLONG StatisticsSupportsDsn : 1;
  917. ULONGLONG Normalized : 1;
  918. ULONGLONG ValidValue : 1;
  919. ULONGLONG Supported : 1;
  920. } WorkloadUtilizaton;
  921. struct {
  922. ULONGLONG Value : 8;
  923. ULONGLONG Reserved0 : 28;
  924. ULONGLONG RateBasis : 4;
  925. ULONGLONG RateValidity : 8;
  926. ULONGLONG Reserved1 : 8;
  927. ULONGLONG ReservedFlags : 3;
  928. ULONGLONG MonitoredConditionMet : 1;
  929. ULONGLONG StatisticsSupportsDsn : 1;
  930. ULONGLONG Normalized : 1;
  931. ULONGLONG ValidValue : 1;
  932. ULONGLONG Supported : 1;
  933. } UtilizationUsageRate;
  934. UCHAR Reserved[424];
  935. } GP_LOG_GENERAL_STATISTICS, *PGP_LOG_GENERAL_STATISTICS;
  936. typedef struct _GP_LOG_FREE_FALL_STATISTICS {
  937. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  938. struct {
  939. ULONGLONG Count : 32;
  940. ULONGLONG Reserved : 24;
  941. ULONGLONG ReservedFlags : 3;
  942. ULONGLONG MonitoredConditionMet : 1;
  943. ULONGLONG StatisticsSupportsDsn : 1;
  944. ULONGLONG Normalized : 1;
  945. ULONGLONG ValidValue : 1;
  946. ULONGLONG Supported : 1;
  947. } NumberofFreeFallEventsDetected;
  948. struct {
  949. ULONGLONG Count : 32;
  950. ULONGLONG Reserved : 24;
  951. ULONGLONG ReservedFlags : 3;
  952. ULONGLONG MonitoredConditionMet : 1;
  953. ULONGLONG StatisticsSupportsDsn : 1;
  954. ULONGLONG Normalized : 1;
  955. ULONGLONG ValidValue : 1;
  956. ULONGLONG Supported : 1;
  957. } OverlimitShockEvents;
  958. UCHAR Reserved[488];
  959. } GP_LOG_FREE_FALL_STATISTICS, *PGP_LOG_FREE_FALL_STATISTICS;
  960. typedef struct _GP_LOG_ROTATING_MEDIA_STATISTICS {
  961. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  962. struct {
  963. ULONGLONG Count : 32;
  964. ULONGLONG Reserved : 24;
  965. ULONGLONG ReservedFlags : 3;
  966. ULONGLONG MonitoredConditionMet : 1;
  967. ULONGLONG StatisticsSupportsDsn : 1;
  968. ULONGLONG Normalized : 1;
  969. ULONGLONG ValidValue : 1;
  970. ULONGLONG Supported : 1;
  971. } SpindleMotorPoweronHours;
  972. struct {
  973. ULONGLONG Count : 32;
  974. ULONGLONG Reserved : 24;
  975. ULONGLONG ReservedFlags : 3;
  976. ULONGLONG MonitoredConditionMet : 1;
  977. ULONGLONG StatisticsSupportsDsn : 1;
  978. ULONGLONG Normalized : 1;
  979. ULONGLONG ValidValue : 1;
  980. ULONGLONG Supported : 1;
  981. } HeadFlyingHours;
  982. struct {
  983. ULONGLONG Count : 32;
  984. ULONGLONG Reserved : 24;
  985. ULONGLONG ReservedFlags : 3;
  986. ULONGLONG MonitoredConditionMet : 1;
  987. ULONGLONG StatisticsSupportsDsn : 1;
  988. ULONGLONG Normalized : 1;
  989. ULONGLONG ValidValue : 1;
  990. ULONGLONG Supported : 1;
  991. } HeadLoadEvents;
  992. struct {
  993. ULONGLONG Count : 32;
  994. ULONGLONG Reserved : 24;
  995. ULONGLONG ReservedFlags : 3;
  996. ULONGLONG MonitoredConditionMet : 1;
  997. ULONGLONG StatisticsSupportsDsn : 1;
  998. ULONGLONG Normalized : 1;
  999. ULONGLONG ValidValue : 1;
  1000. ULONGLONG Supported : 1;
  1001. } NumberOfReallocatedLogicalSectors;
  1002. struct {
  1003. ULONGLONG Count : 32;
  1004. ULONGLONG Reserved : 24;
  1005. ULONGLONG ReservedFlags : 3;
  1006. ULONGLONG MonitoredConditionMet : 1;
  1007. ULONGLONG StatisticsSupportsDsn : 1;
  1008. ULONGLONG Normalized : 1;
  1009. ULONGLONG ValidValue : 1;
  1010. ULONGLONG Supported : 1;
  1011. } ReadRecoveryAttempts;
  1012. struct {
  1013. ULONGLONG Count : 32;
  1014. ULONGLONG Reserved : 24;
  1015. ULONGLONG ReservedFlags : 3;
  1016. ULONGLONG MonitoredConditionMet : 1;
  1017. ULONGLONG StatisticsSupportsDsn : 1;
  1018. ULONGLONG Normalized : 1;
  1019. ULONGLONG ValidValue : 1;
  1020. ULONGLONG Supported : 1;
  1021. } NumberOfMechanicalStartFailures;
  1022. struct {
  1023. ULONGLONG Count : 32;
  1024. ULONGLONG Reserved : 24;
  1025. ULONGLONG ReservedFlags : 3;
  1026. ULONGLONG MonitoredConditionMet : 1;
  1027. ULONGLONG StatisticsSupportsDsn : 1;
  1028. ULONGLONG Normalized : 1;
  1029. ULONGLONG ValidValue : 1;
  1030. ULONGLONG Supported : 1;
  1031. } NumberOfReallocationCandidateLogicalSectors;
  1032. struct {
  1033. ULONGLONG Count : 32;
  1034. ULONGLONG Reserved : 24;
  1035. ULONGLONG ReservedFlags : 3;
  1036. ULONGLONG MonitoredConditionMet : 1;
  1037. ULONGLONG StatisticsSupportsDsn : 1;
  1038. ULONGLONG Normalized : 1;
  1039. ULONGLONG ValidValue : 1;
  1040. ULONGLONG Supported : 1;
  1041. } NumberOfHighPriorityUnloadEvents;
  1042. UCHAR Reserved[440];
  1043. } GP_LOG_ROTATING_MEDIA_STATISTICS, *PGP_LOG_ROTATING_MEDIA_STATISTICS;
  1044. typedef struct _GP_LOG_GENERAL_ERROR_STATISTICS {
  1045. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  1046. struct {
  1047. ULONGLONG Count : 32;
  1048. ULONGLONG Reserved : 24;
  1049. ULONGLONG ReservedFlags : 3;
  1050. ULONGLONG MonitoredConditionMet : 1;
  1051. ULONGLONG StatisticsSupportsDsn : 1;
  1052. ULONGLONG Normalized : 1;
  1053. ULONGLONG ValidValue : 1;
  1054. ULONGLONG Supported : 1;
  1055. } NumberOfReportedUncorrectableErrors;
  1056. struct {
  1057. ULONGLONG Count : 32;
  1058. ULONGLONG Reserved : 24;
  1059. ULONGLONG ReservedFlags : 3;
  1060. ULONGLONG MonitoredConditionMet : 1;
  1061. ULONGLONG StatisticsSupportsDsn : 1;
  1062. ULONGLONG Normalized : 1;
  1063. ULONGLONG ValidValue : 1;
  1064. ULONGLONG Supported : 1;
  1065. } NumberOfResetsBetweenCommandAcceptanceAndCommandCompletion;
  1066. UCHAR Reserved[488];
  1067. } GP_LOG_GENERAL_ERROR_STATISTICS, *PGP_LOG_GENERAL_ERROR_STATISTICS;
  1068. typedef struct _GP_LOG_TEMPERATURE_STATISTICS {
  1069. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  1070. struct {
  1071. ULONGLONG Value : 8;
  1072. ULONGLONG Reserved : 48;
  1073. ULONGLONG ReservedFlags : 3;
  1074. ULONGLONG MonitoredConditionMet : 1;
  1075. ULONGLONG StatisticsSupportsDsn : 1;
  1076. ULONGLONG Normalized : 1;
  1077. ULONGLONG ValidValue : 1;
  1078. ULONGLONG Supported : 1;
  1079. } CurrentTemperature;
  1080. struct {
  1081. ULONGLONG Value : 8;
  1082. ULONGLONG Reserved : 48;
  1083. ULONGLONG ReservedFlags : 3;
  1084. ULONGLONG MonitoredConditionMet : 1;
  1085. ULONGLONG StatisticsSupportsDsn : 1;
  1086. ULONGLONG Normalized : 1;
  1087. ULONGLONG ValidValue : 1;
  1088. ULONGLONG Supported : 1;
  1089. } AverageShortTermTemperature;
  1090. struct {
  1091. ULONGLONG Value : 8;
  1092. ULONGLONG Reserved : 48;
  1093. ULONGLONG ReservedFlags : 3;
  1094. ULONGLONG MonitoredConditionMet : 1;
  1095. ULONGLONG StatisticsSupportsDsn : 1;
  1096. ULONGLONG Normalized : 1;
  1097. ULONGLONG ValidValue : 1;
  1098. ULONGLONG Supported : 1;
  1099. } AverageLongTermTemperature;
  1100. struct {
  1101. ULONGLONG Value : 8;
  1102. ULONGLONG Reserved : 48;
  1103. ULONGLONG ReservedFlags : 3;
  1104. ULONGLONG MonitoredConditionMet : 1;
  1105. ULONGLONG StatisticsSupportsDsn : 1;
  1106. ULONGLONG Normalized : 1;
  1107. ULONGLONG ValidValue : 1;
  1108. ULONGLONG Supported : 1;
  1109. } HighestTemperature;
  1110. struct {
  1111. ULONGLONG Value : 8;
  1112. ULONGLONG Reserved : 48;
  1113. ULONGLONG ReservedFlags : 3;
  1114. ULONGLONG MonitoredConditionMet : 1;
  1115. ULONGLONG StatisticsSupportsDsn : 1;
  1116. ULONGLONG Normalized : 1;
  1117. ULONGLONG ValidValue : 1;
  1118. ULONGLONG Supported : 1;
  1119. } LowestTemperature;
  1120. struct {
  1121. ULONGLONG Value : 8;
  1122. ULONGLONG Reserved : 48;
  1123. ULONGLONG ReservedFlags : 3;
  1124. ULONGLONG MonitoredConditionMet : 1;
  1125. ULONGLONG StatisticsSupportsDsn : 1;
  1126. ULONGLONG Normalized : 1;
  1127. ULONGLONG ValidValue : 1;
  1128. ULONGLONG Supported : 1;
  1129. } HighestAverageShortTermTemperature;
  1130. struct {
  1131. ULONGLONG Value : 8;
  1132. ULONGLONG Reserved : 48;
  1133. ULONGLONG ReservedFlags : 3;
  1134. ULONGLONG MonitoredConditionMet : 1;
  1135. ULONGLONG StatisticsSupportsDsn : 1;
  1136. ULONGLONG Normalized : 1;
  1137. ULONGLONG ValidValue : 1;
  1138. ULONGLONG Supported : 1;
  1139. } LowestAverageShortTermTemperature;
  1140. struct {
  1141. ULONGLONG Value : 8;
  1142. ULONGLONG Reserved : 48;
  1143. ULONGLONG ReservedFlags : 3;
  1144. ULONGLONG MonitoredConditionMet : 1;
  1145. ULONGLONG StatisticsSupportsDsn : 1;
  1146. ULONGLONG Normalized : 1;
  1147. ULONGLONG ValidValue : 1;
  1148. ULONGLONG Supported : 1;
  1149. } HighstAverageLongTermTemperature;
  1150. struct {
  1151. ULONGLONG Value : 8;
  1152. ULONGLONG Reserved : 48;
  1153. ULONGLONG ReservedFlags : 3;
  1154. ULONGLONG MonitoredConditionMet : 1;
  1155. ULONGLONG StatisticsSupportsDsn : 1;
  1156. ULONGLONG Normalized : 1;
  1157. ULONGLONG ValidValue : 1;
  1158. ULONGLONG Supported : 1;
  1159. } LowestAverageLongTermTemperature;
  1160. struct {
  1161. ULONGLONG Value : 8;
  1162. ULONGLONG Reserved : 48;
  1163. ULONGLONG ReservedFlags : 3;
  1164. ULONGLONG MonitoredConditionMet : 1;
  1165. ULONGLONG StatisticsSupportsDsn : 1;
  1166. ULONGLONG Normalized : 1;
  1167. ULONGLONG ValidValue : 1;
  1168. ULONGLONG Supported : 1;
  1169. } TimeInOverTemperature;
  1170. struct {
  1171. ULONGLONG Value : 8;
  1172. ULONGLONG Reserved : 48;
  1173. ULONGLONG ReservedFlags : 3;
  1174. ULONGLONG MonitoredConditionMet : 1;
  1175. ULONGLONG StatisticsSupportsDsn : 1;
  1176. ULONGLONG Normalized : 1;
  1177. ULONGLONG ValidValue : 1;
  1178. ULONGLONG Supported : 1;
  1179. } SpecifiedMaximumOperatingTemperature;
  1180. struct {
  1181. ULONGLONG Value : 8;
  1182. ULONGLONG Reserved : 48;
  1183. ULONGLONG ReservedFlags : 3;
  1184. ULONGLONG MonitoredConditionMet : 1;
  1185. ULONGLONG StatisticsSupportsDsn : 1;
  1186. ULONGLONG Normalized : 1;
  1187. ULONGLONG ValidValue : 1;
  1188. ULONGLONG Supported : 1;
  1189. } TimeInUnderTemperature;
  1190. struct {
  1191. ULONGLONG Value : 8;
  1192. ULONGLONG Reserved : 48;
  1193. ULONGLONG ReservedFlags : 3;
  1194. ULONGLONG MonitoredConditionMet : 1;
  1195. ULONGLONG StatisticsSupportsDsn : 1;
  1196. ULONGLONG Normalized : 1;
  1197. ULONGLONG ValidValue : 1;
  1198. ULONGLONG Supported : 1;
  1199. } SpecifiedMinimumOperatingTemperature;
  1200. UCHAR Reserved[400];
  1201. } GP_LOG_TEMPERATURE_STATISTICS, *PGP_LOG_TEMPERATURE_STATISTICS;
  1202. typedef struct _GP_LOG_TRANSPORT_STATISTICS {
  1203. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  1204. struct {
  1205. ULONGLONG Count : 8;
  1206. ULONGLONG Reserved : 48;
  1207. ULONGLONG ReservedFlags : 3;
  1208. ULONGLONG MonitoredConditionMet : 1;
  1209. ULONGLONG StatisticsSupportsDsn : 1;
  1210. ULONGLONG Normalized : 1;
  1211. ULONGLONG ValidValue : 1;
  1212. ULONGLONG Supported : 1;
  1213. } NumberOfHardwareResets;
  1214. struct {
  1215. ULONGLONG Count : 32;
  1216. ULONGLONG Reserved : 24;
  1217. ULONGLONG ReservedFlags : 3;
  1218. ULONGLONG MonitoredConditionMet : 1;
  1219. ULONGLONG StatisticsSupportsDsn : 1;
  1220. ULONGLONG Normalized : 1;
  1221. ULONGLONG ValidValue : 1;
  1222. ULONGLONG Supported : 1;
  1223. } NumberOfAsrEvents;
  1224. struct {
  1225. ULONGLONG Count : 32;
  1226. ULONGLONG Reserved : 24;
  1227. ULONGLONG ReservedFlags : 3;
  1228. ULONGLONG MonitoredConditionMet : 1;
  1229. ULONGLONG StatisticsSupportsDsn : 1;
  1230. ULONGLONG Normalized : 1;
  1231. ULONGLONG ValidValue : 1;
  1232. ULONGLONG Supported : 1;
  1233. } NumberOfInterfaceCrcErrors;
  1234. UCHAR Reserved[480];
  1235. } GP_LOG_TRANSPORT_STATISTICS, *PGP_LOG_TRANSPORT_STATISTICS;
  1236. typedef struct _GP_LOG_SOLID_STATE_DEVICE_STATISTICS {
  1237. DEVICE_STATISTICS_LOG_PAGE_HEADER Header;
  1238. struct {
  1239. ULONGLONG Value : 8;
  1240. ULONGLONG Reserved : 48;
  1241. ULONGLONG ReservedFlags : 3;
  1242. ULONGLONG MonitoredConditionMet : 1;
  1243. ULONGLONG StatisticsSupportsDsn : 1;
  1244. ULONGLONG Normalized : 1;
  1245. ULONGLONG ValidValue : 1;
  1246. ULONGLONG Supported : 1;
  1247. } PercentageUsedEnduranceIndicator;
  1248. UCHAR Reserved[496];
  1249. } GP_LOG_SOLID_STATE_DEVICE_STATISTICS, *PGP_LOG_SOLID_STATE_DEVICE_STATISTICS;
  1250. typedef struct _GP_LOG_NCQ_COMMAND_ERROR {
  1251. UCHAR NcqTag : 5;
  1252. UCHAR Reserved0 : 1;
  1253. UCHAR UNL : 1;
  1254. UCHAR NonQueuedCmd : 1;
  1255. UCHAR Reserved1;
  1256. UCHAR Status;
  1257. UCHAR Error;
  1258. UCHAR LBA7_0;
  1259. UCHAR LBA15_8;
  1260. UCHAR LBA23_16;
  1261. UCHAR Device;
  1262. UCHAR LBA31_24;
  1263. UCHAR LBA39_32;
  1264. UCHAR LBA47_40;
  1265. UCHAR Reserved2;
  1266. UCHAR Count7_0;
  1267. UCHAR Count15_8;
  1268. UCHAR SenseKey;
  1269. UCHAR ASC;
  1270. UCHAR ASCQ;
  1271. UCHAR Reserved3[239];
  1272. UCHAR Vendor[255];
  1273. UCHAR Checksum;
  1274. } GP_LOG_NCQ_COMMAND_ERROR, *PGP_LOG_NCQ_COMMAND_ERROR;
  1275. typedef struct _GP_LOG_NCQ_NON_DATA {
  1276. struct {
  1277. ULONG AbortNcq : 1;
  1278. ULONG AbortAll : 1;
  1279. ULONG AbortStreaming : 1;
  1280. ULONG AbortNonStreaming : 1;
  1281. ULONG AbortSelectedTTag : 1;
  1282. ULONG Reserved : 27;
  1283. } SubCmd0;
  1284. struct {
  1285. ULONG DeadlineHandling : 1;
  1286. ULONG WriteDataNotContinue : 1;
  1287. ULONG ReadDataNotContinue : 1;
  1288. ULONG Reserved : 29;
  1289. } SubCmd1;
  1290. struct {
  1291. ULONG HybridDemoteBySize : 1;
  1292. ULONG Reserved : 31;
  1293. } SubCmd2;
  1294. struct {
  1295. ULONG HybridChangeByLbaRange : 1;
  1296. ULONG Reserved : 31;
  1297. } SubCmd3;
  1298. struct {
  1299. ULONG HybridControl : 1;
  1300. ULONG Reserved : 31;
  1301. } SubCmd4;
  1302. struct {
  1303. ULONG Reserved : 32;
  1304. } SubCmd5;
  1305. struct {
  1306. ULONG Reserved : 32;
  1307. } SubCmd6;
  1308. struct {
  1309. ULONG Reserved : 32;
  1310. } SubCmd7;
  1311. struct {
  1312. ULONG Reserved : 32;
  1313. } SubCmd8;
  1314. struct {
  1315. ULONG Reserved : 32;
  1316. } SubCmd9;
  1317. struct {
  1318. ULONG Reserved : 32;
  1319. } SubCmdA;
  1320. struct {
  1321. ULONG Reserved : 32;
  1322. } SubCmdB;
  1323. struct {
  1324. ULONG Reserved : 32;
  1325. } SubCmdC;
  1326. struct {
  1327. ULONG Reserved : 32;
  1328. } SubCmdD;
  1329. struct {
  1330. ULONG Reserved : 32;
  1331. } SubCmdE;
  1332. struct {
  1333. ULONG Reserved : 32;
  1334. } SubCmdF;
  1335. ULONG Reserved[112];
  1336. } GP_LOG_NCQ_NON_DATA, *PGP_LOG_NCQ_NON_DATA;
  1337. typedef struct _GP_LOG_NCQ_SEND_RECEIVE {
  1338. struct {
  1339. ULONG DataSetManagement : 1;
  1340. ULONG HybridEvict : 1;
  1341. ULONG Reserved : 30;
  1342. } SubCmd;
  1343. struct {
  1344. ULONG Trim : 1;
  1345. ULONG Reserved : 31;
  1346. } DataSetManagement;
  1347. ULONG Reserved[126];
  1348. } GP_LOG_NCQ_SEND_RECEIVE, *PGP_LOG_NCQ_SEND_RECEIVE;
  1349. typedef struct _GP_LOG_HYBRID_INFORMATION_HEADER {
  1350. USHORT HybridInfoDescrCount : 4;
  1351. USHORT Reserved0 : 12;
  1352. UCHAR Enabled;
  1353. UCHAR HybridHealth;
  1354. UCHAR DirtyLowThreshold;
  1355. UCHAR DirtyHighThreshold;
  1356. UCHAR OptimalWriteGranularity;
  1357. UCHAR MaximumHybridPriorityLevel : 4;
  1358. UCHAR Reserved1 : 4;
  1359. UCHAR PowerCondidtion;
  1360. UCHAR CachingMediumEnabled ;
  1361. struct {
  1362. UCHAR MaximumPriorityBehavior : 1;
  1363. UCHAR SupportCacheBehavior : 1;
  1364. UCHAR Reserved : 6;
  1365. } SupportedOptions;
  1366. UCHAR Reserved2;
  1367. ULONG TimeSinceEnabled;
  1368. ULONGLONG NVMSize;
  1369. ULONGLONG EnableCount;
  1370. USHORT MaximumEvictionCommands : 5;
  1371. USHORT Reserved3 : 11;
  1372. USHORT MaximumEvictionDataBlocks;
  1373. UCHAR Reserved[28];
  1374. } GP_LOG_HYBRID_INFORMATION_HEADER, *PGP_LOG_HYBRID_INFORMATION_HEADER;
  1375. typedef struct _GP_LOG_HYBRID_INFORMATION_DESCRIPTOR {
  1376. UCHAR HybridPriority;
  1377. UCHAR ConsumedNVMSizeFraction;
  1378. UCHAR ConsumedMappingResourcesFraction;
  1379. UCHAR ConsumedNVMSizeForDirtyDataFraction;
  1380. UCHAR ConsumedMappingResourcesForDirtyDataFraction;
  1381. UCHAR Reserved[11];
  1382. } GP_LOG_HYBRID_INFORMATION_DESCRIPTOR, *PGP_LOG_HYBRID_INFORMATION_DESCRIPTOR;
  1383. typedef struct _GP_LOG_HYBRID_INFORMATION {
  1384. GP_LOG_HYBRID_INFORMATION_HEADER Header;
  1385. GP_LOG_HYBRID_INFORMATION_DESCRIPTOR Descriptor[0];
  1386. } GP_LOG_HYBRID_INFORMATION, *PGP_LOG_HYBRID_INFORMATION;
  1387. typedef struct _REPORT_ZONES_EXT_DATA {
  1388. ULONG ZoneListLength;
  1389. UCHAR SAME : 4;
  1390. UCHAR Reserved0 : 4;
  1391. UCHAR Reserved1[3];
  1392. ULONGLONG MaxLBA : 48;
  1393. ULONGLONG Reserved2 : 16;
  1394. UCHAR Reserved3[48];
  1395. } REPORT_ZONES_EXT_DATA, *PREPORT_ZONES_EXT_DATA;
  1396. typedef struct _ATA_ZONE_DESCRIPTOR {
  1397. UCHAR ZoneType : 4;
  1398. UCHAR Reserved0 : 4;
  1399. UCHAR Reset : 1;
  1400. UCHAR NonSeq : 1;
  1401. UCHAR Reserved1 : 2;
  1402. UCHAR ZoneCondition : 4;
  1403. UCHAR Reserved2[6];
  1404. ULONGLONG ZoneLength : 48;
  1405. ULONGLONG Reserved3 : 16;
  1406. ULONGLONG ZoneStartLBA : 48;
  1407. ULONGLONG Reserved4 : 16;
  1408. ULONGLONG WritePointerLBA : 48;
  1409. ULONGLONG Reserved5 : 16;
  1410. UCHAR Reserved6[32];
  1411. } ATA_ZONE_DESCRIPTOR, *PATA_ZONE_DESCRIPTOR;
  1412. typedef struct _ATA_PHYSICAL_ELEMENT_STATUS_DESCRIPTOR {
  1413. UCHAR Reserved1[4];
  1414. ULONG ElementIdentifier;
  1415. UCHAR Reserved2[6];
  1416. UCHAR PhysicalElementType;
  1417. UCHAR PhysicalElementHealth;
  1418. ULONGLONG AssociatedCapacity;
  1419. UCHAR Reserved3[8];
  1420. } ATA_PHYSICAL_ELEMENT_STATUS_DESCRIPTOR, *PATA_PHYSICAL_ELEMENT_STATUS_DESCRIPTOR;
  1421. typedef struct _ATA_GET_PHYSICAL_ELEMENT_STATUS_PARAMETER_DATA {
  1422. ULONG NumberOfDescriptors;
  1423. ULONG NumberOfDescriptorsReturned;
  1424. ULONG ElementIdentifierBeingDepoped;
  1425. UCHAR Reserved[20];
  1426. ATA_PHYSICAL_ELEMENT_STATUS_DESCRIPTOR Descriptors[ANYSIZE_ARRAY];
  1427. } ATA_GET_PHYSICAL_ELEMENT_STATUS_PARAMETER_DATA, *PATA_GET_PHYSICAL_ELEMENT_STATUS_PARAMETER_DATA;
  1428. #pragma pack(pop)
  1429. #define ATAPI_MODE_SENSE 0x5A
  1430. #define ATAPI_MODE_SELECT 0x55
  1431. #define ATAPI_LS120_FORMAT_UNIT 0x24
  1432. #define IDE_LBA_MODE (1 << 6)
  1433. #define IDE_DC_DISABLE_INTERRUPTS 0x02
  1434. #define IDE_DC_RESET_CONTROLLER 0x04
  1435. #define IDE_DC_REENABLE_CONTROLLER 0x00
  1436. #define IDE_STATUS_ERROR 0x01
  1437. #define IDE_STATUS_INDEX 0x02
  1438. #define IDE_STATUS_CORRECTED_ERROR 0x04
  1439. #define IDE_STATUS_DRQ 0x08
  1440. #define IDE_STATUS_DSC 0x10
  1441. #define IDE_STATUS_DEVICE_FAULT 0x20
  1442. #define IDE_STATUS_DRDY 0x40
  1443. #define IDE_STATUS_IDLE 0x50
  1444. #define IDE_STATUS_BUSY 0x80
  1445. #define IDE_ERROR_BAD_BLOCK 0x80
  1446. #define IDE_ERROR_CRC_ERROR IDE_ERROR_BAD_BLOCK
  1447. #define IDE_ERROR_DATA_ERROR 0x40
  1448. #define IDE_ERROR_MEDIA_CHANGE 0x20
  1449. #define IDE_ERROR_ID_NOT_FOUND 0x10
  1450. #define IDE_ERROR_MEDIA_CHANGE_REQ 0x08
  1451. #define IDE_ERROR_COMMAND_ABORTED 0x04
  1452. #define IDE_ERROR_END_OF_MEDIA 0x02
  1453. #define IDE_ERROR_ILLEGAL_LENGTH 0x01
  1454. #define IDE_ERROR_ADDRESS_NOT_FOUND IDE_ERROR_ILLEGAL_LENGTH
  1455. #define IDE_COMMAND_NOP 0x00
  1456. #define IDE_COMMAND_DATA_SET_MANAGEMENT 0x06
  1457. #define IDE_COMMAND_ATAPI_RESET 0x08
  1458. #define IDE_COMMAND_GET_PHYSICAL_ELEMENT_STATUS 0x12
  1459. #define IDE_COMMAND_READ 0x20
  1460. #define IDE_COMMAND_READ_EXT 0x24
  1461. #define IDE_COMMAND_READ_DMA_EXT 0x25
  1462. #define IDE_COMMAND_READ_DMA_QUEUED_EXT 0x26
  1463. #define IDE_COMMAND_READ_MULTIPLE_EXT 0x29
  1464. #define IDE_COMMAND_READ_LOG_EXT 0x2f
  1465. #define IDE_COMMAND_WRITE 0x30
  1466. #define IDE_COMMAND_WRITE_EXT 0x34
  1467. #define IDE_COMMAND_WRITE_DMA_EXT 0x35
  1468. #define IDE_COMMAND_WRITE_DMA_QUEUED_EXT 0x36
  1469. #define IDE_COMMAND_WRITE_MULTIPLE_EXT 0x39
  1470. #define IDE_COMMAND_WRITE_DMA_FUA_EXT 0x3D
  1471. #define IDE_COMMAND_WRITE_DMA_QUEUED_FUA_EXT 0x3E
  1472. #define IDE_COMMAND_WRITE_LOG_EXT 0x3F
  1473. #define IDE_COMMAND_VERIFY 0x40
  1474. #define IDE_COMMAND_VERIFY_EXT 0x42
  1475. #define IDE_COMMAND_ZAC_MANAGEMENT_IN 0x4A
  1476. #define IDE_COMMAND_WRITE_LOG_DMA_EXT 0x57
  1477. #define IDE_COMMAND_TRUSTED_NON_DATA 0x5B
  1478. #define IDE_COMMAND_TRUSTED_RECEIVE 0x5C
  1479. #define IDE_COMMAND_TRUSTED_RECEIVE_DMA 0x5D
  1480. #define IDE_COMMAND_TRUSTED_SEND 0x5E
  1481. #define IDE_COMMAND_TRUSTED_SEND_DMA 0x5F
  1482. #define IDE_COMMAND_READ_FPDMA_QUEUED 0x60
  1483. #define IDE_COMMAND_WRITE_FPDMA_QUEUED 0x61
  1484. #define IDE_COMMAND_NCQ_NON_DATA 0x63
  1485. #define IDE_COMMAND_SEND_FPDMA_QUEUED 0x64
  1486. #define IDE_COMMAND_RECEIVE_FPDMA_QUEUED 0x65
  1487. #define IDE_COMMAND_SET_DATE_AND_TIME 0x77
  1488. #define IDE_COMMAND_REMOVE_ELEMENT_AND_TRUNCATE 0x7C
  1489. #define IDE_COMMAND_EXECUTE_DEVICE_DIAGNOSTIC 0x90
  1490. #define IDE_COMMAND_SET_DRIVE_PARAMETERS 0x91
  1491. #define IDE_COMMAND_DOWNLOAD_MICROCODE 0x92
  1492. #define IDE_COMMAND_DOWNLOAD_MICROCODE_DMA 0x93
  1493. #define IDE_COMMAND_ZAC_MANAGEMENT_OUT 0x9F
  1494. #define IDE_COMMAND_ATAPI_PACKET 0xA0
  1495. #define IDE_COMMAND_ATAPI_IDENTIFY 0xA1
  1496. #define IDE_COMMAND_SMART 0xB0
  1497. #define IDE_COMMAND_READ_LOG_DMA_EXT 0xB1
  1498. #define IDE_COMMAND_SANITIZE_DEVICE 0xB4
  1499. #define IDE_COMMAND_READ_MULTIPLE 0xC4
  1500. #define IDE_COMMAND_WRITE_MULTIPLE 0xC5
  1501. #define IDE_COMMAND_SET_MULTIPLE 0xC6
  1502. #define IDE_COMMAND_READ_DMA 0xC8
  1503. #define IDE_COMMAND_WRITE_DMA 0xCA
  1504. #define IDE_COMMAND_WRITE_DMA_QUEUED 0xCC
  1505. #define IDE_COMMAND_WRITE_MULTIPLE_FUA_EXT 0xCE
  1506. #define IDE_COMMAND_GET_MEDIA_STATUS 0xDA
  1507. #define IDE_COMMAND_DOOR_LOCK 0xDE
  1508. #define IDE_COMMAND_DOOR_UNLOCK 0xDF
  1509. #define IDE_COMMAND_STANDBY_IMMEDIATE 0xE0
  1510. #define IDE_COMMAND_IDLE_IMMEDIATE 0xE1
  1511. #define IDE_COMMAND_CHECK_POWER 0xE5
  1512. #define IDE_COMMAND_SLEEP 0xE6
  1513. #define IDE_COMMAND_FLUSH_CACHE 0xE7
  1514. #define IDE_COMMAND_FLUSH_CACHE_EXT 0xEA
  1515. #define IDE_COMMAND_IDENTIFY 0xEC
  1516. #define IDE_COMMAND_MEDIA_EJECT 0xED
  1517. #define IDE_COMMAND_SET_FEATURE 0xEF
  1518. #define IDE_COMMAND_SECURITY_SET_PASSWORD 0xF1
  1519. #define IDE_COMMAND_SECURITY_UNLOCK 0xF2
  1520. #define IDE_COMMAND_SECURITY_ERASE_PREPARE 0xF3
  1521. #define IDE_COMMAND_SECURITY_ERASE_UNIT 0xF4
  1522. #define IDE_COMMAND_SECURITY_FREEZE_LOCK 0xF5
  1523. #define IDE_COMMAND_SECURITY_DISABLE_PASSWORD 0xF6
  1524. #define IDE_COMMAND_NOT_VALID 0xFF
  1525. #define IDE_SET_DEFAULT_PIO_MODE(mode) ((UCHAR)1)
  1526. #define IDE_SET_ADVANCE_PIO_MODE(mode) ((UCHAR)((1 << 3) | (mode)))
  1527. #define IDE_SET_SWDMA_MODE(mode) ((UCHAR)((1 << 4) | (mode)))
  1528. #define IDE_SET_MWDMA_MODE(mode) ((UCHAR)((1 << 5) | (mode)))
  1529. #define IDE_SET_UDMA_MODE(mode) ((UCHAR)((1 << 6) | (mode)))
  1530. #define IDE_FEATURE_ENABLE_WRITE_CACHE 0x2
  1531. #define IDE_FEATURE_SET_TRANSFER_MODE 0x3
  1532. #define IDE_FEATURE_ENABLE_PUIS 0x6
  1533. #define IDE_FEATURE_PUIS_SPIN_UP 0x7
  1534. #define IDE_FEATURE_ENABLE_SATA_FEATURE 0x10
  1535. #define IDE_FEATURE_DISABLE_MSN 0x31
  1536. #define IDE_FEATURE_DISABLE_REVERT_TO_POWER_ON 0x66
  1537. #define IDE_FEATURE_DISABLE_WRITE_CACHE 0x82
  1538. #define IDE_FEATURE_DISABLE_PUIS 0x86
  1539. #define IDE_FEATURE_DISABLE_SATA_FEATURE 0x90
  1540. #define IDE_FEATURE_ENABLE_MSN 0x95
  1541. #define IDE_SATA_FEATURE_NON_ZERO_DMA_BUFFER_OFFSET 0x1
  1542. #define IDE_SATA_FEATURE_DMA_SETUP_FIS_AUTO_ACTIVATE 0x2
  1543. #define IDE_SATA_FEATURE_DEVICE_INITIATED_POWER_MANAGEMENT 0x3
  1544. #define IDE_SATA_FEATURE_GUARANTEED_IN_ORDER_DELIVERY 0x4
  1545. #define IDE_SATA_FEATURE_ASYNCHRONOUS_NOTIFICATION 0x5
  1546. #define IDE_SATA_FEATURE_SOFTWARE_SETTINGS_PRESERVATION 0x6
  1547. #define IDE_SATA_FEATURE_DEVICE_AUTO_PARTIAL_TO_SLUMBER 0x7
  1548. #define IDE_SATA_FEATURE_ENABLE_HARDWARE_FEATURE_CONTROL 0x8
  1549. #define IDE_SATA_FEATURE_DEVSLP 0x9
  1550. #define IDE_SATA_FEATURE_HYBRID_INFORMATION 0xA
  1551. #define IDE_SMART_READ_ATTRIBUTES 0xD0
  1552. #define IDE_SMART_READ_THRESHOLDS 0xD1
  1553. #define IDE_SMART_ENABLE_DISABLE_AUTOSAVE 0xD2
  1554. #define IDE_SMART_SAVE_ATTRIBUTE_VALUES 0xD3
  1555. #define IDE_SMART_EXECUTE_OFFLINE_DIAGS 0xD4
  1556. #define IDE_SMART_READ_LOG 0xD5
  1557. #define IDE_SMART_WRITE_LOG 0xD6
  1558. #define IDE_SMART_ENABLE 0xD8
  1559. #define IDE_SMART_DISABLE 0xD9
  1560. #define IDE_SMART_RETURN_STATUS 0xDA
  1561. #define IDE_SMART_ENABLE_DISABLE_AUTO_OFFLINE 0xDB
  1562. #define IDE_DSM_FEATURE_TRIM 0x0001
  1563. #define IDE_NCQ_NON_DATA_ABORT_NCQ_QUEUE 0x00
  1564. #define IDE_NCQ_NON_DATA_DEADLINE_HANDLING 0x01
  1565. #define IDE_NCQ_NON_DATA_HYBRID_CHANGE_BY_SIZE 0x02
  1566. #define IDE_NCQ_NON_DATA_HYBRID_DEMOTE_BY_SIZE 0x02
  1567. #define IDE_NCQ_NON_DATA_HYBRID_CHANGE_BY_LBA_RANGE 0x03
  1568. #define IDE_NCQ_NON_DATA_HYBRID_CONTROL 0x04
  1569. #define IDE_NCQ_SEND_DATA_SET_MANAGEMENT 0x00
  1570. #define IDE_NCQ_SEND_HYBRID_EVICT 0x01
  1571. #define ATA_DEVICE_SET_PASSWORD_MASTER 0x01
  1572. #define ATA_DEVICE_SET_PASSWORD_USER 0x00
  1573. #define IDE_GP_LOG_DIRECTORY_ADDRESS 0x00
  1574. #define IDE_GP_SUMMARY_SMART_ERROR 0x01
  1575. #define IDE_GP_COMPREHENSIVE_SMART_ERROR 0x02
  1576. #define IDE_GP_EXTENDED_COMPREHENSIVE_SMART_ERROR 0x03
  1577. #define IDE_GP_LOG_DEVICE_STATISTICS_ADDRESS 0x04
  1578. #define IDE_GP_SMART_SELF_TEST 0x06
  1579. #define IDE_GP_EXTENDED_SMART_SELF_TEST 0x07
  1580. #define IDE_GP_LOG_POWER_CONDITIONS 0x08
  1581. #define IDE_GP_SELECTIVE_SELF_TEST 0x09
  1582. #define IDE_GP_DEVICE_STATISTICS_NOTIFICATION 0x0A
  1583. #define IDE_GP_PENDING_DEFECTS 0x0C
  1584. #define IDE_GP_LPS_MISALIGNMENT 0x0D
  1585. #define IDE_GP_LOG_NCQ_COMMAND_ERROR_ADDRESS 0x10
  1586. #define IDE_GP_LOG_PHY_EVENT_COUNTER_ADDRESS 0x11
  1587. #define IDE_GP_LOG_NCQ_NON_DATA_ADDRESS 0x12
  1588. #define IDE_GP_LOG_NCQ_SEND_RECEIVE_ADDRESS 0x13
  1589. #define IDE_GP_LOG_HYBRID_INFO_ADDRESS 0x14
  1590. #define IDE_GP_LOG_REBUILD_ASSIST 0x15
  1591. #define IDE_GP_LOG_LBA_STATUS 0x19
  1592. #define IDE_GP_LOG_WRITE_STREAM_ERROR 0x21
  1593. #define IDE_GP_LOG_READ_STREAM_ERROR 0x22
  1594. #define IDE_GP_LOG_CURRENT_DEVICE_INTERNAL_STATUS 0x24
  1595. #define IDE_GP_LOG_SAVED_DEVICE_INTERNAL_STATUS 0x25
  1596. #define IDE_GP_LOG_IDENTIFY_DEVICE_DATA_ADDRESS 0x30
  1597. #define IDE_GP_LOG_SCT_COMMAND_STATUS 0xE0
  1598. #define IDE_GP_LOG_SCT_DATA_TRANSFER 0xE1
  1599. #define IDE_GP_LOG_SECTOR_SIZE 0x200
  1600. #define IDE_GP_LOG_VERSION 0x0001
  1601. #define IDE_GP_LOG_SUPPORTED_PAGES 0x00
  1602. #define IDE_GP_LOG_IDENTIFY_DEVICE_DATA_SUPPORTED_CAPABILITIES_PAGE 0x03
  1603. #define IDE_GP_LOG_IDENTIFY_DEVICE_DATA_SATA_PAGE 0x08
  1604. #define IDE_GP_LOG_IDENTIFY_DEVICE_DATA_ZONED_DEVICE_INFORMATION_PAGE 0x09
  1605. #define ATA_ZONED_CAPABILITIES_NOT_REPORTED 0x0
  1606. #define ATA_ZONED_CAPABILITIES_HOST_AWARE 0x1
  1607. #define ATA_ZONED_CAPABILITIES_DEVICE_MANAGED 0x2
  1608. #define ZAC_REVISION_NOT_REPORTED_1 0x0000
  1609. #define ZAC_REVISION_NOT_REPORTED_2 0xFFFF
  1610. #define ZAC_REVISION_01 0xB6E8
  1611. #define ZAC_REVISION_04 0xA36C
  1612. #define CURRENT_DEVICE_INTERNAL_STATUS_DATA_LOG_ADDRESS 0x24
  1613. #define SAVED_DEVICE_INTERNAL_STATUS_DATA_LOG_ADDRESS 0x25
  1614. #define IDE_GP_LOG_DEVICE_STATISTICS_GENERAL_PAGE 0x01
  1615. #define IDE_GP_LOG_DEVICE_STATISTICS_FREE_FALL_PAGE 0x02
  1616. #define IDE_GP_LOG_DEVICE_STATISTICS_ROTATING_MEDIA_PAGE 0x03
  1617. #define IDE_GP_LOG_DEVICE_STATISTICS_GENERAL_ERROR_PAGE 0x04
  1618. #define IDE_GP_LOG_DEVICE_STATISTICS_TEMPERATURE_PAGE 0x05
  1619. #define IDE_GP_LOG_DEVICE_STATISTICS_TRANSPORT_PAGE 0x06
  1620. #define IDE_GP_LOG_DEVICE_STATISTICS_SSD_PAGE 0x07
  1621. #define HYBRID_INFORMATION_DISABLED 0x00
  1622. #define HYBRID_INFORMATION_DISABLE_IN_PROCESS 0x80
  1623. #define HYBRID_INFORMATION_ENABLED 0xFF
  1624. #define HYBRID_HEALTH_UNUSEABLE 0x01
  1625. #define HYBRID_HEALTH_NVM_SIZE_CHANGED 0x02
  1626. #define HYBRID_HEALTH_READ_ONLY 0x04
  1627. #define HYBRID_HEALTH_DATA_LOSS 0x08
  1628. #define ATA_DEVICE_SIGNATURE_ATA 0x00000101
  1629. #define ATA_DEVICE_SIGNATURE_ATAPI 0xEB140101
  1630. #define ATA_DEVICE_SIGNATURE_HOST_ZONED 0xABCD0101
  1631. #define ATA_DEVICE_SIGNATURE_ENCLOSURE 0xC33C0101
  1632. #define ATA_DEVICE_SIGNATURE_PORT_MULTIPLIER 0x96690101
  1633. #define ZM_ACTION_REPORT_ZONES 0x00
  1634. #define ZM_ACTION_CLOSE_ZONE 0x01
  1635. #define ZM_ACTION_FINISH_ZONE 0x02
  1636. #define ZM_ACTION_OPEN_ZONE 0x03
  1637. #define ZM_ACTION_RESET_WRITE_POINTER 0x04
  1638. #define ZM_ALL_ZONES_BIT (1 << 8)
  1639. #define ATA_REPORT_ZONES_OPTION_LIST_ALL_ZONES 0x00
  1640. #define ATA_REPORT_ZONES_OPTION_LIST_EMPTY_ZONES 0x01
  1641. #define ATA_REPORT_ZONES_OPTION_LIST_IMPLICITLY_OPENED_ZONES 0x02
  1642. #define ATA_REPORT_ZONES_OPTION_LIST_EXPLICITLY_OPENED_ZONES 0x03
  1643. #define ATA_REPORT_ZONES_OPTION_LIST_CLOSED_ZONES 0x04
  1644. #define ATA_REPORT_ZONES_OPTION_LIST_FULL_ZONES 0x05
  1645. #define ATA_REPORT_ZONES_OPTION_LIST_READ_ONLY_ZONES 0x06
  1646. #define ATA_REPORT_ZONES_OPTION_LIST_OFFLINE_ZONES 0x07
  1647. #define ATA_REPORT_ZONES_OPTION_LIST_RWP_ZONES 0x10
  1648. #define ATA_REPORT_ZONES_OPTION_LIST_NON_SEQUENTIAL_WRITE_RESOURCES_ACTIVE_ZONES 0x11
  1649. #define ATA_REPORT_ZONES_OPTION_LIST_NOT_WRITE_POINTER_ZONES 0x3F
  1650. #define ATA_ZONES_TYPE_AND_LENGTH_MAY_DIFFERENT 0x0
  1651. #define ATA_ZONES_TYPE_SAME_LENGTH_SAME 0x1
  1652. #define ATA_ZONES_TYPE_SAME_LAST_ZONE_LENGTH_DIFFERENT 0x2
  1653. #define ATA_ZONES_TYPE_MAY_DIFFERENT_LENGTH_SAME 0x3
  1654. #define ATA_ZONE_TYPE_CONVENTIONAL 0x1
  1655. #define ATA_ZONE_TYPE_SEQUENTIAL_WRITE_REQUIRED 0x2
  1656. #define ATA_ZONE_TYPE_SEQUENTIAL_WRITE_PREFERRED 0x3
  1657. #define ATA_ZONE_CONDITION_NOT_WRITE_POINTER 0x0
  1658. #define ATA_ZONE_CONDITION_EMPTY 0x1
  1659. #define ATA_ZONE_CONDITION_IMPLICITLY_OPENED 0x2
  1660. #define ATA_ZONE_CONDITION_EXPLICITLY_OPENED 0x3
  1661. #define ATA_ZONE_CONDITION_CLOSED 0x4
  1662. #define ATA_ZONE_CONDITION_READ_ONLY 0xD
  1663. #define ATA_ZONE_CONDITION_FULL 0xE
  1664. #define ATA_ZONE_CONDITION_OFFLINE 0xF
  1665. #endif