xref: /illumos-gate/usr/src/cmd/format/ctlr_ata.h (revision a11d78d661ddb4b26a53fad39aba982d2bb5a63b)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_CTLR_ATA_H
28 #define	_CTLR_ATA_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #include <sys/buf.h>
35 
36 
37 /*
38  * Rounded parameter, as returned in Extended Sense information
39  */
40 #define	ROUNDED_PARAMETER	0x37
41 
42 
43 /*
44  * Convert a three-byte triplet into an int
45  */
46 #define	TRIPLET(u, m, l)	((int)((((u))&0xff<<16) + \
47 				(((m)&0xff)<<8) + (l&0xff)))
48 #if	defined(i386)
49 extern diskaddr_t	altsec_offset;	/* Alternate sector offset */
50 #endif	/* defined(i386) */
51 
52 /*
53  *	Local prototypes for ANSI C compilers
54  */
55 
56 #if	defined(i386)
57 #define	_STATIC
58 #else
59 #define	_STATIC	static
60 #endif	/* defined(i386) */
61 
62 _STATIC int	ata_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
63 
64 int	ata_ex_man(struct defect_list *);
65 int	ata_ex_grown(struct defect_list *);
66 int	ata_read_defect_data(struct defect_list *, int);
67 int	apply_chg_list(int, int, uchar_t *, uchar_t *, struct chg_list *);
68 
69 #ifdef	__cplusplus
70 }
71 #endif
72 
73 #endif	/* _CTLR_ATA_H */
74