hdreg.h 22 KB

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