xref: /illumos-gate/usr/src/cmd/format/ctlr_ata.h (revision 3db86aab)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 
23 /*
24  * Copyright 1998-2002 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 #ifndef	_CTLR_ATA_H
29 #define	_CTLR_ATA_H
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 #include <sys/buf.h>
38 
39 
40 /*
41  * Rounded parameter, as returned in Extended Sense information
42  */
43 #define	ROUNDED_PARAMETER	0x37
44 
45 
46 /*
47  * Convert a three-byte triplet into an int
48  */
49 #define	TRIPLET(u, m, l)	((int)((((u))&0xff<<16) + \
50 				(((m)&0xff)<<8) + (l&0xff)))
51 #if	defined(i386)
52 daddr_t	altsec_offset;		/* Alternate sector offset */
53 #endif	/* defined(i386) */
54 
55 #ifdef	__STDC__
56 /*
57  *	Local prototypes for ANSI C compilers
58  */
59 
60 #if	defined(i386)
61 int	ata_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
62 #else	/* defined(i386) */
63 static int	ata_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
64 #endif	/* defined(i386) */
65 
66 int	ata_ex_man(struct defect_list *);
67 int	ata_ex_grown(struct defect_list *);
68 int	ata_read_defect_data(struct defect_list *, int);
69 int	apply_chg_list(int, int, uchar_t *, uchar_t *, struct chg_list *);
70 
71 #else /* ! _STDC_ */
72 
73 #if	defined(i386)
74 int	ata_rdwr();
75 int	ata_ex_cur();
76 #else	/* defined(i386) */
77 static int	ata_rdwr();
78 static int	ata_ex_cur();
79 #endif	/* defined(i386) */
80 
81 int	ata_ck_format();
82 int	ata_ex_man();
83 int	ata_ex_grown();
84 int	ata_read_defect_data();
85 int	apply_chg_list();
86 
87 #endif	/* __STDC__ */
88 
89 #ifdef	__cplusplus
90 }
91 #endif
92 
93 #endif	/* _CTLR_ATA_H */
94