logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

hdreg.h (22703B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_HDREG_H
  3. #define _LINUX_HDREG_H
  4. #include <linux/types.h>
  5. /*
  6. * Command Header sizes for IOCTL commands
  7. */
  8. #define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8))
  9. #define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8))
  10. #define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8))
  11. #define IDE_DRIVE_TASK_NO_DATA 0
  12. #define IDE_DRIVE_TASK_INVALID -1
  13. #define IDE_DRIVE_TASK_SET_XFER 1
  14. #define IDE_DRIVE_TASK_IN 2
  15. #define IDE_DRIVE_TASK_OUT 3
  16. #define IDE_DRIVE_TASK_RAW_WRITE 4
  17. /*
  18. * Define standard taskfile in/out register
  19. */
  20. #define IDE_TASKFILE_STD_IN_FLAGS 0xFE
  21. #define IDE_HOB_STD_IN_FLAGS 0x3C
  22. #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
  23. #define IDE_HOB_STD_OUT_FLAGS 0x3C
  24. typedef unsigned char task_ioreg_t;
  25. typedef unsigned long sata_ioreg_t;
  26. typedef union ide_reg_valid_s {
  27. unsigned all : 16;
  28. struct {
  29. unsigned data : 1;
  30. unsigned error_feature : 1;
  31. unsigned sector : 1;
  32. unsigned nsector : 1;
  33. unsigned lcyl : 1;
  34. unsigned hcyl : 1;
  35. unsigned select : 1;
  36. unsigned status_command : 1;
  37. unsigned data_hob : 1;
  38. unsigned error_feature_hob : 1;
  39. unsigned sector_hob : 1;
  40. unsigned nsector_hob : 1;
  41. unsigned lcyl_hob : 1;
  42. unsigned hcyl_hob : 1;
  43. unsigned select_hob : 1;
  44. unsigned control_hob : 1;
  45. } b;
  46. } ide_reg_valid_t;
  47. typedef struct ide_task_request_s {
  48. __u8 io_ports[8];
  49. __u8 hob_ports[8]; /* bytes 6 and 7 are unused */
  50. ide_reg_valid_t out_flags;
  51. ide_reg_valid_t in_flags;
  52. int data_phase;
  53. int req_cmd;
  54. unsigned long out_size;
  55. unsigned long in_size;
  56. } ide_task_request_t;
  57. typedef struct ide_ioctl_request_s {
  58. ide_task_request_t *task_request;
  59. unsigned char *out_buffer;
  60. unsigned char *in_buffer;
  61. } ide_ioctl_request_t;
  62. struct hd_drive_cmd_hdr {
  63. __u8 command;
  64. __u8 sector_number;
  65. __u8 feature;
  66. __u8 sector_count;
  67. };
  68. typedef struct hd_drive_task_hdr {
  69. __u8 data;
  70. __u8 feature;
  71. __u8 sector_count;
  72. __u8 sector_number;
  73. __u8 low_cylinder;
  74. __u8 high_cylinder;
  75. __u8 device_head;
  76. __u8 command;
  77. } task_struct_t;
  78. typedef struct hd_drive_hob_hdr {
  79. __u8 data;
  80. __u8 feature;
  81. __u8 sector_count;
  82. __u8 sector_number;
  83. __u8 low_cylinder;
  84. __u8 high_cylinder;
  85. __u8 device_head;
  86. __u8 control;
  87. } hob_struct_t;
  88. #define TASKFILE_NO_DATA 0x0000
  89. #define TASKFILE_IN 0x0001
  90. #define TASKFILE_MULTI_IN 0x0002
  91. #define TASKFILE_OUT 0x0004
  92. #define TASKFILE_MULTI_OUT 0x0008
  93. #define TASKFILE_IN_OUT 0x0010
  94. #define TASKFILE_IN_DMA 0x0020
  95. #define TASKFILE_OUT_DMA 0x0040
  96. #define TASKFILE_IN_DMAQ 0x0080
  97. #define TASKFILE_OUT_DMAQ 0x0100
  98. #define TASKFILE_P_IN 0x0200
  99. #define TASKFILE_P_OUT 0x0400
  100. #define TASKFILE_P_IN_DMA 0x0800
  101. #define TASKFILE_P_OUT_DMA 0x1000
  102. #define TASKFILE_P_IN_DMAQ 0x2000
  103. #define TASKFILE_P_OUT_DMAQ 0x4000
  104. #define TASKFILE_48 0x8000
  105. #define TASKFILE_INVALID 0x7fff
  106. /* ATA/ATAPI Commands pre T13 Spec */
  107. #define WIN_NOP 0x00
  108. /*
  109. * 0x01->0x02 Reserved
  110. */
  111. #define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
  112. /*
  113. * 0x04->0x07 Reserved
  114. */
  115. #define WIN_SRST 0x08 /* ATAPI soft reset command */
  116. #define WIN_DEVICE_RESET 0x08
  117. /*
  118. * 0x09->0x0F Reserved
  119. */
  120. #define WIN_RECAL 0x10
  121. #define WIN_RESTORE WIN_RECAL
  122. /*
  123. * 0x10->0x1F Reserved
  124. */
  125. #define WIN_READ 0x20 /* 28-Bit */
  126. #define WIN_READ_ONCE 0x21 /* 28-Bit without retries */
  127. #define WIN_READ_LONG 0x22 /* 28-Bit */
  128. #define WIN_READ_LONG_ONCE 0x23 /* 28-Bit without retries */
  129. #define WIN_READ_EXT 0x24 /* 48-Bit */
  130. #define WIN_READDMA_EXT 0x25 /* 48-Bit */
  131. #define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
  132. #define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
  133. /*
  134. * 0x28
  135. */
  136. #define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
  137. /*
  138. * 0x2A->0x2F Reserved
  139. */
  140. #define WIN_WRITE 0x30 /* 28-Bit */
  141. #define WIN_WRITE_ONCE 0x31 /* 28-Bit without retries */
  142. #define WIN_WRITE_LONG 0x32 /* 28-Bit */
  143. #define WIN_WRITE_LONG_ONCE 0x33 /* 28-Bit without retries */
  144. #define WIN_WRITE_EXT 0x34 /* 48-Bit */
  145. #define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
  146. #define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
  147. #define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
  148. #define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
  149. #define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
  150. /*
  151. * 0x3A->0x3B Reserved
  152. */
  153. #define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
  154. /*
  155. * 0x3D->0x3F Reserved
  156. */
  157. #define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
  158. #define WIN_VERIFY_ONCE 0x41 /* 28-Bit - without retries */
  159. #define WIN_VERIFY_EXT 0x42 /* 48-Bit */
  160. /*
  161. * 0x43->0x4F Reserved
  162. */
  163. #define WIN_FORMAT 0x50
  164. /*
  165. * 0x51->0x5F Reserved
  166. */
  167. #define WIN_INIT 0x60
  168. /*
  169. * 0x61->0x5F Reserved
  170. */
  171. #define WIN_SEEK 0x70 /* 0x70-0x7F Reserved */
  172. #define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
  173. #define WIN_DIAGNOSE 0x90
  174. #define WIN_SPECIFY 0x91 /* set drive geometry translation */
  175. #define WIN_DOWNLOAD_MICROCODE 0x92
  176. #define WIN_STANDBYNOW2 0x94
  177. #define WIN_STANDBY2 0x96
  178. #define WIN_SETIDLE2 0x97
  179. #define WIN_CHECKPOWERMODE2 0x98
  180. #define WIN_SLEEPNOW2 0x99
  181. /*
  182. * 0x9A VENDOR
  183. */
  184. #define WIN_PACKETCMD 0xA0 /* Send a packet command. */
  185. #define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
  186. #define WIN_QUEUED_SERVICE 0xA2
  187. #define WIN_SMART 0xB0 /* self-monitoring and reporting */
  188. #define CFA_ERASE_SECTORS 0xC0
  189. #define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
  190. #define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
  191. #define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
  192. #define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
  193. #define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
  194. #define WIN_READDMA_ONCE 0xC9 /* 28-Bit - without retries */
  195. #define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
  196. #define WIN_WRITEDMA_ONCE 0xCB /* 28-Bit - without retries */
  197. #define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
  198. #define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
  199. #define WIN_GETMEDIASTATUS 0xDA
  200. #define WIN_ACKMEDIACHANGE 0xDB /* ATA-1, ATA-2 vendor */
  201. #define WIN_POSTBOOT 0xDC
  202. #define WIN_PREBOOT 0xDD
  203. #define WIN_DOORLOCK 0xDE /* lock door on removable drives */
  204. #define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
  205. #define WIN_STANDBYNOW1 0xE0
  206. #define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
  207. #define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
  208. #define WIN_SETIDLE1 0xE3
  209. #define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
  210. #define WIN_CHECKPOWERMODE1 0xE5
  211. #define WIN_SLEEPNOW1 0xE6
  212. #define WIN_FLUSH_CACHE 0xE7
  213. #define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
  214. #define WIN_WRITE_SAME 0xE9 /* read ata-2 to use */
  215. /* SET_FEATURES 0x22 or 0xDD */
  216. #define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
  217. #define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
  218. #define WIN_MEDIAEJECT 0xED
  219. #define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
  220. #define WIN_SETFEATURES 0xEF /* set special drive features */
  221. #define EXABYTE_ENABLE_NEST 0xF0
  222. #define WIN_SECURITY_SET_PASS 0xF1
  223. #define WIN_SECURITY_UNLOCK 0xF2
  224. #define WIN_SECURITY_ERASE_PREPARE 0xF3
  225. #define WIN_SECURITY_ERASE_UNIT 0xF4
  226. #define WIN_SECURITY_FREEZE_LOCK 0xF5
  227. #define WIN_SECURITY_DISABLE 0xF6
  228. #define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
  229. #define WIN_SET_MAX 0xF9
  230. #define DISABLE_SEAGATE 0xFB
  231. /* WIN_SMART sub-commands */
  232. #define SMART_READ_VALUES 0xD0
  233. #define SMART_READ_THRESHOLDS 0xD1
  234. #define SMART_AUTOSAVE 0xD2
  235. #define SMART_SAVE 0xD3
  236. #define SMART_IMMEDIATE_OFFLINE 0xD4
  237. #define SMART_READ_LOG_SECTOR 0xD5
  238. #define SMART_WRITE_LOG_SECTOR 0xD6
  239. #define SMART_WRITE_THRESHOLDS 0xD7
  240. #define SMART_ENABLE 0xD8
  241. #define SMART_DISABLE 0xD9
  242. #define SMART_STATUS 0xDA
  243. #define SMART_AUTO_OFFLINE 0xDB
  244. /* Password used in TF4 & TF5 executing SMART commands */
  245. #define SMART_LCYL_PASS 0x4F
  246. #define SMART_HCYL_PASS 0xC2
  247. /* WIN_SETFEATURES sub-commands */
  248. #define SETFEATURES_EN_8BIT 0x01 /* Enable 8-Bit Transfers */
  249. #define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
  250. #define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
  251. #define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
  252. #define SETFEATURES_EN_SAME_R 0x22 /* for a region ATA-1 */
  253. #define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
  254. #define SETFEATURES_DIS_RETRY 0x33 /* Disable Retry */
  255. #define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
  256. #define SETFEATURES_RW_LONG 0x44 /* Set Length of VS bytes */
  257. #define SETFEATURES_SET_CACHE 0x54 /* Set Cache segments to SC Reg. Val */
  258. #define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
  259. #define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
  260. #define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
  261. #define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
  262. #define SETFEATURES_DIS_ECC 0x77 /* Disable ECC byte count */
  263. #define SETFEATURES_DIS_8BIT 0x81 /* Disable 8-Bit Transfers */
  264. #define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
  265. #define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */
  266. #define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
  267. #define SETFEATURES_EN_ECC 0x88 /* Enable ECC byte count */
  268. #define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
  269. #define SETFEATURES_EN_RETRY 0x99 /* Enable Retry */
  270. #define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
  271. #define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
  272. #define SETFEATURES_EN_REST 0xAC /* ATA-1 */
  273. #define SETFEATURES_4B_RW_LONG 0xBB /* Set Length of 4 bytes */
  274. #define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
  275. #define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
  276. #define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt ATAPI */
  277. #define SETFEATURES_EN_SAME_M 0xDD /* for a entire device ATA-1 */
  278. #define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt ATAPI */
  279. /* WIN_SECURITY sub-commands */
  280. #define SECURITY_SET_PASSWORD 0xBA
  281. #define SECURITY_UNLOCK 0xBB
  282. #define SECURITY_ERASE_PREPARE 0xBC
  283. #define SECURITY_ERASE_UNIT 0xBD
  284. #define SECURITY_FREEZE_LOCK 0xBE
  285. #define SECURITY_DISABLE_PASSWORD 0xBF
  286. struct hd_geometry {
  287. unsigned char heads;
  288. unsigned char sectors;
  289. unsigned short cylinders;
  290. unsigned long start;
  291. };
  292. /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
  293. #define HDIO_GETGEO 0x0301 /* get device geometry */
  294. #define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */
  295. #define HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */
  296. #define HDIO_GET_QDMA 0x0305 /* get use-qdma flag */
  297. #define HDIO_SET_XFER 0x0306 /* set transfer rate via proc */
  298. #define HDIO_OBSOLETE_IDENTITY 0x0307 /* OBSOLETE, DO NOT USE: returns 142 bytes */
  299. #define HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */
  300. #define HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */
  301. #define HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */
  302. #define HDIO_GET_DMA 0x030b /* get use-dma flag */
  303. #define HDIO_GET_NICE 0x030c /* get nice flags */
  304. #define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
  305. #define HDIO_GET_WCACHE 0x030e /* get write cache mode on|off */
  306. #define HDIO_GET_ACOUSTIC 0x030f /* get acoustic value */
  307. #define HDIO_GET_ADDRESS 0x0310 /* */
  308. #define HDIO_GET_BUSSTATE 0x031a /* get the bus state of the hwif */
  309. #define HDIO_TRISTATE_HWIF 0x031b /* execute a channel tristate */
  310. #define HDIO_DRIVE_RESET 0x031c /* execute a device reset */
  311. #define HDIO_DRIVE_TASKFILE 0x031d /* execute raw taskfile */
  312. #define HDIO_DRIVE_TASK 0x031e /* execute task and special drive command */
  313. #define HDIO_DRIVE_CMD 0x031f /* execute a special drive command */
  314. #define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
  315. /* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
  316. #define HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */
  317. #define HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */
  318. #define HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */
  319. #define HDIO_SET_32BIT 0x0324 /* change io_32bit flags */
  320. #define HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */
  321. #define HDIO_SET_DMA 0x0326 /* change use-dma flag */
  322. #define HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */
  323. #define HDIO_SCAN_HWIF 0x0328 /* register and (re)scan interface */
  324. #define HDIO_UNREGISTER_HWIF 0x032a /* unregister interface */
  325. #define HDIO_SET_NICE 0x0329 /* set nice flags */
  326. #define HDIO_SET_WCACHE 0x032b /* change write cache enable-disable */
  327. #define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */
  328. #define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */
  329. #define HDIO_SET_QDMA 0x032e /* change use-qdma flag */
  330. #define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */
  331. /* bus states */
  332. enum {
  333. BUSSTATE_OFF = 0,
  334. BUSSTATE_ON,
  335. BUSSTATE_TRISTATE
  336. };
  337. /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
  338. /* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
  339. /* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */
  340. /* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */
  341. /* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */
  342. #define __NEW_HD_DRIVE_ID
  343. /*
  344. * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
  345. *
  346. * If you change something here, please remember to update fix_driveid() in
  347. * ide/probe.c.
  348. */
  349. struct hd_driveid {
  350. unsigned short config; /* lots of obsolete bit flags */
  351. unsigned short cyls; /* Obsolete, "physical" cyls */
  352. unsigned short reserved2; /* reserved (word 2) */
  353. unsigned short heads; /* Obsolete, "physical" heads */
  354. unsigned short track_bytes; /* unformatted bytes per track */
  355. unsigned short sector_bytes; /* unformatted bytes per sector */
  356. unsigned short sectors; /* Obsolete, "physical" sectors per track */
  357. unsigned short vendor0; /* vendor unique */
  358. unsigned short vendor1; /* vendor unique */
  359. unsigned short vendor2; /* Retired vendor unique */
  360. unsigned char serial_no[20]; /* 0 = not_specified */
  361. unsigned short buf_type; /* Retired */
  362. unsigned short buf_size; /* Retired, 512 byte increments
  363. * 0 = not_specified
  364. */
  365. unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
  366. unsigned char fw_rev[8]; /* 0 = not_specified */
  367. unsigned char model[40]; /* 0 = not_specified */
  368. unsigned char max_multsect; /* 0=not_implemented */
  369. unsigned char vendor3; /* vendor unique */
  370. unsigned short dword_io; /* 0=not_implemented; 1=implemented */
  371. unsigned char vendor4; /* vendor unique */
  372. unsigned char capability; /* (upper byte of word 49)
  373. * 3: IORDYsup
  374. * 2: IORDYsw
  375. * 1: LBA
  376. * 0: DMA
  377. */
  378. unsigned short reserved50; /* reserved (word 50) */
  379. unsigned char vendor5; /* Obsolete, vendor unique */
  380. unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
  381. unsigned char vendor6; /* Obsolete, vendor unique */
  382. unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
  383. unsigned short field_valid; /* (word 53)
  384. * 2: ultra_ok word 88
  385. * 1: eide_ok words 64-70
  386. * 0: cur_ok words 54-58
  387. */
  388. unsigned short cur_cyls; /* Obsolete, logical cylinders */
  389. unsigned short cur_heads; /* Obsolete, l heads */
  390. unsigned short cur_sectors; /* Obsolete, l sectors per track */
  391. unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */
  392. unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */
  393. unsigned char multsect; /* current multiple sector count */
  394. unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
  395. unsigned int lba_capacity; /* Obsolete, total number of sectors */
  396. unsigned short dma_1word; /* Obsolete, single-word dma info */
  397. unsigned short dma_mword; /* multiple-word dma info */
  398. unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
  399. unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
  400. unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */
  401. unsigned short eide_pio; /* min cycle time (ns), no IORDY */
  402. unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
  403. unsigned short words69_70[2]; /* reserved words 69-70
  404. * future command overlap and queuing
  405. */
  406. unsigned short words71_74[4]; /* reserved words 71-74
  407. * for IDENTIFY PACKET DEVICE command
  408. */
  409. unsigned short queue_depth; /* (word 75)
  410. * 15:5 reserved
  411. * 4:0 Maximum queue depth -1
  412. */
  413. unsigned short words76_79[4]; /* reserved words 76-79 */
  414. unsigned short major_rev_num; /* (word 80) */
  415. unsigned short minor_rev_num; /* (word 81) */
  416. unsigned short command_set_1; /* (word 82) supported
  417. * 15: Obsolete
  418. * 14: NOP command
  419. * 13: READ_BUFFER
  420. * 12: WRITE_BUFFER
  421. * 11: Obsolete
  422. * 10: Host Protected Area
  423. * 9: DEVICE Reset
  424. * 8: SERVICE Interrupt
  425. * 7: Release Interrupt
  426. * 6: look-ahead
  427. * 5: write cache
  428. * 4: PACKET Command
  429. * 3: Power Management Feature Set
  430. * 2: Removable Feature Set
  431. * 1: Security Feature Set
  432. * 0: SMART Feature Set
  433. */
  434. unsigned short command_set_2; /* (word 83)
  435. * 15: Shall be ZERO
  436. * 14: Shall be ONE
  437. * 13: FLUSH CACHE EXT
  438. * 12: FLUSH CACHE
  439. * 11: Device Configuration Overlay
  440. * 10: 48-bit Address Feature Set
  441. * 9: Automatic Acoustic Management
  442. * 8: SET MAX security
  443. * 7: reserved 1407DT PARTIES
  444. * 6: SetF sub-command Power-Up
  445. * 5: Power-Up in Standby Feature Set
  446. * 4: Removable Media Notification
  447. * 3: APM Feature Set
  448. * 2: CFA Feature Set
  449. * 1: READ/WRITE DMA QUEUED
  450. * 0: Download MicroCode
  451. */
  452. unsigned short cfsse; /* (word 84)
  453. * cmd set-feature supported extensions
  454. * 15: Shall be ZERO
  455. * 14: Shall be ONE
  456. * 13:6 reserved
  457. * 5: General Purpose Logging
  458. * 4: Streaming Feature Set
  459. * 3: Media Card Pass Through
  460. * 2: Media Serial Number Valid
  461. * 1: SMART selt-test supported
  462. * 0: SMART error logging
  463. */
  464. unsigned short cfs_enable_1; /* (word 85)
  465. * command set-feature enabled
  466. * 15: Obsolete
  467. * 14: NOP command
  468. * 13: READ_BUFFER
  469. * 12: WRITE_BUFFER
  470. * 11: Obsolete
  471. * 10: Host Protected Area
  472. * 9: DEVICE Reset
  473. * 8: SERVICE Interrupt
  474. * 7: Release Interrupt
  475. * 6: look-ahead
  476. * 5: write cache
  477. * 4: PACKET Command
  478. * 3: Power Management Feature Set
  479. * 2: Removable Feature Set
  480. * 1: Security Feature Set
  481. * 0: SMART Feature Set
  482. */
  483. unsigned short cfs_enable_2; /* (word 86)
  484. * command set-feature enabled
  485. * 15: Shall be ZERO
  486. * 14: Shall be ONE
  487. * 13: FLUSH CACHE EXT
  488. * 12: FLUSH CACHE
  489. * 11: Device Configuration Overlay
  490. * 10: 48-bit Address Feature Set
  491. * 9: Automatic Acoustic Management
  492. * 8: SET MAX security
  493. * 7: reserved 1407DT PARTIES
  494. * 6: SetF sub-command Power-Up
  495. * 5: Power-Up in Standby Feature Set
  496. * 4: Removable Media Notification
  497. * 3: APM Feature Set
  498. * 2: CFA Feature Set
  499. * 1: READ/WRITE DMA QUEUED
  500. * 0: Download MicroCode
  501. */
  502. unsigned short csf_default; /* (word 87)
  503. * command set-feature default
  504. * 15: Shall be ZERO
  505. * 14: Shall be ONE
  506. * 13:6 reserved
  507. * 5: General Purpose Logging enabled
  508. * 4: Valid CONFIGURE STREAM executed
  509. * 3: Media Card Pass Through enabled
  510. * 2: Media Serial Number Valid
  511. * 1: SMART selt-test supported
  512. * 0: SMART error logging
  513. */
  514. unsigned short dma_ultra; /* (word 88) */
  515. unsigned short trseuc; /* time required for security erase */
  516. unsigned short trsEuc; /* time required for enhanced erase */
  517. unsigned short CurAPMvalues; /* current APM values */
  518. unsigned short mprc; /* master password revision code */
  519. unsigned short hw_config; /* hardware config (word 93)
  520. * 15: Shall be ZERO
  521. * 14: Shall be ONE
  522. * 13:
  523. * 12:
  524. * 11:
  525. * 10:
  526. * 9:
  527. * 8:
  528. * 7:
  529. * 6:
  530. * 5:
  531. * 4:
  532. * 3:
  533. * 2:
  534. * 1:
  535. * 0: Shall be ONE
  536. */
  537. unsigned short acoustic; /* (word 94)
  538. * 15:8 Vendor's recommended value
  539. * 7:0 current value
  540. */
  541. unsigned short msrqs; /* min stream request size */
  542. unsigned short sxfert; /* stream transfer time */
  543. unsigned short sal; /* stream access latency */
  544. unsigned int spg; /* stream performance granularity */
  545. unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
  546. unsigned short words104_125[22];/* reserved words 104-125 */
  547. unsigned short last_lun; /* (word 126) */
  548. unsigned short word127; /* (word 127) Feature Set
  549. * Removable Media Notification
  550. * 15:2 reserved
  551. * 1:0 00 = not supported
  552. * 01 = supported
  553. * 10 = reserved
  554. * 11 = reserved
  555. */
  556. unsigned short dlf; /* (word 128)
  557. * device lock function
  558. * 15:9 reserved
  559. * 8 security level 1:max 0:high
  560. * 7:6 reserved
  561. * 5 enhanced erase
  562. * 4 expire
  563. * 3 frozen
  564. * 2 locked
  565. * 1 en/disabled
  566. * 0 capability
  567. */
  568. unsigned short csfo; /* (word 129)
  569. * current set features options
  570. * 15:4 reserved
  571. * 3: auto reassign
  572. * 2: reverting
  573. * 1: read-look-ahead
  574. * 0: write cache
  575. */
  576. unsigned short words130_155[26];/* reserved vendor words 130-155 */
  577. unsigned short word156; /* reserved vendor word 156 */
  578. unsigned short words157_159[3];/* reserved vendor words 157-159 */
  579. unsigned short cfa_power; /* (word 160) CFA Power Mode
  580. * 15 word 160 supported
  581. * 14 reserved
  582. * 13
  583. * 12
  584. * 11:0
  585. */
  586. unsigned short words161_175[15];/* Reserved for CFA */
  587. unsigned short words176_205[30];/* Current Media Serial Number */
  588. unsigned short words206_254[49];/* reserved words 206-254 */
  589. unsigned short integrity_word; /* (word 255)
  590. * 15:8 Checksum
  591. * 7:0 Signature
  592. */
  593. };
  594. /*
  595. * IDE "nice" flags. These are used on a per drive basis to determine
  596. * when to be nice and give more bandwidth to the other devices which
  597. * share the same IDE bus.
  598. */
  599. #define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */
  600. #define IDE_NICE_ATAPI_OVERLAP (1) /* not supported yet */
  601. #define IDE_NICE_1 (3) /* when probably won't affect us much */
  602. #define IDE_NICE_0 (2) /* when sure that it won't affect us */
  603. #define IDE_NICE_2 (4) /* when we know it's on our expense */
  604. #endif /* _LINUX_HDREG_H */