xref: /illumos-gate/usr/src/uts/intel/io/dktp/controller/ata/ata_cmd.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _ATA_CMD_H
28 #define	_ATA_CMD_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * Common ATA commands.
36  */
37 #define	ATC_DIAG	0x90    /* diagnose command 			*/
38 #define	ATC_RECAL	0x10	/* restore cmd, bottom 4 bits step rate */
39 #define	ATC_FORMAT	0x50	/* format track command 		*/
40 #define	ATC_SET_FEAT	0xef	/* set features				*/
41 #define	ATC_IDLE_IMMED	0xe1	/* idle immediate			*/
42 #define	ATC_STANDBY_IM	0xe0	/* standby immediate			*/
43 #define	ATC_DOOR_LOCK	0xde	/* door lock				*/
44 #define	ATC_DOOR_UNLOCK	0xdf	/* door unlock				*/
45 #define	ATC_IDLE	0xe3	/* idle					*/
46 #define	ATC_SLEEP	0xe6	/* sleep				*/
47 
48 /*
49  * ATA/ATAPI-4 disk commands.
50  */
51 #define	ATC_DEVICE_RESET	0x08    /* ATAPI device reset */
52 #define	ATC_EJECT		0xed	/* media eject */
53 #define	ATC_FLUSH_CACHE		0xe7	/* flush write-cache */
54 #define	ATC_ID_DEVICE		0xec    /* IDENTIFY DEVICE */
55 #define	ATC_ID_PACKET_DEVICE	0xa1	/* ATAPI identify packet device */
56 #define	ATC_INIT_DEVPARMS	0x91	/* initialize device parameters */
57 #define	ATC_PACKET		0xa0	/* ATAPI packet */
58 #define	ATC_RDMULT		0xc4	/* read multiple */
59 #define	ATC_RDSEC		0x20    /* read sector */
60 #define	ATC_RDVER		0x40	/* read verify */
61 #define	ATC_READ_DMA		0xc8	/* read (multiple) w/DMA */
62 #define	ATC_SEEK		0x70    /* seek */
63 #define	ATC_SERVICE		0xa2	/* queued/overlap service */
64 #define	ATC_SETMULT		0xc6	/* set multiple mode */
65 #define	ATC_WRITE_DMA		0xca	/* write (multiple) w/DMA */
66 #define	ATC_WRMULT		0xc5	/* write multiple */
67 #define	ATC_WRSEC		0x30    /* write sector */
68 
69 /*
70  * Low bits for Read/Write commands...
71  */
72 #define	ATCM_ECCRETRY	0x01    /* Enable ECC and RETRY by controller 	*/
73 				/* enabled if bit is CLEARED!!! 	*/
74 #define	ATCM_LONGMODE	0x02    /* Use Long Mode (get/send data & ECC) 	*/
75 
76 
77 /*
78  * Obsolete ATA commands.
79  */
80 
81 #define	ATC_RDLONG	0x23    /* read long without retry	*/
82 #define	ATC_ACK_MC	0xdb	/* acknowledge media change		*/
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif /* _ATA_CMD_H */
89