xref: /linux/include/uapi/linux/hdreg.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells #ifndef _LINUX_HDREG_H
3607ca46eSDavid Howells #define _LINUX_HDREG_H
4607ca46eSDavid Howells 
5607ca46eSDavid Howells #include <linux/types.h>
6607ca46eSDavid Howells 
7607ca46eSDavid Howells /*
8607ca46eSDavid Howells  * Command Header sizes for IOCTL commands
9607ca46eSDavid Howells  */
10607ca46eSDavid Howells 
11607ca46eSDavid Howells #define HDIO_DRIVE_CMD_HDR_SIZE		(4 * sizeof(__u8))
12607ca46eSDavid Howells #define HDIO_DRIVE_HOB_HDR_SIZE		(8 * sizeof(__u8))
13607ca46eSDavid Howells #define HDIO_DRIVE_TASK_HDR_SIZE	(8 * sizeof(__u8))
14607ca46eSDavid Howells 
15607ca46eSDavid Howells #define IDE_DRIVE_TASK_NO_DATA		0
16607ca46eSDavid Howells #ifndef __KERNEL__
17607ca46eSDavid Howells #define IDE_DRIVE_TASK_INVALID		-1
18607ca46eSDavid Howells #define IDE_DRIVE_TASK_SET_XFER		1
19607ca46eSDavid Howells #define IDE_DRIVE_TASK_IN		2
20607ca46eSDavid Howells #define IDE_DRIVE_TASK_OUT		3
21607ca46eSDavid Howells #endif
22607ca46eSDavid Howells #define IDE_DRIVE_TASK_RAW_WRITE	4
23607ca46eSDavid Howells 
24607ca46eSDavid Howells /*
25607ca46eSDavid Howells  * Define standard taskfile in/out register
26607ca46eSDavid Howells  */
27607ca46eSDavid Howells #define IDE_TASKFILE_STD_IN_FLAGS	0xFE
28607ca46eSDavid Howells #define IDE_HOB_STD_IN_FLAGS		0x3C
29607ca46eSDavid Howells #ifndef __KERNEL__
30607ca46eSDavid Howells #define IDE_TASKFILE_STD_OUT_FLAGS	0xFE
31607ca46eSDavid Howells #define IDE_HOB_STD_OUT_FLAGS		0x3C
32607ca46eSDavid Howells 
33607ca46eSDavid Howells typedef unsigned char task_ioreg_t;
34607ca46eSDavid Howells typedef unsigned long sata_ioreg_t;
35607ca46eSDavid Howells #endif
36607ca46eSDavid Howells 
37607ca46eSDavid Howells typedef union ide_reg_valid_s {
38607ca46eSDavid Howells 	unsigned all				: 16;
39607ca46eSDavid Howells 	struct {
40607ca46eSDavid Howells 		unsigned data			: 1;
41607ca46eSDavid Howells 		unsigned error_feature		: 1;
42607ca46eSDavid Howells 		unsigned sector			: 1;
43607ca46eSDavid Howells 		unsigned nsector		: 1;
44607ca46eSDavid Howells 		unsigned lcyl			: 1;
45607ca46eSDavid Howells 		unsigned hcyl			: 1;
46607ca46eSDavid Howells 		unsigned select			: 1;
47607ca46eSDavid Howells 		unsigned status_command		: 1;
48607ca46eSDavid Howells 
49607ca46eSDavid Howells 		unsigned data_hob		: 1;
50607ca46eSDavid Howells 		unsigned error_feature_hob	: 1;
51607ca46eSDavid Howells 		unsigned sector_hob		: 1;
52607ca46eSDavid Howells 		unsigned nsector_hob		: 1;
53607ca46eSDavid Howells 		unsigned lcyl_hob		: 1;
54607ca46eSDavid Howells 		unsigned hcyl_hob		: 1;
55607ca46eSDavid Howells 		unsigned select_hob		: 1;
56607ca46eSDavid Howells 		unsigned control_hob		: 1;
57607ca46eSDavid Howells 	} b;
58607ca46eSDavid Howells } ide_reg_valid_t;
59607ca46eSDavid Howells 
60607ca46eSDavid Howells typedef struct ide_task_request_s {
61607ca46eSDavid Howells 	__u8		io_ports[8];
62607ca46eSDavid Howells 	__u8		hob_ports[8]; /* bytes 6 and 7 are unused */
63607ca46eSDavid Howells 	ide_reg_valid_t	out_flags;
64607ca46eSDavid Howells 	ide_reg_valid_t	in_flags;
65607ca46eSDavid Howells 	int		data_phase;
66607ca46eSDavid Howells 	int		req_cmd;
67607ca46eSDavid Howells 	unsigned long	out_size;
68607ca46eSDavid Howells 	unsigned long	in_size;
69607ca46eSDavid Howells } ide_task_request_t;
70607ca46eSDavid Howells 
71607ca46eSDavid Howells typedef struct ide_ioctl_request_s {
72607ca46eSDavid Howells 	ide_task_request_t	*task_request;
73607ca46eSDavid Howells 	unsigned char		*out_buffer;
74607ca46eSDavid Howells 	unsigned char		*in_buffer;
75607ca46eSDavid Howells } ide_ioctl_request_t;
76607ca46eSDavid Howells 
77607ca46eSDavid Howells struct hd_drive_cmd_hdr {
78607ca46eSDavid Howells 	__u8 command;
79607ca46eSDavid Howells 	__u8 sector_number;
80607ca46eSDavid Howells 	__u8 feature;
81607ca46eSDavid Howells 	__u8 sector_count;
82607ca46eSDavid Howells };
83607ca46eSDavid Howells 
84607ca46eSDavid Howells #ifndef __KERNEL__
85607ca46eSDavid Howells typedef struct hd_drive_task_hdr {
86607ca46eSDavid Howells 	__u8 data;
87607ca46eSDavid Howells 	__u8 feature;
88607ca46eSDavid Howells 	__u8 sector_count;
89607ca46eSDavid Howells 	__u8 sector_number;
90607ca46eSDavid Howells 	__u8 low_cylinder;
91607ca46eSDavid Howells 	__u8 high_cylinder;
92607ca46eSDavid Howells 	__u8 device_head;
93607ca46eSDavid Howells 	__u8 command;
94607ca46eSDavid Howells } task_struct_t;
95607ca46eSDavid Howells 
96607ca46eSDavid Howells typedef struct hd_drive_hob_hdr {
97607ca46eSDavid Howells 	__u8 data;
98607ca46eSDavid Howells 	__u8 feature;
99607ca46eSDavid Howells 	__u8 sector_count;
100607ca46eSDavid Howells 	__u8 sector_number;
101607ca46eSDavid Howells 	__u8 low_cylinder;
102607ca46eSDavid Howells 	__u8 high_cylinder;
103607ca46eSDavid Howells 	__u8 device_head;
104607ca46eSDavid Howells 	__u8 control;
105607ca46eSDavid Howells } hob_struct_t;
106607ca46eSDavid Howells #endif
107607ca46eSDavid Howells 
108607ca46eSDavid Howells #define TASKFILE_NO_DATA		0x0000
109607ca46eSDavid Howells 
110607ca46eSDavid Howells #define TASKFILE_IN			0x0001
111607ca46eSDavid Howells #define TASKFILE_MULTI_IN		0x0002
112607ca46eSDavid Howells 
113607ca46eSDavid Howells #define TASKFILE_OUT			0x0004
114607ca46eSDavid Howells #define TASKFILE_MULTI_OUT		0x0008
115607ca46eSDavid Howells #define TASKFILE_IN_OUT			0x0010
116607ca46eSDavid Howells 
117607ca46eSDavid Howells #define TASKFILE_IN_DMA			0x0020
118607ca46eSDavid Howells #define TASKFILE_OUT_DMA		0x0040
119607ca46eSDavid Howells #define TASKFILE_IN_DMAQ		0x0080
120607ca46eSDavid Howells #define TASKFILE_OUT_DMAQ		0x0100
121607ca46eSDavid Howells 
122607ca46eSDavid Howells #ifndef __KERNEL__
123607ca46eSDavid Howells #define TASKFILE_P_IN			0x0200
124607ca46eSDavid Howells #define TASKFILE_P_OUT			0x0400
125607ca46eSDavid Howells #define TASKFILE_P_IN_DMA		0x0800
126607ca46eSDavid Howells #define TASKFILE_P_OUT_DMA		0x1000
127607ca46eSDavid Howells #define TASKFILE_P_IN_DMAQ		0x2000
128607ca46eSDavid Howells #define TASKFILE_P_OUT_DMAQ		0x4000
129607ca46eSDavid Howells #define TASKFILE_48			0x8000
130607ca46eSDavid Howells #define TASKFILE_INVALID		0x7fff
131607ca46eSDavid Howells #endif
132607ca46eSDavid Howells 
133607ca46eSDavid Howells #ifndef __KERNEL__
134607ca46eSDavid Howells /* ATA/ATAPI Commands pre T13 Spec */
135607ca46eSDavid Howells #define WIN_NOP				0x00
136607ca46eSDavid Howells /*
137607ca46eSDavid Howells  *	0x01->0x02 Reserved
138607ca46eSDavid Howells  */
139607ca46eSDavid Howells #define CFA_REQ_EXT_ERROR_CODE		0x03 /* CFA Request Extended Error Code */
140607ca46eSDavid Howells /*
141607ca46eSDavid Howells  *	0x04->0x07 Reserved
142607ca46eSDavid Howells  */
143607ca46eSDavid Howells #define WIN_SRST			0x08 /* ATAPI soft reset command */
144607ca46eSDavid Howells #define WIN_DEVICE_RESET		0x08
145607ca46eSDavid Howells /*
146607ca46eSDavid Howells  *	0x09->0x0F Reserved
147607ca46eSDavid Howells  */
148607ca46eSDavid Howells #define WIN_RECAL			0x10
149607ca46eSDavid Howells #define WIN_RESTORE			WIN_RECAL
150607ca46eSDavid Howells /*
151607ca46eSDavid Howells  *	0x10->0x1F Reserved
152607ca46eSDavid Howells  */
153607ca46eSDavid Howells #define WIN_READ			0x20 /* 28-Bit */
154607ca46eSDavid Howells #define WIN_READ_ONCE			0x21 /* 28-Bit without retries */
155607ca46eSDavid Howells #define WIN_READ_LONG			0x22 /* 28-Bit */
156607ca46eSDavid Howells #define WIN_READ_LONG_ONCE		0x23 /* 28-Bit without retries */
157607ca46eSDavid Howells #define WIN_READ_EXT			0x24 /* 48-Bit */
158607ca46eSDavid Howells #define WIN_READDMA_EXT			0x25 /* 48-Bit */
159607ca46eSDavid Howells #define WIN_READDMA_QUEUED_EXT		0x26 /* 48-Bit */
160607ca46eSDavid Howells #define WIN_READ_NATIVE_MAX_EXT		0x27 /* 48-Bit */
161607ca46eSDavid Howells /*
162607ca46eSDavid Howells  *	0x28
163607ca46eSDavid Howells  */
164607ca46eSDavid Howells #define WIN_MULTREAD_EXT		0x29 /* 48-Bit */
165607ca46eSDavid Howells /*
166607ca46eSDavid Howells  *	0x2A->0x2F Reserved
167607ca46eSDavid Howells  */
168607ca46eSDavid Howells #define WIN_WRITE			0x30 /* 28-Bit */
169607ca46eSDavid Howells #define WIN_WRITE_ONCE			0x31 /* 28-Bit without retries */
170607ca46eSDavid Howells #define WIN_WRITE_LONG			0x32 /* 28-Bit */
171607ca46eSDavid Howells #define WIN_WRITE_LONG_ONCE		0x33 /* 28-Bit without retries */
172607ca46eSDavid Howells #define WIN_WRITE_EXT			0x34 /* 48-Bit */
173607ca46eSDavid Howells #define WIN_WRITEDMA_EXT		0x35 /* 48-Bit */
174607ca46eSDavid Howells #define WIN_WRITEDMA_QUEUED_EXT		0x36 /* 48-Bit */
175607ca46eSDavid Howells #define WIN_SET_MAX_EXT			0x37 /* 48-Bit */
176607ca46eSDavid Howells #define CFA_WRITE_SECT_WO_ERASE		0x38 /* CFA Write Sectors without erase */
177607ca46eSDavid Howells #define WIN_MULTWRITE_EXT		0x39 /* 48-Bit */
178607ca46eSDavid Howells /*
179607ca46eSDavid Howells  *	0x3A->0x3B Reserved
180607ca46eSDavid Howells  */
181607ca46eSDavid Howells #define WIN_WRITE_VERIFY		0x3C /* 28-Bit */
182607ca46eSDavid Howells /*
183607ca46eSDavid Howells  *	0x3D->0x3F Reserved
184607ca46eSDavid Howells  */
185607ca46eSDavid Howells #define WIN_VERIFY			0x40 /* 28-Bit - Read Verify Sectors */
186607ca46eSDavid Howells #define WIN_VERIFY_ONCE			0x41 /* 28-Bit - without retries */
187607ca46eSDavid Howells #define WIN_VERIFY_EXT			0x42 /* 48-Bit */
188607ca46eSDavid Howells /*
189607ca46eSDavid Howells  *	0x43->0x4F Reserved
190607ca46eSDavid Howells  */
191607ca46eSDavid Howells #define WIN_FORMAT			0x50
192607ca46eSDavid Howells /*
193607ca46eSDavid Howells  *	0x51->0x5F Reserved
194607ca46eSDavid Howells  */
195607ca46eSDavid Howells #define WIN_INIT			0x60
196607ca46eSDavid Howells /*
197607ca46eSDavid Howells  *	0x61->0x5F Reserved
198607ca46eSDavid Howells  */
199607ca46eSDavid Howells #define WIN_SEEK			0x70 /* 0x70-0x7F Reserved */
200607ca46eSDavid Howells 
201607ca46eSDavid Howells #define CFA_TRANSLATE_SECTOR		0x87 /* CFA Translate Sector */
202607ca46eSDavid Howells #define WIN_DIAGNOSE			0x90
203607ca46eSDavid Howells #define WIN_SPECIFY			0x91 /* set drive geometry translation */
204607ca46eSDavid Howells #define WIN_DOWNLOAD_MICROCODE		0x92
205607ca46eSDavid Howells #define WIN_STANDBYNOW2			0x94
206607ca46eSDavid Howells #define WIN_STANDBY2			0x96
207607ca46eSDavid Howells #define WIN_SETIDLE2			0x97
208607ca46eSDavid Howells #define WIN_CHECKPOWERMODE2		0x98
209607ca46eSDavid Howells #define WIN_SLEEPNOW2			0x99
210607ca46eSDavid Howells /*
211607ca46eSDavid Howells  *	0x9A VENDOR
212607ca46eSDavid Howells  */
213607ca46eSDavid Howells #define WIN_PACKETCMD			0xA0 /* Send a packet command. */
214607ca46eSDavid Howells #define WIN_PIDENTIFY			0xA1 /* identify ATAPI device	*/
215607ca46eSDavid Howells #define WIN_QUEUED_SERVICE		0xA2
216607ca46eSDavid Howells #define WIN_SMART			0xB0 /* self-monitoring and reporting */
217607ca46eSDavid Howells #define CFA_ERASE_SECTORS		0xC0
218607ca46eSDavid Howells #define WIN_MULTREAD			0xC4 /* read sectors using multiple mode*/
219607ca46eSDavid Howells #define WIN_MULTWRITE			0xC5 /* write sectors using multiple mode */
220607ca46eSDavid Howells #define WIN_SETMULT			0xC6 /* enable/disable multiple mode */
221607ca46eSDavid Howells #define WIN_READDMA_QUEUED		0xC7 /* read sectors using Queued DMA transfers */
222607ca46eSDavid Howells #define WIN_READDMA			0xC8 /* read sectors using DMA transfers */
223607ca46eSDavid Howells #define WIN_READDMA_ONCE		0xC9 /* 28-Bit - without retries */
224607ca46eSDavid Howells #define WIN_WRITEDMA			0xCA /* write sectors using DMA transfers */
225607ca46eSDavid Howells #define WIN_WRITEDMA_ONCE		0xCB /* 28-Bit - without retries */
226607ca46eSDavid Howells #define WIN_WRITEDMA_QUEUED		0xCC /* write sectors using Queued DMA transfers */
227607ca46eSDavid Howells #define CFA_WRITE_MULTI_WO_ERASE	0xCD /* CFA Write multiple without erase */
228607ca46eSDavid Howells #define WIN_GETMEDIASTATUS		0xDA
229607ca46eSDavid Howells #define WIN_ACKMEDIACHANGE		0xDB /* ATA-1, ATA-2 vendor */
230607ca46eSDavid Howells #define WIN_POSTBOOT			0xDC
231607ca46eSDavid Howells #define WIN_PREBOOT 			0xDD
232607ca46eSDavid Howells #define WIN_DOORLOCK			0xDE /* lock door on removable drives */
233607ca46eSDavid Howells #define WIN_DOORUNLOCK			0xDF /* unlock door on removable drives */
234607ca46eSDavid Howells #define WIN_STANDBYNOW1			0xE0
235607ca46eSDavid Howells #define WIN_IDLEIMMEDIATE		0xE1 /* force drive to become "ready" */
236607ca46eSDavid Howells #define WIN_STANDBY			0xE2 /* Set device in Standby Mode */
237607ca46eSDavid Howells #define WIN_SETIDLE1			0xE3
238607ca46eSDavid Howells #define WIN_READ_BUFFER			0xE4 /* force read only 1 sector */
239607ca46eSDavid Howells #define WIN_CHECKPOWERMODE1		0xE5
240607ca46eSDavid Howells #define WIN_SLEEPNOW1			0xE6
241607ca46eSDavid Howells #define WIN_FLUSH_CACHE			0xE7
242607ca46eSDavid Howells #define WIN_WRITE_BUFFER		0xE8 /* force write only 1 sector */
243607ca46eSDavid Howells #define WIN_WRITE_SAME			0xE9 /* read ata-2 to use */
244607ca46eSDavid Howells 	/* SET_FEATURES 0x22 or 0xDD */
245607ca46eSDavid Howells #define WIN_FLUSH_CACHE_EXT		0xEA /* 48-Bit */
246607ca46eSDavid Howells #define WIN_IDENTIFY			0xEC /* ask drive to identify itself	*/
247607ca46eSDavid Howells #define WIN_MEDIAEJECT			0xED
248607ca46eSDavid Howells #define WIN_IDENTIFY_DMA		0xEE /* same as WIN_IDENTIFY, but DMA */
249607ca46eSDavid Howells #define WIN_SETFEATURES			0xEF /* set special drive features */
250607ca46eSDavid Howells #define EXABYTE_ENABLE_NEST		0xF0
251607ca46eSDavid Howells #define WIN_SECURITY_SET_PASS		0xF1
252607ca46eSDavid Howells #define WIN_SECURITY_UNLOCK		0xF2
253607ca46eSDavid Howells #define WIN_SECURITY_ERASE_PREPARE	0xF3
254607ca46eSDavid Howells #define WIN_SECURITY_ERASE_UNIT		0xF4
255607ca46eSDavid Howells #define WIN_SECURITY_FREEZE_LOCK	0xF5
256607ca46eSDavid Howells #define WIN_SECURITY_DISABLE		0xF6
257607ca46eSDavid Howells #define WIN_READ_NATIVE_MAX		0xF8 /* return the native maximum address */
258607ca46eSDavid Howells #define WIN_SET_MAX			0xF9
259607ca46eSDavid Howells #define DISABLE_SEAGATE			0xFB
260607ca46eSDavid Howells 
261607ca46eSDavid Howells /* WIN_SMART sub-commands */
262607ca46eSDavid Howells 
263607ca46eSDavid Howells #define SMART_READ_VALUES		0xD0
264607ca46eSDavid Howells #define SMART_READ_THRESHOLDS		0xD1
265607ca46eSDavid Howells #define SMART_AUTOSAVE			0xD2
266607ca46eSDavid Howells #define SMART_SAVE			0xD3
267607ca46eSDavid Howells #define SMART_IMMEDIATE_OFFLINE		0xD4
268607ca46eSDavid Howells #define SMART_READ_LOG_SECTOR		0xD5
269607ca46eSDavid Howells #define SMART_WRITE_LOG_SECTOR		0xD6
270607ca46eSDavid Howells #define SMART_WRITE_THRESHOLDS		0xD7
271607ca46eSDavid Howells #define SMART_ENABLE			0xD8
272607ca46eSDavid Howells #define SMART_DISABLE			0xD9
273607ca46eSDavid Howells #define SMART_STATUS			0xDA
274607ca46eSDavid Howells #define SMART_AUTO_OFFLINE		0xDB
275607ca46eSDavid Howells 
276607ca46eSDavid Howells /* Password used in TF4 & TF5 executing SMART commands */
277607ca46eSDavid Howells 
278607ca46eSDavid Howells #define SMART_LCYL_PASS			0x4F
279607ca46eSDavid Howells #define SMART_HCYL_PASS			0xC2
280607ca46eSDavid Howells 
281607ca46eSDavid Howells /* WIN_SETFEATURES sub-commands */
282607ca46eSDavid Howells #define SETFEATURES_EN_8BIT	0x01	/* Enable 8-Bit Transfers */
283607ca46eSDavid Howells #define SETFEATURES_EN_WCACHE	0x02	/* Enable write cache */
284607ca46eSDavid Howells #define SETFEATURES_DIS_DEFECT	0x04	/* Disable Defect Management */
285607ca46eSDavid Howells #define SETFEATURES_EN_APM	0x05	/* Enable advanced power management */
286607ca46eSDavid Howells #define SETFEATURES_EN_SAME_R	0x22	/* for a region ATA-1 */
287607ca46eSDavid Howells #define SETFEATURES_DIS_MSN	0x31	/* Disable Media Status Notification */
288607ca46eSDavid Howells #define SETFEATURES_DIS_RETRY	0x33	/* Disable Retry */
289607ca46eSDavid Howells #define SETFEATURES_EN_AAM	0x42	/* Enable Automatic Acoustic Management */
290607ca46eSDavid Howells #define SETFEATURES_RW_LONG	0x44	/* Set Length of VS bytes */
291607ca46eSDavid Howells #define SETFEATURES_SET_CACHE	0x54	/* Set Cache segments to SC Reg. Val */
292607ca46eSDavid Howells #define SETFEATURES_DIS_RLA	0x55	/* Disable read look-ahead feature */
293607ca46eSDavid Howells #define SETFEATURES_EN_RI	0x5D	/* Enable release interrupt */
294607ca46eSDavid Howells #define SETFEATURES_EN_SI	0x5E	/* Enable SERVICE interrupt */
295607ca46eSDavid Howells #define SETFEATURES_DIS_RPOD	0x66	/* Disable reverting to power on defaults */
296607ca46eSDavid Howells #define SETFEATURES_DIS_ECC	0x77	/* Disable ECC byte count */
297607ca46eSDavid Howells #define SETFEATURES_DIS_8BIT	0x81	/* Disable 8-Bit Transfers */
298607ca46eSDavid Howells #define SETFEATURES_DIS_WCACHE	0x82	/* Disable write cache */
299607ca46eSDavid Howells #define SETFEATURES_EN_DEFECT	0x84	/* Enable Defect Management */
300607ca46eSDavid Howells #define SETFEATURES_DIS_APM	0x85	/* Disable advanced power management */
301607ca46eSDavid Howells #define SETFEATURES_EN_ECC	0x88	/* Enable ECC byte count */
302607ca46eSDavid Howells #define SETFEATURES_EN_MSN	0x95	/* Enable Media Status Notification */
303607ca46eSDavid Howells #define SETFEATURES_EN_RETRY	0x99	/* Enable Retry */
304607ca46eSDavid Howells #define SETFEATURES_EN_RLA	0xAA	/* Enable read look-ahead feature */
305607ca46eSDavid Howells #define SETFEATURES_PREFETCH	0xAB	/* Sets drive prefetch value */
306607ca46eSDavid Howells #define SETFEATURES_EN_REST	0xAC	/* ATA-1 */
307607ca46eSDavid Howells #define SETFEATURES_4B_RW_LONG	0xBB	/* Set Length of 4 bytes */
308607ca46eSDavid Howells #define SETFEATURES_DIS_AAM	0xC2	/* Disable Automatic Acoustic Management */
309607ca46eSDavid Howells #define SETFEATURES_EN_RPOD	0xCC	/* Enable reverting to power on defaults */
310607ca46eSDavid Howells #define SETFEATURES_DIS_RI	0xDD	/* Disable release interrupt ATAPI */
311607ca46eSDavid Howells #define SETFEATURES_EN_SAME_M	0xDD	/* for a entire device ATA-1 */
312607ca46eSDavid Howells #define SETFEATURES_DIS_SI	0xDE	/* Disable SERVICE interrupt ATAPI */
313607ca46eSDavid Howells 
314607ca46eSDavid Howells /* WIN_SECURITY sub-commands */
315607ca46eSDavid Howells 
316607ca46eSDavid Howells #define SECURITY_SET_PASSWORD		0xBA
317607ca46eSDavid Howells #define SECURITY_UNLOCK			0xBB
318607ca46eSDavid Howells #define SECURITY_ERASE_PREPARE		0xBC
319607ca46eSDavid Howells #define SECURITY_ERASE_UNIT		0xBD
320607ca46eSDavid Howells #define SECURITY_FREEZE_LOCK		0xBE
321607ca46eSDavid Howells #define SECURITY_DISABLE_PASSWORD	0xBF
322607ca46eSDavid Howells #endif /* __KERNEL__ */
323607ca46eSDavid Howells 
324607ca46eSDavid Howells struct hd_geometry {
325607ca46eSDavid Howells       unsigned char heads;
326607ca46eSDavid Howells       unsigned char sectors;
327607ca46eSDavid Howells       unsigned short cylinders;
328607ca46eSDavid Howells       unsigned long start;
329607ca46eSDavid Howells };
330607ca46eSDavid Howells 
331607ca46eSDavid Howells /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
332607ca46eSDavid Howells #define HDIO_GETGEO		0x0301	/* get device geometry */
333607ca46eSDavid Howells #define HDIO_GET_UNMASKINTR	0x0302	/* get current unmask setting */
334607ca46eSDavid Howells #define HDIO_GET_MULTCOUNT	0x0304	/* get current IDE blockmode setting */
335607ca46eSDavid Howells #define HDIO_GET_QDMA		0x0305	/* get use-qdma flag */
336607ca46eSDavid Howells 
337607ca46eSDavid Howells #define HDIO_SET_XFER		0x0306  /* set transfer rate via proc */
338607ca46eSDavid Howells 
339607ca46eSDavid Howells #define HDIO_OBSOLETE_IDENTITY	0x0307	/* OBSOLETE, DO NOT USE: returns 142 bytes */
340607ca46eSDavid Howells #define HDIO_GET_KEEPSETTINGS	0x0308	/* get keep-settings-on-reset flag */
341607ca46eSDavid Howells #define HDIO_GET_32BIT		0x0309	/* get current io_32bit setting */
342607ca46eSDavid Howells #define HDIO_GET_NOWERR		0x030a	/* get ignore-write-error flag */
343607ca46eSDavid Howells #define HDIO_GET_DMA		0x030b	/* get use-dma flag */
344607ca46eSDavid Howells #define HDIO_GET_NICE		0x030c	/* get nice flags */
345607ca46eSDavid Howells #define HDIO_GET_IDENTITY	0x030d	/* get IDE identification info */
346607ca46eSDavid Howells #define HDIO_GET_WCACHE		0x030e	/* get write cache mode on|off */
347607ca46eSDavid Howells #define HDIO_GET_ACOUSTIC	0x030f	/* get acoustic value */
348607ca46eSDavid Howells #define	HDIO_GET_ADDRESS	0x0310	/* */
349607ca46eSDavid Howells 
350607ca46eSDavid Howells #define HDIO_GET_BUSSTATE	0x031a	/* get the bus state of the hwif */
351607ca46eSDavid Howells #define HDIO_TRISTATE_HWIF	0x031b	/* execute a channel tristate */
352607ca46eSDavid Howells #define HDIO_DRIVE_RESET	0x031c	/* execute a device reset */
353607ca46eSDavid Howells #define HDIO_DRIVE_TASKFILE	0x031d	/* execute raw taskfile */
354607ca46eSDavid Howells #define HDIO_DRIVE_TASK		0x031e	/* execute task and special drive command */
355607ca46eSDavid Howells #define HDIO_DRIVE_CMD		0x031f	/* execute a special drive command */
356607ca46eSDavid Howells #define HDIO_DRIVE_CMD_AEB	HDIO_DRIVE_TASK
357607ca46eSDavid Howells 
358607ca46eSDavid Howells /* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
359607ca46eSDavid Howells #define HDIO_SET_MULTCOUNT	0x0321	/* change IDE blockmode */
360607ca46eSDavid Howells #define HDIO_SET_UNMASKINTR	0x0322	/* permit other irqs during I/O */
361607ca46eSDavid Howells #define HDIO_SET_KEEPSETTINGS	0x0323	/* keep ioctl settings on reset */
362607ca46eSDavid Howells #define HDIO_SET_32BIT		0x0324	/* change io_32bit flags */
363607ca46eSDavid Howells #define HDIO_SET_NOWERR		0x0325	/* change ignore-write-error flag */
364607ca46eSDavid Howells #define HDIO_SET_DMA		0x0326	/* change use-dma flag */
365607ca46eSDavid Howells #define HDIO_SET_PIO_MODE	0x0327	/* reconfig interface to new speed */
366607ca46eSDavid Howells #ifndef __KERNEL__
367607ca46eSDavid Howells #define HDIO_SCAN_HWIF		0x0328	/* register and (re)scan interface */
368607ca46eSDavid Howells #define HDIO_UNREGISTER_HWIF	0x032a  /* unregister interface */
369607ca46eSDavid Howells #endif
370607ca46eSDavid Howells #define HDIO_SET_NICE		0x0329	/* set nice flags */
371607ca46eSDavid Howells #define HDIO_SET_WCACHE		0x032b	/* change write cache enable-disable */
372607ca46eSDavid Howells #define HDIO_SET_ACOUSTIC	0x032c	/* change acoustic behavior */
373607ca46eSDavid Howells #define HDIO_SET_BUSSTATE	0x032d	/* set the bus state of the hwif */
374607ca46eSDavid Howells #define HDIO_SET_QDMA		0x032e	/* change use-qdma flag */
375607ca46eSDavid Howells #define HDIO_SET_ADDRESS	0x032f	/* change lba addressing modes */
376607ca46eSDavid Howells 
377607ca46eSDavid Howells /* bus states */
378607ca46eSDavid Howells enum {
379607ca46eSDavid Howells 	BUSSTATE_OFF = 0,
380607ca46eSDavid Howells 	BUSSTATE_ON,
381607ca46eSDavid Howells 	BUSSTATE_TRISTATE
382607ca46eSDavid Howells };
383607ca46eSDavid Howells 
384607ca46eSDavid Howells /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
385607ca46eSDavid Howells /* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
386607ca46eSDavid Howells /* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */
387607ca46eSDavid Howells /* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */
388607ca46eSDavid Howells /* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */
389607ca46eSDavid Howells 
390607ca46eSDavid Howells #define __NEW_HD_DRIVE_ID
391607ca46eSDavid Howells 
392607ca46eSDavid Howells #ifndef __KERNEL__
393607ca46eSDavid Howells /*
394607ca46eSDavid Howells  * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
395607ca46eSDavid Howells  *
396607ca46eSDavid Howells  * If you change something here, please remember to update fix_driveid() in
397607ca46eSDavid Howells  * ide/probe.c.
398607ca46eSDavid Howells  */
399607ca46eSDavid Howells struct hd_driveid {
400607ca46eSDavid Howells 	unsigned short	config;		/* lots of obsolete bit flags */
401607ca46eSDavid Howells 	unsigned short	cyls;		/* Obsolete, "physical" cyls */
402607ca46eSDavid Howells 	unsigned short	reserved2;	/* reserved (word 2) */
403607ca46eSDavid Howells 	unsigned short	heads;		/* Obsolete, "physical" heads */
404607ca46eSDavid Howells 	unsigned short	track_bytes;	/* unformatted bytes per track */
405607ca46eSDavid Howells 	unsigned short	sector_bytes;	/* unformatted bytes per sector */
406607ca46eSDavid Howells 	unsigned short	sectors;	/* Obsolete, "physical" sectors per track */
407607ca46eSDavid Howells 	unsigned short	vendor0;	/* vendor unique */
408607ca46eSDavid Howells 	unsigned short	vendor1;	/* vendor unique */
409607ca46eSDavid Howells 	unsigned short	vendor2;	/* Retired vendor unique */
410607ca46eSDavid Howells 	unsigned char	serial_no[20];	/* 0 = not_specified */
411607ca46eSDavid Howells 	unsigned short	buf_type;	/* Retired */
412607ca46eSDavid Howells 	unsigned short	buf_size;	/* Retired, 512 byte increments
413607ca46eSDavid Howells 					 * 0 = not_specified
414607ca46eSDavid Howells 					 */
415607ca46eSDavid Howells 	unsigned short	ecc_bytes;	/* for r/w long cmds; 0 = not_specified */
416607ca46eSDavid Howells 	unsigned char	fw_rev[8];	/* 0 = not_specified */
417607ca46eSDavid Howells 	unsigned char	model[40];	/* 0 = not_specified */
418607ca46eSDavid Howells 	unsigned char	max_multsect;	/* 0=not_implemented */
419607ca46eSDavid Howells 	unsigned char	vendor3;	/* vendor unique */
420607ca46eSDavid Howells 	unsigned short	dword_io;	/* 0=not_implemented; 1=implemented */
421607ca46eSDavid Howells 	unsigned char	vendor4;	/* vendor unique */
422607ca46eSDavid Howells 	unsigned char	capability;	/* (upper byte of word 49)
423607ca46eSDavid Howells 					 *  3:	IORDYsup
424607ca46eSDavid Howells 					 *  2:	IORDYsw
425607ca46eSDavid Howells 					 *  1:	LBA
426607ca46eSDavid Howells 					 *  0:	DMA
427607ca46eSDavid Howells 					 */
428607ca46eSDavid Howells 	unsigned short	reserved50;	/* reserved (word 50) */
429607ca46eSDavid Howells 	unsigned char	vendor5;	/* Obsolete, vendor unique */
430607ca46eSDavid Howells 	unsigned char	tPIO;		/* Obsolete, 0=slow, 1=medium, 2=fast */
431607ca46eSDavid Howells 	unsigned char	vendor6;	/* Obsolete, vendor unique */
432607ca46eSDavid Howells 	unsigned char	tDMA;		/* Obsolete, 0=slow, 1=medium, 2=fast */
433607ca46eSDavid Howells 	unsigned short	field_valid;	/* (word 53)
434607ca46eSDavid Howells 					 *  2:	ultra_ok	word  88
435607ca46eSDavid Howells 					 *  1:	eide_ok		words 64-70
436607ca46eSDavid Howells 					 *  0:	cur_ok		words 54-58
437607ca46eSDavid Howells 					 */
438607ca46eSDavid Howells 	unsigned short	cur_cyls;	/* Obsolete, logical cylinders */
439607ca46eSDavid Howells 	unsigned short	cur_heads;	/* Obsolete, l heads */
440607ca46eSDavid Howells 	unsigned short	cur_sectors;	/* Obsolete, l sectors per track */
441607ca46eSDavid Howells 	unsigned short	cur_capacity0;	/* Obsolete, l total sectors on drive */
442607ca46eSDavid Howells 	unsigned short	cur_capacity1;	/* Obsolete, (2 words, misaligned int)     */
443607ca46eSDavid Howells 	unsigned char	multsect;	/* current multiple sector count */
444607ca46eSDavid Howells 	unsigned char	multsect_valid;	/* when (bit0==1) multsect is ok */
445607ca46eSDavid Howells 	unsigned int	lba_capacity;	/* Obsolete, total number of sectors */
446607ca46eSDavid Howells 	unsigned short	dma_1word;	/* Obsolete, single-word dma info */
447607ca46eSDavid Howells 	unsigned short	dma_mword;	/* multiple-word dma info */
448607ca46eSDavid Howells 	unsigned short  eide_pio_modes; /* bits 0:mode3 1:mode4 */
449607ca46eSDavid Howells 	unsigned short  eide_dma_min;	/* min mword dma cycle time (ns) */
450607ca46eSDavid Howells 	unsigned short  eide_dma_time;	/* recommended mword dma cycle time (ns) */
451607ca46eSDavid Howells 	unsigned short  eide_pio;       /* min cycle time (ns), no IORDY  */
452607ca46eSDavid Howells 	unsigned short  eide_pio_iordy; /* min cycle time (ns), with IORDY */
453607ca46eSDavid Howells 	unsigned short	words69_70[2];	/* reserved words 69-70
454607ca46eSDavid Howells 					 * future command overlap and queuing
455607ca46eSDavid Howells 					 */
456607ca46eSDavid Howells 	unsigned short	words71_74[4];	/* reserved words 71-74
457607ca46eSDavid Howells 					 * for IDENTIFY PACKET DEVICE command
458607ca46eSDavid Howells 					 */
459607ca46eSDavid Howells 	unsigned short  queue_depth;	/* (word 75)
460607ca46eSDavid Howells 					 * 15:5	reserved
461607ca46eSDavid Howells 					 *  4:0	Maximum queue depth -1
462607ca46eSDavid Howells 					 */
463607ca46eSDavid Howells 	unsigned short  words76_79[4];	/* reserved words 76-79 */
464607ca46eSDavid Howells 	unsigned short  major_rev_num;	/* (word 80) */
465607ca46eSDavid Howells 	unsigned short  minor_rev_num;	/* (word 81) */
466607ca46eSDavid Howells 	unsigned short  command_set_1;	/* (word 82) supported
467607ca46eSDavid Howells 					 * 15:	Obsolete
468607ca46eSDavid Howells 					 * 14:	NOP command
469607ca46eSDavid Howells 					 * 13:	READ_BUFFER
470607ca46eSDavid Howells 					 * 12:	WRITE_BUFFER
471607ca46eSDavid Howells 					 * 11:	Obsolete
472607ca46eSDavid Howells 					 * 10:	Host Protected Area
473607ca46eSDavid Howells 					 *  9:	DEVICE Reset
474607ca46eSDavid Howells 					 *  8:	SERVICE Interrupt
475607ca46eSDavid Howells 					 *  7:	Release Interrupt
476607ca46eSDavid Howells 					 *  6:	look-ahead
477607ca46eSDavid Howells 					 *  5:	write cache
478607ca46eSDavid Howells 					 *  4:	PACKET Command
479607ca46eSDavid Howells 					 *  3:	Power Management Feature Set
480607ca46eSDavid Howells 					 *  2:	Removable Feature Set
481607ca46eSDavid Howells 					 *  1:	Security Feature Set
482607ca46eSDavid Howells 					 *  0:	SMART Feature Set
483607ca46eSDavid Howells 					 */
484607ca46eSDavid Howells 	unsigned short  command_set_2;	/* (word 83)
485607ca46eSDavid Howells 					 * 15:	Shall be ZERO
486607ca46eSDavid Howells 					 * 14:	Shall be ONE
487607ca46eSDavid Howells 					 * 13:	FLUSH CACHE EXT
488607ca46eSDavid Howells 					 * 12:	FLUSH CACHE
489607ca46eSDavid Howells 					 * 11:	Device Configuration Overlay
490607ca46eSDavid Howells 					 * 10:	48-bit Address Feature Set
491607ca46eSDavid Howells 					 *  9:	Automatic Acoustic Management
492607ca46eSDavid Howells 					 *  8:	SET MAX security
493607ca46eSDavid Howells 					 *  7:	reserved 1407DT PARTIES
494607ca46eSDavid Howells 					 *  6:	SetF sub-command Power-Up
495607ca46eSDavid Howells 					 *  5:	Power-Up in Standby Feature Set
496607ca46eSDavid Howells 					 *  4:	Removable Media Notification
497607ca46eSDavid Howells 					 *  3:	APM Feature Set
498607ca46eSDavid Howells 					 *  2:	CFA Feature Set
499607ca46eSDavid Howells 					 *  1:	READ/WRITE DMA QUEUED
500607ca46eSDavid Howells 					 *  0:	Download MicroCode
501607ca46eSDavid Howells 					 */
502607ca46eSDavid Howells 	unsigned short  cfsse;		/* (word 84)
503607ca46eSDavid Howells 					 * cmd set-feature supported extensions
504607ca46eSDavid Howells 					 * 15:	Shall be ZERO
505607ca46eSDavid Howells 					 * 14:	Shall be ONE
506607ca46eSDavid Howells 					 * 13:6	reserved
507607ca46eSDavid Howells 					 *  5:	General Purpose Logging
508607ca46eSDavid Howells 					 *  4:	Streaming Feature Set
509607ca46eSDavid Howells 					 *  3:	Media Card Pass Through
510607ca46eSDavid Howells 					 *  2:	Media Serial Number Valid
511607ca46eSDavid Howells 					 *  1:	SMART selt-test supported
512607ca46eSDavid Howells 					 *  0:	SMART error logging
513607ca46eSDavid Howells 					 */
514607ca46eSDavid Howells 	unsigned short  cfs_enable_1;	/* (word 85)
515607ca46eSDavid Howells 					 * command set-feature enabled
516607ca46eSDavid Howells 					 * 15:	Obsolete
517607ca46eSDavid Howells 					 * 14:	NOP command
518607ca46eSDavid Howells 					 * 13:	READ_BUFFER
519607ca46eSDavid Howells 					 * 12:	WRITE_BUFFER
520607ca46eSDavid Howells 					 * 11:	Obsolete
521607ca46eSDavid Howells 					 * 10:	Host Protected Area
522607ca46eSDavid Howells 					 *  9:	DEVICE Reset
523607ca46eSDavid Howells 					 *  8:	SERVICE Interrupt
524607ca46eSDavid Howells 					 *  7:	Release Interrupt
525607ca46eSDavid Howells 					 *  6:	look-ahead
526607ca46eSDavid Howells 					 *  5:	write cache
527607ca46eSDavid Howells 					 *  4:	PACKET Command
528607ca46eSDavid Howells 					 *  3:	Power Management Feature Set
529607ca46eSDavid Howells 					 *  2:	Removable Feature Set
530607ca46eSDavid Howells 					 *  1:	Security Feature Set
531607ca46eSDavid Howells 					 *  0:	SMART Feature Set
532607ca46eSDavid Howells 					 */
533607ca46eSDavid Howells 	unsigned short  cfs_enable_2;	/* (word 86)
534607ca46eSDavid Howells 					 * command set-feature enabled
535607ca46eSDavid Howells 					 * 15:	Shall be ZERO
536607ca46eSDavid Howells 					 * 14:	Shall be ONE
537607ca46eSDavid Howells 					 * 13:	FLUSH CACHE EXT
538607ca46eSDavid Howells 					 * 12:	FLUSH CACHE
539607ca46eSDavid Howells 					 * 11:	Device Configuration Overlay
540607ca46eSDavid Howells 					 * 10:	48-bit Address Feature Set
541607ca46eSDavid Howells 					 *  9:	Automatic Acoustic Management
542607ca46eSDavid Howells 					 *  8:	SET MAX security
543607ca46eSDavid Howells 					 *  7:	reserved 1407DT PARTIES
544607ca46eSDavid Howells 					 *  6:	SetF sub-command Power-Up
545607ca46eSDavid Howells 					 *  5:	Power-Up in Standby Feature Set
546607ca46eSDavid Howells 					 *  4:	Removable Media Notification
547607ca46eSDavid Howells 					 *  3:	APM Feature Set
548607ca46eSDavid Howells 					 *  2:	CFA Feature Set
549607ca46eSDavid Howells 					 *  1:	READ/WRITE DMA QUEUED
550607ca46eSDavid Howells 					 *  0:	Download MicroCode
551607ca46eSDavid Howells 					 */
552607ca46eSDavid Howells 	unsigned short  csf_default;	/* (word 87)
553607ca46eSDavid Howells 					 * command set-feature default
554607ca46eSDavid Howells 					 * 15:	Shall be ZERO
555607ca46eSDavid Howells 					 * 14:	Shall be ONE
556607ca46eSDavid Howells 					 * 13:6	reserved
557607ca46eSDavid Howells 					 *  5:	General Purpose Logging enabled
558607ca46eSDavid Howells 					 *  4:	Valid CONFIGURE STREAM executed
559607ca46eSDavid Howells 					 *  3:	Media Card Pass Through enabled
560607ca46eSDavid Howells 					 *  2:	Media Serial Number Valid
561607ca46eSDavid Howells 					 *  1:	SMART selt-test supported
562607ca46eSDavid Howells 					 *  0:	SMART error logging
563607ca46eSDavid Howells 					 */
564607ca46eSDavid Howells 	unsigned short  dma_ultra;	/* (word 88) */
565607ca46eSDavid Howells 	unsigned short	trseuc;		/* time required for security erase */
566607ca46eSDavid Howells 	unsigned short	trsEuc;		/* time required for enhanced erase */
567607ca46eSDavid Howells 	unsigned short	CurAPMvalues;	/* current APM values */
568607ca46eSDavid Howells 	unsigned short	mprc;		/* master password revision code */
569607ca46eSDavid Howells 	unsigned short	hw_config;	/* hardware config (word 93)
570607ca46eSDavid Howells 					 * 15:	Shall be ZERO
571607ca46eSDavid Howells 					 * 14:	Shall be ONE
572607ca46eSDavid Howells 					 * 13:
573607ca46eSDavid Howells 					 * 12:
574607ca46eSDavid Howells 					 * 11:
575607ca46eSDavid Howells 					 * 10:
576607ca46eSDavid Howells 					 *  9:
577607ca46eSDavid Howells 					 *  8:
578607ca46eSDavid Howells 					 *  7:
579607ca46eSDavid Howells 					 *  6:
580607ca46eSDavid Howells 					 *  5:
581607ca46eSDavid Howells 					 *  4:
582607ca46eSDavid Howells 					 *  3:
583607ca46eSDavid Howells 					 *  2:
584607ca46eSDavid Howells 					 *  1:
585607ca46eSDavid Howells 					 *  0:	Shall be ONE
586607ca46eSDavid Howells 					 */
587607ca46eSDavid Howells 	unsigned short	acoustic;	/* (word 94)
588607ca46eSDavid Howells 					 * 15:8	Vendor's recommended value
589607ca46eSDavid Howells 					 *  7:0	current value
590607ca46eSDavid Howells 					 */
591607ca46eSDavid Howells 	unsigned short	msrqs;		/* min stream request size */
592607ca46eSDavid Howells 	unsigned short	sxfert;		/* stream transfer time */
593607ca46eSDavid Howells 	unsigned short	sal;		/* stream access latency */
594607ca46eSDavid Howells 	unsigned int	spg;		/* stream performance granularity */
595607ca46eSDavid Howells 	unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
596607ca46eSDavid Howells 	unsigned short	words104_125[22];/* reserved words 104-125 */
597607ca46eSDavid Howells 	unsigned short	last_lun;	/* (word 126) */
598607ca46eSDavid Howells 	unsigned short	word127;	/* (word 127) Feature Set
599607ca46eSDavid Howells 					 * Removable Media Notification
600607ca46eSDavid Howells 					 * 15:2	reserved
601607ca46eSDavid Howells 					 *  1:0	00 = not supported
602607ca46eSDavid Howells 					 *	01 = supported
603607ca46eSDavid Howells 					 *	10 = reserved
604607ca46eSDavid Howells 					 *	11 = reserved
605607ca46eSDavid Howells 					 */
606607ca46eSDavid Howells 	unsigned short	dlf;		/* (word 128)
607607ca46eSDavid Howells 					 * device lock function
608607ca46eSDavid Howells 					 * 15:9	reserved
609607ca46eSDavid Howells 					 *  8	security level 1:max 0:high
610607ca46eSDavid Howells 					 *  7:6	reserved
611607ca46eSDavid Howells 					 *  5	enhanced erase
612607ca46eSDavid Howells 					 *  4	expire
613607ca46eSDavid Howells 					 *  3	frozen
614607ca46eSDavid Howells 					 *  2	locked
615607ca46eSDavid Howells 					 *  1	en/disabled
616607ca46eSDavid Howells 					 *  0	capability
617607ca46eSDavid Howells 					 */
618607ca46eSDavid Howells 	unsigned short  csfo;		/*  (word 129)
619607ca46eSDavid Howells 					 * current set features options
620607ca46eSDavid Howells 					 * 15:4	reserved
621607ca46eSDavid Howells 					 *  3:	auto reassign
622607ca46eSDavid Howells 					 *  2:	reverting
623607ca46eSDavid Howells 					 *  1:	read-look-ahead
624607ca46eSDavid Howells 					 *  0:	write cache
625607ca46eSDavid Howells 					 */
626607ca46eSDavid Howells 	unsigned short	words130_155[26];/* reserved vendor words 130-155 */
627607ca46eSDavid Howells 	unsigned short	word156;	/* reserved vendor word 156 */
628607ca46eSDavid Howells 	unsigned short	words157_159[3];/* reserved vendor words 157-159 */
629607ca46eSDavid Howells 	unsigned short	cfa_power;	/* (word 160) CFA Power Mode
630607ca46eSDavid Howells 					 * 15 word 160 supported
631607ca46eSDavid Howells 					 * 14 reserved
632607ca46eSDavid Howells 					 * 13
633607ca46eSDavid Howells 					 * 12
634607ca46eSDavid Howells 					 * 11:0
635607ca46eSDavid Howells 					 */
636607ca46eSDavid Howells 	unsigned short	words161_175[15];/* Reserved for CFA */
637607ca46eSDavid Howells 	unsigned short	words176_205[30];/* Current Media Serial Number */
638607ca46eSDavid Howells 	unsigned short	words206_254[49];/* reserved words 206-254 */
639607ca46eSDavid Howells 	unsigned short	integrity_word;	/* (word 255)
640607ca46eSDavid Howells 					 * 15:8 Checksum
641607ca46eSDavid Howells 					 *  7:0 Signature
642607ca46eSDavid Howells 					 */
643607ca46eSDavid Howells };
644607ca46eSDavid Howells #endif /* __KERNEL__ */
645607ca46eSDavid Howells 
646607ca46eSDavid Howells /*
647607ca46eSDavid Howells  * IDE "nice" flags. These are used on a per drive basis to determine
648607ca46eSDavid Howells  * when to be nice and give more bandwidth to the other devices which
649607ca46eSDavid Howells  * share the same IDE bus.
650607ca46eSDavid Howells  */
651607ca46eSDavid Howells #define IDE_NICE_DSC_OVERLAP	(0)	/* per the DSC overlap protocol */
652607ca46eSDavid Howells #define IDE_NICE_ATAPI_OVERLAP	(1)	/* not supported yet */
653607ca46eSDavid Howells #define IDE_NICE_1		(3)	/* when probably won't affect us much */
654607ca46eSDavid Howells #ifndef __KERNEL__
655607ca46eSDavid Howells #define IDE_NICE_0		(2)	/* when sure that it won't affect us */
656607ca46eSDavid Howells #define IDE_NICE_2		(4)	/* when we know it's on our expense */
657607ca46eSDavid Howells #endif
658607ca46eSDavid Howells 
659607ca46eSDavid Howells #endif	/* _LINUX_HDREG_H */
660